Commit ·
9236a37
1
Parent(s): 4ad0ce1
refactor(api): switch LLM provider from MiniMax to Google Generative AI
Browse files- agent/agent.py +10 -3
- agent/api/api.py +4 -4
agent/agent.py
CHANGED
|
@@ -23,7 +23,14 @@ def supervisor_agent():
|
|
| 23 |
return create_agent(
|
| 24 |
model=get_llm(),
|
| 25 |
# tools=[math_solver, websearch_agent, web_search_agents],
|
| 26 |
-
tools=[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
system_prompt=(
|
| 28 |
f"You are a supervisor agent. "
|
| 29 |
f"Current time is: {datetime.now(timezone.utc).isoformat()}. "
|
|
@@ -34,8 +41,8 @@ def supervisor_agent():
|
|
| 34 |
f"to get a concise and accurate final answer. "
|
| 35 |
f"If an image or photo file is attached, download and use the ocr_reader tool "
|
| 36 |
f"to extract and describe the content before answering. "
|
| 37 |
-
f"Once you have found the answer, respond immediately. "
|
| 38 |
-
f"Do NOT continue searching or verifying unnecessarily — "
|
| 39 |
f"you have a limited number of action steps and must avoid exceeding them. "
|
| 40 |
f"If you do not have enough information to answer the question "
|
| 41 |
f"and no tool can help, respond with: "
|
|
|
|
| 23 |
return create_agent(
|
| 24 |
model=get_llm(),
|
| 25 |
# tools=[math_solver, websearch_agent, web_search_agents],
|
| 26 |
+
tools=[
|
| 27 |
+
math_solver,
|
| 28 |
+
web_search_agents,
|
| 29 |
+
file_downloader,
|
| 30 |
+
ocr_reader,
|
| 31 |
+
list_files,
|
| 32 |
+
http_get,
|
| 33 |
+
],
|
| 34 |
system_prompt=(
|
| 35 |
f"You are a supervisor agent. "
|
| 36 |
f"Current time is: {datetime.now(timezone.utc).isoformat()}. "
|
|
|
|
| 41 |
f"to get a concise and accurate final answer. "
|
| 42 |
f"If an image or photo file is attached, download and use the ocr_reader tool "
|
| 43 |
f"to extract and describe the content before answering. "
|
| 44 |
+
# f"Once you have found the answer, respond immediately. "
|
| 45 |
+
# f"Do NOT continue searching or verifying unnecessarily — "
|
| 46 |
f"you have a limited number of action steps and must avoid exceeding them. "
|
| 47 |
f"If you do not have enough information to answer the question "
|
| 48 |
f"and no tool can help, respond with: "
|
agent/api/api.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
-
|
| 2 |
|
| 3 |
-
from langchain_community.chat_models import MiniMaxChat
|
| 4 |
|
| 5 |
_llm = None
|
| 6 |
|
|
@@ -9,6 +9,6 @@ def get_llm():
|
|
| 9 |
"""Return a shared LLM instance."""
|
| 10 |
global _llm
|
| 11 |
if _llm is None:
|
| 12 |
-
|
| 13 |
-
_llm = MiniMaxChat(model="MiniMax-M2.
|
| 14 |
return _llm
|
|
|
|
| 1 |
+
from langchain_google_genai import ChatGoogleGenerativeAI
|
| 2 |
|
| 3 |
+
# from langchain_community.chat_models import MiniMaxChat
|
| 4 |
|
| 5 |
_llm = None
|
| 6 |
|
|
|
|
| 9 |
"""Return a shared LLM instance."""
|
| 10 |
global _llm
|
| 11 |
if _llm is None:
|
| 12 |
+
_llm = ChatGoogleGenerativeAI(model="gemini-3.1-flash-lite-preview")
|
| 13 |
+
# _llm = MiniMaxChat(model="MiniMax-M2.7-highspeed")
|
| 14 |
return _llm
|