TravelPal
架构与设计
ADR-001: CA / VNS 平级并行架构
ADR-002: 前端架构选型
ADR-003: 可视化方案变更——Cesium 3D → AMap 2D
ADR-004: 项目哲学——"旅行伴侣"而非"规划工具"
ADR-005: 营业时间 LLM 解析与 Agent 架构决策
ADR-006: MCP 协议迁移预留
ADR-007: BM25 RAG 知识检索
规范与路线图
编码规范
Git 工作流
产品路线图
项目结构与部署
项目总览
后端结构
前端结构
Agent 层
统一数据字典
文档系统介绍
部署指引
Python API 参考
API Reference
TravelPal
索引
索引
_
|
A
|
B
|
C
|
D
|
E
|
F
|
G
|
H
|
I
|
L
|
M
|
N
|
O
|
P
|
R
|
S
|
T
|
U
|
V
|
W
|
X
|
Y
_
_2opt() (engine.vns.VNSSolver 方法)
__tablename__(data.model.models.HistoryRecord 属性)
_avgdl(agent.tools.rag.RagEngine 属性)
_bm25_score() (agent.tools.rag.RagEngine 方法)
_build_index() (agent.tools.rag.RagEngine 方法)
_build_poi_cache()(在 api.routes 模块中)
_cal_fitness() (engine.ca.CASolver 方法)
_cal_fitness() (engine.vns.VNSSolver 方法)
_cal_fitness_numba()(在 engine.ca 模块中)
_cal_fitness_numba()(在 engine.vns 模块中)
_classify_poi()(在 agent.tools.poi 模块中)
_collect_names()(在 utils.sync_all 模块中)
_deduplicate()(在 engine.search 模块中)
_DOC_DIR()(在 agent.tools.rag 模块中)
_docs(agent.tools.rag.RagEngine 属性)
_engine()(在 agent.tools.rag 模块中)
_get_driving_data()(在 data.amap_loader 模块中)
_get_neighbor() (engine.ca.CASolver 方法)
_HOLIDAYS_AVAILABLE()(在 agent.tools.prompts 模块中)
,
[1]
_idf(agent.tools.rag.RagEngine 属性)
_init_nearest_neighbor() (engine.vns.VNSSolver 方法)
_init_random() (engine.vns.VNSSolver 方法)
_init_time_window() (engine.vns.VNSSolver 方法)
_initial_solution() (engine.ca.CASolver 方法)
_initialized(agent.tools.rag.RagEngine 属性)
_insert() (engine.vns.VNSSolver 方法)
_inversion() (engine.vns.VNSSolver 方法)
_load_docs() (agent.tools.rag.RagEngine 方法)
_local_search() (engine.vns.VNSSolver 方法)
_local_search_2opt() (engine.ca.CASolver 方法)
_MIDDLE_DOTS()(在 data.amap_loader 模块中)
_parse_date()(在 data.amap_loader 模块中)
_parse_opentime_to_tw()(在 data.amap_loader 模块中)
_perturb_around() (engine.vns.VNSSolver 方法)
_PROJECT_ROOT()(在 agent.chat 模块中)
_PROJECT_ROOT()(在 agent.tools.rag 模块中)
_readme_core()(在 agent.chat 模块中)
_rebuild()(在 utils.sync_all 模块中)
_rebuild_schedule()(在 engine.pipeline 模块中)
_shaking() (engine.vns.VNSSolver 方法)
_standard_neighbor() (engine.ca.CASolver 方法)
_STOP_WORDS()(在 agent.tools.rag 模块中)
_supplement_polylines()(在 engine.pipeline 模块中)
_swap() (engine.vns.VNSSolver 方法)
_time_window_guided_neighbor() (engine.ca.CASolver 方法)
_tokenize()(在 agent.tools.rag 模块中)
_update_elite() (engine.vns.VNSSolver 方法)
_vnd() (engine.vns.VNSSolver 方法)
A
add_poi_to_plan()(在 agent.planner 模块中)
address(api.schemas.POILookupItem 属性)
address(typedefs.PoiCacheItem 属性)
adjust_plan()(在 engine.pipeline 模块中)
adjust_plan_days()(在 agent.planner 模块中)
adjustments(api.schemas.PlanAdjustRequest 属性)
agent
module
agent.chat
module
agent.commentator
module
agent.planner
module
agent.tools
module
agent.tools.poi
module
agent.tools.prompts
module
agent.tools.rag
module
algo_time(typedefs.PlanResult 属性)
AMAP_API_KEY()(在 config 模块中)
amap_api_key(typedefs.PlanResult 属性)
AMAP_JS_KEY()(在 config 模块中)
AMAP_JS_SECURITY_CODE()(在 config 模块中)
amap_security_code(typedefs.PlanResult 属性)
analyze_solution()(在 engine.fitness 模块中)
api
module
api.routes
module
api.schemas
module
api.server
module
app()(在 api.server 模块中)
arrival_status(typedefs.ScheduleItem 属性)
arrival(typedefs.ScheduleItem 属性)
async_session()(在 data.model.database 模块中)
B
BACKEND()(在 utils.sync_all 模块中)
balance_groups()(在 engine.search 模块中)
Base(data.model.database 中的类)
best_days(typedefs.ClusterResult 属性)
best_days(typedefs.PlanResult 属性)
best_m(typedefs.ClusterResult 属性)
best_m(typedefs.PlanResult 属性)
build_chat_messages()(在 agent.chat 模块中)
build_date_context()(在 agent.tools.prompts 模块中)
build_real_data()(在 data.amap_loader 模块中)
C
CA_DEFAULT_PARAMS()(在 engine.ca 模块中)
ca_suggest()(在 engine.search 模块中)
call_cluster()(在 engine.clustering 模块中)
CASolver(engine.ca 中的类)
chat()(在 api.routes 模块中)
chat_stream()(在 agent.chat 模块中)
CHAT_SYSTEM()(在 agent.tools.prompts 模块中)
ChatRequest(api.schemas 中的类)
check_density()(在 agent.commentator 模块中)
check_distance()(在 agent.commentator 模块中)
check_late()(在 agent.commentator 模块中)
check_normal()(在 agent.commentator 模块中)
check_wait()(在 agent.commentator 模块中)
city_indices(engine.ca.CASolver 属性)
city_indices(engine.vns.VNSSolver 属性)
city(api.schemas.HistoryCreate 属性)
city(api.schemas.HistoryDetail 属性)
city(api.schemas.HistorySummary 属性)
city(api.schemas.PlanRequest 属性)
city(api.schemas.POILookupRequest 属性)
city(data.model.models.HistoryRecord 属性)
close_db()(在 data.model.database 模块中)
cluster_and_solve()(在 engine.search 模块中)
cluster_by_distance_kmeans()(在 engine.clustering 模块中)
cluster_by_spatiotemporal()(在 engine.clustering 模块中)
cluster_by_time_density()(在 engine.clustering 模块中)
cluster_by_time_overlap()(在 engine.clustering 模块中)
cluster_by_time_window()(在 engine.clustering 模块中)
cluster_hybrid_optimized()(在 engine.clustering 模块中)
CLUSTER_METHODS()(在 engine.clustering 模块中)
ClusterResult(typedefs 中的类)
commentary(typedefs.PlanResult 属性)
config
module
cost_matrix(api.schemas.PlanAdjustRequest 属性)
cost_matrix(api.schemas.PlanRequest 属性)
cost_matrix(typedefs.PlanResult 属性)
cost(api.schemas.HistoryCreate 属性)
cost(api.schemas.HistoryDetail 属性)
cost(api.schemas.HistorySummary 属性)
cost(data.model.models.HistoryRecord 属性)
create_app()(在 api.server 模块中)
create_history()(在 api.routes 模块中)
created_at(api.schemas.HistoryDetail 属性)
created_at(api.schemas.HistorySummary 属性)
created_at(data.model.models.HistoryRecord 属性)
D
daily_schedules(typedefs.PlanResult 属性)
data
module
data.amap_loader
module
data.model
module
data.model.database
module
data.model.models
module
DATABASE_URL()(在 config 模块中)
dataset_name(typedefs.PlanResult 属性)
day_start(api.schemas.PlanRequest 属性)
delete_history()(在 api.routes 模块中)
departure_status(typedefs.ScheduleItem 属性)
departure(typedefs.ScheduleItem 属性)
depot_index(engine.ca.CASolver 属性)
depot_index(engine.vns.VNSSolver 属性)
device_id(api.schemas.HistoryCreate 属性)
device_id(api.schemas.HistoryDeleteRequest 属性)
device_id(data.model.models.HistoryRecord 属性)
dist_matrix(api.schemas.PlanAdjustRequest 属性)
dist_matrix(api.schemas.PlanRequest 属性)
dist_matrix(typedefs.PlanResult 属性)
DYNAMIC_STRENGTHEN_AFTER()(在 engine.vns 模块中)
E
EARLY_EXPLORE_RATIO()(在 engine.vns 模块中)
early_wait_weight(api.schemas.PlanRequest 属性)
early_wait_weight(engine.ca.CASolver 属性)
early_wait_weight(engine.vns.VNSSolver 属性)
elite_pool(engine.vns.VNSSolver 属性)
EMBEDDING_API_KEY()(在 config 模块中)
EMBEDDING_BASE_URL()(在 config 模块中)
EMBEDDING_MODEL()(在 config 模块中)
engine
module
engine()(在 data.model.database 模块中)
engine.ca
module
engine.clustering
module
engine.fitness
module
engine.pipeline
module
engine.search
module
engine.vns
module
expected_arrival(api.schemas.POIItem 属性)
expected_arrival(typedefs.PoiCacheItem 属性)
expected_arrival(typedefs.SpotDict 属性)
F
failed(api.schemas.POILookupResponse 属性)
find_method_func()(在 engine.clustering 模块中)
fitness_cache(engine.vns.VNSSolver 属性)
G
generate_commentary()(在 agent.commentator 模块中)
get_elite_pool() (engine.vns.VNSSolver 方法)
get_history_detail()(在 api.routes 模块中)
get_poi_details()(在 data.amap_loader 模块中)
get_session()(在 data.model.database 模块中)
H
histories(typedefs.RouteResult 属性)
HistoryCreate(api.schemas 中的类)
HistoryDeleteRequest(api.schemas 中的类)
HistoryDetail(api.schemas 中的类)
HistoryListResponse(api.schemas 中的类)
HistoryRecord(data.model.models 中的类)
HistorySummary(api.schemas 中的类)
hotel_lat(api.schemas.PlanRequest 属性)
hotel_lon(api.schemas.PlanRequest 属性)
hotel_name(api.schemas.PlanRequest 属性)
hotel_tw_end(api.schemas.PlanRequest 属性)
hotel_tw_start(api.schemas.PlanRequest 属性)
hotel(api.schemas.HistoryCreate 属性)
hotel(api.schemas.HistoryDetail 属性)
hotel(api.schemas.HistorySummary 属性)
hotel(data.model.models.HistoryRecord 属性)
hotel(typedefs.PoiCache 属性)
I
id(api.schemas.HistoryDetail 属性)
id(api.schemas.HistorySummary 属性)
id(data.model.models.HistoryRecord 属性)
init() (agent.tools.rag.RagEngine 方法)
init_db()(在 data.model.database 模块中)
items(api.schemas.HistoryListResponse 属性)
items(api.schemas.POILookupResponse 属性)
L
last_operator(engine.vns.VNSSolver 属性)
late_return_weight(api.schemas.PlanRequest 属性)
late_return_weight(engine.ca.CASolver 属性)
late_return_weight(engine.vns.VNSSolver 属性)
late(typedefs.RouteResult 属性)
lat(api.schemas.POIItem 属性)
lat(api.schemas.POILookupItem 属性)
lat(typedefs.PoiCacheItem 属性)
lat(typedefs.SpotDict 属性)
legacy_only()(在 utils.deprecated 模块中)
lifespan()(在 api.server 模块中)
list_history()(在 api.routes 模块中)
LLM_API_KEY()(在 config 模块中)
LLM_BASE_URL()(在 config 模块中)
LLM_MODEL()(在 config 模块中)
lon(api.schemas.POIItem 属性)
lon(api.schemas.POILookupItem 属性)
lon(typedefs.PoiCacheItem 属性)
lon(typedefs.SpotDict 属性)
M
main()(在 api.server 模块中)
main()(在 utils.gen_openapi 模块中)
main()(在 utils.sync_all 模块中)
message(api.schemas.ChatRequest 属性)
min_days(api.schemas.PlanRequest 属性)
MOCK_MODE()(在 agent.chat 模块中)
mock_stream_chat()(在 agent.chat 模块中)
mode(api.schemas.PlanRequest 属性)
mode(typedefs.PlanResult 属性)
module
agent
agent.chat
agent.commentator
agent.planner
agent.tools
agent.tools.poi
agent.tools.prompts
agent.tools.rag
api
api.routes
api.schemas
api.server
config
data
data.amap_loader
data.model
data.model.database
data.model.models
engine
engine.ca
engine.clustering
engine.fitness
engine.pipeline
engine.search
engine.vns
typedefs
utils
utils.deprecated
utils.gen_openapi
utils.sync_all
N
n_days(api.schemas.HistoryCreate 属性)
n_days(api.schemas.HistoryDetail 属性)
n_days(api.schemas.HistorySummary 属性)
n_days(api.schemas.PlanRequest 属性)
n_days(data.model.models.HistoryRecord 属性)
names(api.schemas.POILookupRequest 属性)
name(api.schemas.POIItem 属性)
name(api.schemas.POILookupItem 属性)
name(typedefs.PoiCacheItem 属性)
name(typedefs.ScheduleItem 属性)
name(typedefs.SpotDict 属性)
normalize_text()(在 data.amap_loader 模块中)
note(api.schemas.HistoryCreate 属性)
note(api.schemas.HistoryDetail 属性)
note(api.schemas.HistorySummary 属性)
note(data.model.models.HistoryRecord 属性)
num_cities(engine.ca.CASolver 属性)
num_cities(engine.vns.VNSSolver 属性)
O
operator_weights(engine.vns.VNSSolver 属性)
original_tw(typedefs.SpotDict 属性)
P
page_size(api.schemas.HistoryListResponse 属性)
page(api.schemas.HistoryListResponse 属性)
params(engine.ca.CASolver 属性)
params(engine.vns.VNSSolver 属性)
parse_biz_hours()(在 agent.tools.poi 模块中)
PARSE_PROMPT()(在 agent.tools.prompts 模块中)
penalty_weight(api.schemas.PlanRequest 属性)
penalty_weight(engine.ca.CASolver 属性)
penalty_weight(engine.vns.VNSSolver 属性)
plan()(在 api.routes 模块中)
plan_result(api.schemas.ChatRequest 属性)
plan_result(api.schemas.HistoryCreate 属性)
plan_result(api.schemas.HistoryDetail 属性)
plan_result(data.model.models.HistoryRecord 属性)
PlanAdjustRequest(api.schemas 中的类)
PlanRequest(api.schemas 中的类)
PlanResult(typedefs 中的类)
poi_lookup()(在 agent.tools.poi 模块中)
poi_lookup()(在 api.routes 模块中)
POI_TOOL_DEF()(在 agent.tools.prompts 模块中)
PoiCacheItem(typedefs 中的类)
PoiCache(typedefs 中的类)
POIItem(api.schemas 中的类)
POILookupItem(api.schemas 中的类)
POILookupRequest(api.schemas 中的类)
POILookupResponse(api.schemas 中的类)
polish_with_llm()(在 agent.commentator 模块中)
polylines(typedefs.PlanResult 属性)
pure_name()(在 engine.clustering 模块中)
R
RagEngine(agent.tools.rag 中的类)
remove_poi_from_plan()(在 agent.planner 模块中)
request_params(api.schemas.HistoryCreate 属性)
request_params(api.schemas.HistoryDetail 属性)
request_params(data.model.models.HistoryRecord 属性)
router()(在 api.routes 模块中)
RouteResult(typedefs 中的类)
routes(api.schemas.PlanAdjustRequest 属性)
routes(typedefs.RouteResult 属性)
RULES()(在 agent.commentator 模块中)
run_planning()(在 engine.pipeline 模块中)
S
ScheduleItem(typedefs 中的类)
search() (agent.tools.rag.RagEngine 方法)
search_rag()(在 agent.tools.rag 模块中)
SKIP_DB()(在 data.model.database 模块中)
solution(typedefs.ClusterResult 属性)
solution(typedefs.PlanResult 属性)
solve() (engine.ca.CASolver 方法)
solve() (engine.vns.VNSSolver 方法)
solve_groups()(在 engine.search 模块中)
spot_count(api.schemas.HistoryCreate 属性)
spot_count(api.schemas.HistoryDetail 属性)
spot_count(api.schemas.HistorySummary 属性)
spot_count(data.model.models.HistoryRecord 属性)
SpotDict(typedefs 中的类)
spots_dict(engine.ca.CASolver 属性)
spots_dict(engine.vns.VNSSolver 属性)
spots_end(engine.ca.CASolver 属性)
spots_end(engine.vns.VNSSolver 属性)
spots_start(engine.ca.CASolver 属性)
spots_start(engine.vns.VNSSolver 属性)
spots_stay(engine.ca.CASolver 属性)
spots_stay(engine.vns.VNSSolver 属性)
spots(api.schemas.PlanAdjustRequest 属性)
spots(api.schemas.PlanRequest 属性)
spots(typedefs.PlanResult 属性)
spots(typedefs.PoiCache 属性)
stay(api.schemas.POIItem 属性)
stay(typedefs.PoiCacheItem 属性)
stay(typedefs.ScheduleItem 属性)
stay(typedefs.SpotDict 属性)
stream_chat()(在 agent.chat 模块中)
suggest()(在 api.routes 模块中)
sync_file()(在 utils.sync_all 模块中)
T
TOOL_DEFINITIONS()(在 agent.tools.prompts 模块中)
TOOL_REGISTRY()(在 agent.tools 模块中)
total_cost(typedefs.RouteResult 属性)
total_dist(typedefs.RouteResult 属性)
total(api.schemas.HistoryListResponse 属性)
TRAVEL_SPEED()(在 engine.pipeline 模块中)
travel_speed(engine.ca.CASolver 属性)
travel_speed(engine.vns.VNSSolver 属性)
tw_end(api.schemas.POIItem 属性)
tw_end(api.schemas.POILookupItem 属性)
tw_start(api.schemas.POIItem 属性)
tw_start(api.schemas.POILookupItem 属性)
tw(typedefs.PoiCacheItem 属性)
tw(typedefs.ScheduleItem 属性)
tw(typedefs.SpotDict 属性)
typedefs
module
type(typedefs.ClusterResult 属性)
U
use_real_time_matrix(engine.ca.CASolver 属性)
use_real_time_matrix(engine.vns.VNSSolver 属性)
utils
module
utils.deprecated
module
utils.gen_openapi
module
utils.sync_all
module
V
valid(typedefs.RouteResult 属性)
VIOLATOR_TARGET_PROB()(在 engine.vns 模块中)
VNS_DEFAULT_PARAMS()(在 engine.vns 模块中)
VNSSolver(engine.vns 中的类)
W
wait(typedefs.RouteResult 属性)
WEIGHT_REWARD_FACTOR()(在 engine.vns 模块中)
X
x(typedefs.SpotDict 属性)
Y
y(typedefs.SpotDict 属性)