This commit is contained in:
parent
c3abae8549
commit
d522d3ec43
|
|
@ -0,0 +1,15 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# 預設清理當前目錄,也可以傳入指定目錄
|
||||||
|
TARGET_DIR="${1:-.}"
|
||||||
|
|
||||||
|
echo "🧹 Cleaning __pycache__ & .DS_Store under: $TARGET_DIR"
|
||||||
|
|
||||||
|
# 刪除所有 __pycache__ 資料夾
|
||||||
|
find "$TARGET_DIR" -type d -name "__pycache__" -exec rm -rf {} +
|
||||||
|
|
||||||
|
# 刪除所有 .DS_Store 檔案
|
||||||
|
find "$TARGET_DIR" -type f -name ".DS_Store" -delete
|
||||||
|
|
||||||
|
echo "✅ Done. All __pycache__ and .DS_Store removed."
|
||||||
|
|
@ -10,7 +10,7 @@ DEFAULT_CONFIG = {
|
||||||
),
|
),
|
||||||
# LLM 設定
|
# LLM 設定
|
||||||
"llm_provider": "openai",
|
"llm_provider": "openai",
|
||||||
"deep_think_llm": "o4-mini",
|
"deep_think_llm": "gpt-4o-mini",
|
||||||
"quick_think_llm": "gpt-4o-mini",
|
"quick_think_llm": "gpt-4o-mini",
|
||||||
"backend_url": "https://api.openai.com/v1",
|
"backend_url": "https://api.openai.com/v1",
|
||||||
# 辯論與討論設定
|
# 辯論與討論設定
|
||||||
|
|
|
||||||
|
|
@ -84,8 +84,18 @@ class TradingAgentsGraph:
|
||||||
# 初始化 LLM
|
# 初始化 LLM
|
||||||
provider = self.config["llm_provider"].lower()
|
provider = self.config["llm_provider"].lower()
|
||||||
if provider in ["openai", "ollama", "openrouter"]:
|
if provider in ["openai", "ollama", "openrouter"]:
|
||||||
self.deep_thinking_llm = ChatOpenAI(model=self.config["deep_think_llm"], base_url=self.config["backend_url"])
|
# Get the OpenAI API key from environment variable
|
||||||
self.quick_thinking_llm = ChatOpenAI(model=self.config["quick_think_llm"], base_url=self.config["backend_url"])
|
openai_api_key = os.getenv("OPENAI_API_KEY")
|
||||||
|
self.deep_thinking_llm = ChatOpenAI(
|
||||||
|
model=self.config["deep_think_llm"],
|
||||||
|
base_url=self.config["backend_url"],
|
||||||
|
openai_api_key=openai_api_key
|
||||||
|
)
|
||||||
|
self.quick_thinking_llm = ChatOpenAI(
|
||||||
|
model=self.config["quick_think_llm"],
|
||||||
|
base_url=self.config["backend_url"],
|
||||||
|
openai_api_key=openai_api_key
|
||||||
|
)
|
||||||
elif provider == "anthropic":
|
elif provider == "anthropic":
|
||||||
self.deep_thinking_llm = ChatAnthropic(model=self.config["deep_think_llm"], base_url=self.config["backend_url"])
|
self.deep_thinking_llm = ChatAnthropic(model=self.config["deep_think_llm"], base_url=self.config["backend_url"])
|
||||||
self.quick_thinking_llm = ChatAnthropic(model=self.config["quick_think_llm"], base_url=self.config["backend_url"])
|
self.quick_thinking_llm = ChatAnthropic(model=self.config["quick_think_llm"], base_url=self.config["backend_url"])
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue