travel-agent-cli 0.3.0 → 0.3.1
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 +1 -1
- package/python/config/settings.py +1 -1
- package/python/main.py +6 -3
package/package.json
CHANGED
package/python/main.py
CHANGED
|
@@ -524,10 +524,13 @@ def _switch_model(settings, provider: str, model_name: Optional[str]):
|
|
|
524
524
|
|
|
525
525
|
def _update_model_config(provider: str, model_name: Optional[str]):
|
|
526
526
|
"""更新模型配置"""
|
|
527
|
-
|
|
527
|
+
# 在项目根目录下查找 .env 文件
|
|
528
|
+
env_path = Path(__file__).parent / ".env"
|
|
528
529
|
if not env_path.exists():
|
|
529
530
|
console.print("[yellow].env 文件不存在,正在创建...[/yellow]")
|
|
530
531
|
_init_config()
|
|
532
|
+
# 重新获取路径
|
|
533
|
+
env_path = Path(__file__).parent / ".env"
|
|
531
534
|
|
|
532
535
|
# 重新读取配置(如果刚创建)
|
|
533
536
|
if not env_path.exists():
|
|
@@ -594,8 +597,8 @@ def _init_config():
|
|
|
594
597
|
console.print("请确保已正确安装 travel-agent-cli")
|
|
595
598
|
return
|
|
596
599
|
|
|
597
|
-
#
|
|
598
|
-
dst = Path
|
|
600
|
+
# 在项目目录下创建 .env 文件
|
|
601
|
+
dst = Path(__file__).parent / ".env"
|
|
599
602
|
if not dst.exists():
|
|
600
603
|
shutil.copy(src, dst)
|
|
601
604
|
console.print("[green]已创建 .env 配置文件[/green]")
|