Standardize LLM clients and expose configurable base URLs.
This commit is contained in:
@@ -27,7 +27,18 @@ except locale.Error:
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
|
||||
|
||||
from InsightEngine import DeepSearchAgent, Config
|
||||
from config import DEEPSEEK_API_KEY, KIMI_API_KEY, DB_HOST, DB_USER, DB_PASSWORD, DB_NAME, DB_PORT, DB_CHARSET
|
||||
from config import (
|
||||
DEEPSEEK_API_KEY,
|
||||
DEEPSEEK_BASE_URL,
|
||||
KIMI_API_KEY,
|
||||
KIMI_BASE_URL,
|
||||
DB_HOST,
|
||||
DB_USER,
|
||||
DB_PASSWORD,
|
||||
DB_NAME,
|
||||
DB_PORT,
|
||||
DB_CHARSET,
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
@@ -111,6 +122,8 @@ def main():
|
||||
deepseek_api_key=None,
|
||||
openai_api_key=None,
|
||||
kimi_api_key=KIMI_API_KEY, # 强制使用配置文件中的Kimi Key
|
||||
deepseek_base_url=DEEPSEEK_BASE_URL,
|
||||
kimi_base_url=KIMI_BASE_URL,
|
||||
db_host=db_host,
|
||||
db_user=db_user,
|
||||
db_password=db_password,
|
||||
@@ -225,4 +238,4 @@ def display_results(agent: DeepSearchAgent, final_report: str):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
main()
|
||||
|
||||
@@ -27,7 +27,13 @@ except locale.Error:
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
|
||||
|
||||
from MediaEngine import DeepSearchAgent, Config
|
||||
from config import DEEPSEEK_API_KEY, BOCHA_Web_Search_API_KEY, GEMINI_API_KEY
|
||||
from config import (
|
||||
DEEPSEEK_API_KEY,
|
||||
DEEPSEEK_BASE_URL,
|
||||
BOCHA_Web_Search_API_KEY,
|
||||
GEMINI_API_KEY,
|
||||
GEMINI_BASE_URL,
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
@@ -112,6 +118,8 @@ def main():
|
||||
openai_api_key=None,
|
||||
gemini_api_key=gemini_key,
|
||||
bocha_api_key=bocha_key,
|
||||
deepseek_base_url=DEEPSEEK_BASE_URL,
|
||||
gemini_base_url=GEMINI_BASE_URL,
|
||||
default_llm_provider=llm_provider,
|
||||
deepseek_model="deepseek-chat", # 保留默认值以兼容
|
||||
openai_model="gpt-4o-mini", # 保留默认值以兼容
|
||||
@@ -220,4 +228,4 @@ def display_results(agent: DeepSearchAgent, final_report: str):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
main()
|
||||
|
||||
@@ -27,7 +27,7 @@ except locale.Error:
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
|
||||
|
||||
from QueryEngine import DeepSearchAgent, Config
|
||||
from config import DEEPSEEK_API_KEY, TAVILY_API_KEY
|
||||
from config import DEEPSEEK_API_KEY, DEEPSEEK_BASE_URL, TAVILY_API_KEY
|
||||
|
||||
|
||||
def main():
|
||||
@@ -110,6 +110,7 @@ def main():
|
||||
deepseek_api_key=deepseek_key,
|
||||
openai_api_key=None,
|
||||
tavily_api_key=tavily_key,
|
||||
deepseek_base_url=DEEPSEEK_BASE_URL,
|
||||
default_llm_provider=llm_provider,
|
||||
deepseek_model=model_name,
|
||||
openai_model="gpt-4o-mini", # 保留默认值以兼容
|
||||
@@ -217,4 +218,4 @@ def display_results(agent: DeepSearchAgent, final_report: str):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user