Skip to content

Commit 1d3f37d

Browse files
committed
fixed some bugs
1 parent 8bfaeb5 commit 1d3f37d

File tree

5 files changed

+45
-13
lines changed

5 files changed

+45
-13
lines changed

examples/run_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ async def main():
2222
logger.info(f"Load config: {config}")
2323

2424
# Registed models
25-
model_manager.init_models(use_local_proxy=False)
25+
model_manager.init_models(use_local_proxy=True)
2626
logger.info("Registed models: %s", ", ".join(model_manager.registed_models.keys()))
2727

2828
# Create agent

src/config/cfg.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class SearcherToolConfig(BaseModel):
2121
max_length: int = Field(default=50000, description="Maximum character length for the content to be fetched")
2222

2323
class DeepResearcherToolConfig(BaseModel):
24-
model_id: str = Field(default="claude-4-sonnet", description="Model ID for the LLM to use")
24+
model_id: str = Field(default="gpt-4.1", description="Model ID for the LLM to use")
2525
max_depth: int = Field(default=2, description="Maximum depth for the search")
2626
max_insights: int = Field(default=20, description="Maximum number of insights to extract")
2727
time_limit_seconds: int = Field(default=60, description="Time limit for the search in seconds")
@@ -48,7 +48,7 @@ class DeepAnalyzerToolConfig(BaseModel):
4848
summarizer_model_id: str = Field(default="gemini-2.5-pro", description="Model ID for the LLM to use")
4949

5050
class AgentConfig(BaseModel):
51-
model_id: str = Field(default="claude-4-sonnet",
51+
model_id: str = Field(default="gpt-4.1",
5252
description="Model ID for the LLM to use")
5353
name: str = Field(default="agent",
5454
description="Name of the agent")
@@ -64,10 +64,10 @@ class AgentConfig(BaseModel):
6464
description="List of agents the agent can manage")
6565

6666
class HierarchicalAgentConfig(BaseModel):
67-
name: str = Field(default="agentscope", description="Name of the hierarchical agent")
67+
name: str = Field(default="dra", description="Name of the hierarchical agent")
6868
use_hierarchical_agent: bool = Field(default=True, description="Whether to use hierarchical agent")
6969
planning_agent_config: AgentConfig = Field(default_factory=lambda: AgentConfig(
70-
model_id="claude-4-sonnet",
70+
model_id="gpt-4.1",
7171
name="planning_agent",
7272
description="A planning agent that can plan the steps to complete the task.",
7373
max_steps=20,
@@ -76,7 +76,7 @@ class HierarchicalAgentConfig(BaseModel):
7676
managed_agents=["deep_analyzer_agent", "browser_use_agent", "deep_researcher_agent"],
7777
))
7878
deep_analyzer_agent_config: AgentConfig = Field(default_factory=lambda: AgentConfig(
79-
model_id="claude-4-sonnet",
79+
model_id="gpt-4.1",
8080
name="deep_analyzer_agent",
8181
description="A team member that that performs systematic, step-by-step analysis of a given task, optionally leveraging information from external resources such as attached file or uri to provide comprehensive reasoning and answers. For any tasks that require in-depth analysis, particularly those involving attached file or uri, game, chess, computational tasks, or any other complex tasks. Please ask him for the reasoning and the final answer.",
8282
max_steps=3,
@@ -92,7 +92,7 @@ class HierarchicalAgentConfig(BaseModel):
9292
tools=["auto_browser_use", "python_interpreter"],
9393
))
9494
deep_researcher_agent_config: AgentConfig = Field(default_factory=lambda: AgentConfig(
95-
model_id="claude-4-sonnet",
95+
model_id="gpt-4.1",
9696
name="deep_researcher_agent",
9797
description="A team member capable of conducting extensive web searches to complete tasks, primarily focused on retrieving broad and preliminary information for quickly understanding a topic or obtaining rough answers. For tasks that require precise, structured, or interactive page-level information retrieval, please use the `browser_use_agent`.",
9898
max_steps=3,

src/tools/deep_researcher.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,8 @@ async def _analyze_content(
566566
return insights
567567

568568
async def _summary(self, query: str, reference_materials: str) -> str:
569-
model = model_manager.registed_models["Qwen"]
569+
570+
model = model_manager.registed_models['gpt-4o-search-preview']
570571

571572
messages = [
572573
{"role": "user", "content": query}

tests/test_models.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
}
2222
]
2323

24-
response = asyncio.run(model_manager.registed_models["claude-4-sonnet"](
24+
response = asyncio.run(model_manager.registed_models["gpt-4.1"](
2525
messages=messages,
2626
))
2727
print(response)
@@ -31,7 +31,3 @@
3131
model = model_manager.registed_models["langchain-gpt-4.1"]
3232
response = asyncio.run(model.ainvoke("What is the capital of France?"))
3333
print(response)
34-
35-
model = model_manager.registed_models["langchain-o3"]
36-
response = asyncio.run(model.ainvoke("What is the capital of France?"))
37-
print(response)

tests/test_python_interpreter.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import warnings
2+
warnings.simplefilter("ignore", DeprecationWarning)
3+
4+
import os
5+
import sys
6+
from pathlib import Path
7+
import asyncio
8+
9+
root = str(Path(__file__).resolve().parents[1])
10+
sys.path.append(root)
11+
12+
from src.tools.python_interpreter import PythonInterpreterTool
13+
from src.models import model_manager
14+
15+
if __name__ == "__main__":
16+
model_manager.init_models(use_local_proxy=False)
17+
18+
pit = PythonInterpreterTool()
19+
code = """
20+
def fibonacci(n):
21+
if n <= 0:
22+
return []
23+
elif n == 1:
24+
return [0]
25+
elif n == 2:
26+
return [0, 1]
27+
else:
28+
fib_sequence = [0, 1]
29+
for i in range(2, n):
30+
fib_sequence.append(fib_sequence[-1] + fib_sequence[-2])
31+
return fib_sequence
32+
result = fibonacci(10)
33+
"""
34+
content = asyncio.run(pit.forward(code))
35+
print(content)

0 commit comments

Comments
 (0)