Spaces:
Sleeping
Sleeping
More descripitions for agents
Browse files
agents/agent_with_custom_beam_design_tools.py
CHANGED
|
@@ -113,7 +113,8 @@ def generate_beam_agent() -> smolagents.CodeAgent:
|
|
| 113 |
api_key=os.getenv("OPENAI_API_KEY"),
|
| 114 |
),
|
| 115 |
instructions="You are a beam design agent with custom tools to support that task. Use those tools whenever feasible.",
|
| 116 |
-
name="
|
|
|
|
| 117 |
add_base_tools=False,
|
| 118 |
max_steps=12,
|
| 119 |
)
|
|
|
|
| 113 |
api_key=os.getenv("OPENAI_API_KEY"),
|
| 114 |
),
|
| 115 |
instructions="You are a beam design agent with custom tools to support that task. Use those tools whenever feasible.",
|
| 116 |
+
name="beam_design_agent",
|
| 117 |
+
description="Agent specialized in beam design calculations.",
|
| 118 |
add_base_tools=False,
|
| 119 |
max_steps=12,
|
| 120 |
)
|
agents/code_writing_agents.py
CHANGED
|
@@ -5,7 +5,9 @@ import smolagents.models
|
|
| 5 |
|
| 6 |
|
| 7 |
def generate_code_writing_agent_with_tools(
|
| 8 |
-
tools=None,
|
|
|
|
|
|
|
| 9 |
):
|
| 10 |
"""
|
| 11 |
Create a code-writing agent wwith a specific set of tools (defaults to none)
|
|
@@ -14,6 +16,7 @@ def generate_code_writing_agent_with_tools(
|
|
| 14 |
tools = []
|
| 15 |
return smolagents.CodeAgent(
|
| 16 |
name=name,
|
|
|
|
| 17 |
model=smolagents.models.OpenAIServerModel(
|
| 18 |
model_id=os.getenv("AGENT_MODEL", ""),
|
| 19 |
api_base=os.getenv("UPSTREAM_OPENAI_BASE", "").rstrip("/"),
|
|
@@ -41,5 +44,7 @@ def generate_code_writing_agent_with_search():
|
|
| 41 |
"""
|
| 42 |
tools = [smolagents.WebSearchTool(max_results=5)]
|
| 43 |
return generate_code_writing_agent_with_tools(
|
| 44 |
-
tools,
|
|
|
|
|
|
|
| 45 |
)
|
|
|
|
| 5 |
|
| 6 |
|
| 7 |
def generate_code_writing_agent_with_tools(
|
| 8 |
+
tools=None,
|
| 9 |
+
name: str = "code_writing_agent_without_tools",
|
| 10 |
+
description: str = "A code-writing agent without specialized tools.",
|
| 11 |
):
|
| 12 |
"""
|
| 13 |
Create a code-writing agent wwith a specific set of tools (defaults to none)
|
|
|
|
| 16 |
tools = []
|
| 17 |
return smolagents.CodeAgent(
|
| 18 |
name=name,
|
| 19 |
+
description=description,
|
| 20 |
model=smolagents.models.OpenAIServerModel(
|
| 21 |
model_id=os.getenv("AGENT_MODEL", ""),
|
| 22 |
api_base=os.getenv("UPSTREAM_OPENAI_BASE", "").rstrip("/"),
|
|
|
|
| 44 |
"""
|
| 45 |
tools = [smolagents.WebSearchTool(max_results=5)]
|
| 46 |
return generate_code_writing_agent_with_tools(
|
| 47 |
+
tools,
|
| 48 |
+
name="code_writing_agent_with_search",
|
| 49 |
+
description="A code-writing agent with search tools.",
|
| 50 |
)
|
agents/generator_and_critic.py
CHANGED
|
@@ -18,6 +18,7 @@ You should not iterate or make multiple tool calls.
|
|
| 18 |
Instead, simply call the final answer tool with your evaluation and feedback.
|
| 19 |
"""
|
| 20 |
|
|
|
|
| 21 |
# ---------------- Factory ----------------
|
| 22 |
def generate_generator_with_managed_critic(
|
| 23 |
*,
|
|
@@ -49,6 +50,7 @@ def generate_generator_with_managed_critic(
|
|
| 49 |
tools=[], # keep toolbox minimal
|
| 50 |
model=model,
|
| 51 |
name="generator_with_managed_critic",
|
|
|
|
| 52 |
managed_agents=[critic_agent], # <-- critic attached here
|
| 53 |
instructions=GENERATOR_INSTRUCTIONS,
|
| 54 |
add_base_tools=False,
|
|
|
|
| 18 |
Instead, simply call the final answer tool with your evaluation and feedback.
|
| 19 |
"""
|
| 20 |
|
| 21 |
+
|
| 22 |
# ---------------- Factory ----------------
|
| 23 |
def generate_generator_with_managed_critic(
|
| 24 |
*,
|
|
|
|
| 50 |
tools=[], # keep toolbox minimal
|
| 51 |
model=model,
|
| 52 |
name="generator_with_managed_critic",
|
| 53 |
+
description="Generates drafts and iteratively improves them using a managed critic agent.",
|
| 54 |
managed_agents=[critic_agent], # <-- critic attached here
|
| 55 |
instructions=GENERATOR_INSTRUCTIONS,
|
| 56 |
add_base_tools=False,
|