travel-agent-cli 0.2.6 → 0.2.8
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/main.py +7 -3
package/package.json
CHANGED
package/python/main.py
CHANGED
|
@@ -477,11 +477,15 @@ def _switch_model(settings, provider: str, model_name: Optional[str]):
|
|
|
477
477
|
|
|
478
478
|
def _update_model_config(provider: str, model_name: Optional[str]):
|
|
479
479
|
"""更新模型配置"""
|
|
480
|
-
env_path = Path(".env"
|
|
480
|
+
env_path = Path.home() / ".env"
|
|
481
481
|
if not env_path.exists():
|
|
482
482
|
console.print("[yellow].env 文件不存在,正在创建...[/yellow]")
|
|
483
|
-
|
|
484
|
-
|
|
483
|
+
_init_config()
|
|
484
|
+
|
|
485
|
+
# 重新读取配置(如果刚创建)
|
|
486
|
+
if not env_path.exists():
|
|
487
|
+
console.print("[red]错误:无法创建 .env 文件[/red]")
|
|
488
|
+
return
|
|
485
489
|
|
|
486
490
|
config_lines = []
|
|
487
491
|
with open(env_path, "r") as f:
|