travel-agent-cli 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "travel-agent-cli",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "AI 驱动的旅行目的地推荐 Agent - 命令行工具(集成 FlyAI 旅行搜索)",
5
5
  "bin": {
6
6
  "travel-agent": "bin/cli.js",
@@ -0,0 +1,56 @@
1
+ # 旅行 Agent 配置 - 支持多 LLM 提供商
2
+
3
+ # ========== LLM 配置(必填:至少配置一个)==========
4
+
5
+ # 使用哪个 LLM 提供商:anthropic, openai, deepseek, azure, ollama, qwen
6
+ LLM_PROVIDER=anthropic
7
+
8
+ # 使用的模型名称(留空则使用默认)
9
+ # Anthropic: claude-sonnet-4-6, claude-opus-4-6
10
+ # OpenAI: gpt-4o, gpt-4-turbo
11
+ # DeepSeek: deepseek-chat
12
+ # Azure OpenAI: gpt-4
13
+ # Ollama: llama3, mistral, qwen2
14
+ # Qwen (通义千问): qwen-max, qwen-plus, qwen-turbo, qwen-long
15
+ LLM_MODEL=
16
+
17
+ # --- Anthropic 配置 ---
18
+ ANTHROPIC_API_KEY=
19
+
20
+ # --- OpenAI 配置 ---
21
+ OPENAI_API_KEY=
22
+
23
+ # --- DeepSeek 配置 ---
24
+ DEEPSEEK_API_KEY=
25
+
26
+ # --- Azure OpenAI 配置 ---
27
+ AZURE_OPENAI_API_KEY=
28
+ AZURE_OPENAI_ENDPOINT=
29
+ AZURE_OPENAI_API_VERSION=2024-02-15-preview
30
+
31
+ # --- Ollama 配置(本地部署,无需 API Key)---
32
+ OLLAMA_BASE_URL=http://localhost:11434
33
+
34
+ # --- 阿里云通义千问(Qwen)配置 ---
35
+ DASHSCOPE_API_KEY=
36
+
37
+ # ========== 其他配置(可选)==========
38
+
39
+ # 微博 API 配置
40
+ WEIBO_APP_KEY=
41
+ WEIBO_APP_SECRET=
42
+
43
+ # 代理配置(用于爬取)
44
+ HTTP_PROXY=
45
+ HTTPS_PROXY=
46
+
47
+ # 数据库路径
48
+ DATABASE_PATH=./data/travel_agent.db
49
+
50
+ # 报告输出目录
51
+ OUTPUT_DIR=./output
52
+
53
+ # HTTP 请求配置
54
+ REQUEST_TIMEOUT=30
55
+ MAX_RETRIES=3
56
+ REQUEST_DELAY=1.0
package/python/main.py CHANGED
@@ -524,11 +524,30 @@ def _update_model_config(provider: str, model_name: Optional[str]):
524
524
  def _init_config():
525
525
  """初始化配置文件"""
526
526
  import shutil
527
- src = Path(".env.example")
528
- dst = Path(".env")
527
+
528
+ # 在包的目录中查找 .env.example
529
+ possible_paths = [
530
+ Path(__file__).parent / ".env.example",
531
+ Path.cwd() / ".env.example",
532
+ Path.cwd() / "python" / ".env.example",
533
+ ]
534
+
535
+ src = None
536
+ for p in possible_paths:
537
+ if p.exists():
538
+ src = p
539
+ break
540
+
541
+ if not src:
542
+ console.print("[red]错误:未找到 .env.example 文件[/red]")
543
+ console.print("请确保已正确安装 travel-agent-cli")
544
+ return
545
+
546
+ dst = Path.cwd() / ".env"
529
547
  if not dst.exists():
530
548
  shutil.copy(src, dst)
531
549
  console.print("[green]已创建 .env 配置文件[/green]")
550
+ console.print(f"[dim]位置:{dst}[/dim]")
532
551
  else:
533
552
  console.print("[yellow].env 文件已存在[/yellow]")
534
553