Skip to content

Commit aef625f

Browse files
Merge branch 'main' into context-token-docs
Signed-off-by: Matous Havlena <havlenma@gmail.com>
2 parents c5ec875 + 354f7b0 commit aef625f

203 files changed

Lines changed: 2729 additions & 1999 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ agentstack run example_agent "Alice" # Test your agent
8585
You should see: "Ciao Alice!" 🎉
8686

8787
> [!TIP]
88-
> Check out [Start Building Agents](https://agentstack.beeai.dev/introduction/start-building-agents) for a complete step-by-step guide to creating your first agent.
88+
> Check out [Building Agents](https://agentstack.beeai.dev/guides/building-agents) for a complete step-by-step guide to creating your first agent.
8989
9090
---
9191

@@ -95,14 +95,15 @@ You should see: "Ciao Alice!" 🎉
9595

9696
Reference implementations demonstrating core Agent Stack capabilities.
9797

98-
- [BeeAI Showcase Agent](https://github.com/jenna-winkler/beeai-showcase-agent) - Full-featured chat assistant demonstrating RequirementAgent with conditional tool use, web search (DuckDuckGo), advanced reasoning (ThinkTool), file handling (PDF/CSV/JSON), streaming, UI feature toggles, trajectory logging, and citation extraction.
98+
- [Agent Stack Showcase](https://github.com/jenna-winkler/agentstack-showcase) - Full-featured chat assistant demonstrating RequirementAgent with conditional tool use, web search (DuckDuckGo), advanced reasoning (ThinkTool), file handling (PDF/CSV/JSON), streaming, UI feature toggles, trajectory logging, and citation extraction.
9999
- [Serper Search Agent](https://github.com/jenna-winkler/serper-search-agent) - Web search agent showing runtime secrets management (Secrets Extension), custom tool creation (SerperSearchTool), automatic query term extraction, and structured results with citations.
100-
- [GitHub Issue Writer](https://github.com/jenna-winkler/github_issue_writer) - Single-turn workflow using the Form Extension for multi-field input, AI-enhanced issue drafting with ThinkTool, and professional Markdown formatting.
100+
- [GitHub Issue Writer](https://github.com/jenna-winkler/github_issue_writer) - Single-turn workflow using the Form Extension for multi-field input, AI-enhanced issue drafting with ThinkTool, and Markdown formatting.
101101
- [Chat Agent](https://github.com/i-am-bee/agentstack/tree/main/agents/chat) - Multi-turn conversational agent using RequirementAgent, ActTool for reasoning sequences, and ClarificationTool for ambiguous queries. Integrates DuckDuckGo, Wikipedia, OpenMeteo, and file tools with UnconstrainedMemory, streaming, citation extraction, and OpenTelemetry instrumentation.
102102
- [Form Agent](https://github.com/i-am-bee/agentstack/tree/main/agents/form) - Single-turn form interaction using Form Extension with multiple field types, customizable layouts, file uploads, validation, and structured output.
103103
- [RAG Agent](https://github.com/i-am-bee/agentstack/tree/main/agents/rag) - Retrieval-Augmented Generation agent supporting 12+ file formats, dynamic vector stores, semantic search (VectorSearchTool), document summaries (FileReaderTool), intelligent tool selection, and citation tracking with document URLs.
104104
- [OAuth Agent](https://github.com/i-am-bee/agentstack/blob/main/apps/agentstack-sdk-py/examples/oauth.py) - OAuth Extension demo with MCP integration, browser-based authorization, secure token management, and Stripe MCP server access.
105105
- [Dynamic Form Request Agent](https://github.com/i-am-bee/agentstack/blob/main/apps/agentstack-sdk-py/examples/request_form_agent.py) - Multi-step form workflow showing both static and dynamic form generation, where the agent conditionally requests additional input mid-conversation.
106+
- [Flight Search and Visualization Agent](https://github.com/jezekra1/agentstack-workshop) - Agent that queries the Kiwi.com MCP API for flight results, requests missing parameters through the Form Extension, and optionally generates PNG or HTML route visualizations using geospatial helpers. It uses RequirementAgent to orchestrate tool calls (data validation and visualization) and streams a final answer with any generated files and citations.
106107

107108
### Community Agents
108109

agents/chat/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ authors = [
77
]
88
requires-python = ">=3.13,<3.14"
99
dependencies = [
10-
"beeai-framework[duckduckgo,wikipedia]>=0.1.60",
10+
"beeai-framework[duckduckgo,wikipedia]>=0.1.67",
1111
"tiktoken>=0.12.0", # constraint for beeai-framework dependency (first version with musl arm64 wheel)
1212
"fastuuid>=0.14.0", # constraint for beeai-framework dependency (first version with musl arm64 wheel)
1313
"openai>=1.107.1",

agents/chat/src/chat/tools/general/act.py

Lines changed: 52 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
from typing import Literal
55

6-
from beeai_framework.agents.experimental import (
6+
from beeai_framework.agents.requirement import (
77
RequirementAgent,
88
RequirementAgentRunState,
99
)
10-
from beeai_framework.agents.experimental.events import RequirementAgentStartEvent
11-
from beeai_framework.agents.experimental.requirements import Requirement, Rule
12-
from beeai_framework.agents.experimental.requirements.requirement import (
10+
from beeai_framework.agents.requirement.events import RequirementAgentStartEvent
11+
from beeai_framework.agents.requirement.requirements import Requirement, Rule
12+
from beeai_framework.agents.requirement.requirements.requirement import (
1313
run_with_context,
1414
)
1515
from beeai_framework.context import RunContext
@@ -29,11 +29,15 @@ class ActToolInput(BaseModel):
2929
...,
3030
description="Provide a clear explanation of why you want to use the selected tool and what you expect to achieve.",
3131
)
32-
selected_tool: str = Field(..., description="The name of the tool you want to execute next.")
32+
selected_tool: str = Field(
33+
..., description="The name of the tool you want to execute next."
34+
)
3335

3436

3537
class ActToolResult(BaseModel):
36-
selected_tool: str = Field(..., description="The name of the tool that has been selected for execution.")
38+
selected_tool: str = Field(
39+
..., description="The name of the tool that has been selected for execution."
40+
)
3741

3842

3943
class ActToolOutput(JSONToolOutput[ActToolResult]):
@@ -98,7 +102,9 @@ def allowed_tools_names(self, allowed_tools_names: list[str]) -> None:
98102
def input_schema(self):
99103
return self._input_schema
100104

101-
async def _run(self, input: ActToolInput, options: ToolRunOptions | None, context: RunContext) -> ActToolOutput:
105+
async def _run(
106+
self, input: ActToolInput, options: ToolRunOptions | None, context: RunContext
107+
) -> ActToolOutput:
102108
if not input.selected_tool:
103109
raise ToolInputValidationError(
104110
f"You must always select one of the provided tools: {self._allowed_tools_names}."
@@ -147,21 +153,53 @@ async def run(self, state: RequirementAgentRunState, ctx: RunContext) -> list[Ru
147153
if last_step and last_step.tool and last_step.tool.name == "act":
148154
assert isinstance(last_step.tool, ActTool)
149155
if last_step.error is not None:
150-
return [Rule(target="act", forced=True, allowed=True, prevent_stop=False, hidden=False)]
151-
152-
if last_step.output is None or not isinstance(last_step.output, ActToolOutput):
153-
raise ValueError("Last step output must be an instance of ActToolOutput.")
156+
return [
157+
Rule(
158+
target="act",
159+
forced=True,
160+
allowed=True,
161+
prevent_stop=False,
162+
hidden=False,
163+
)
164+
]
165+
166+
if last_step.output is None or not isinstance(
167+
last_step.output, ActToolOutput
168+
):
169+
raise ValueError(
170+
"Last step output must be an instance of ActToolOutput."
171+
)
154172
selected_tool = last_step.output.result.selected_tool
155-
return [Rule(target=selected_tool, forced=True, allowed=True, prevent_stop=False, hidden=False)]
173+
return [
174+
Rule(
175+
target=selected_tool,
176+
forced=True,
177+
allowed=True,
178+
prevent_stop=False,
179+
hidden=False,
180+
)
181+
]
156182

157183
# Hide all tools except ActTool on the first step
158184
rules = [
159-
Rule(target=t.name, hidden=True, allowed=False, prevent_stop=False, forced=False)
185+
Rule(
186+
target=t.name,
187+
hidden=True,
188+
allowed=False,
189+
prevent_stop=False,
190+
forced=False,
191+
)
160192
for t in self.tools
161193
if not isinstance(t, ActTool)
162194
]
163195
return [
164-
Rule(target="act", forced=True, allowed=True, prevent_stop=False, hidden=False),
196+
Rule(
197+
target="act",
198+
forced=True,
199+
allowed=True,
200+
prevent_stop=False,
201+
hidden=False,
202+
),
165203
*rules,
166204
]
167205

agents/chat/src/chat/tools/general/clarification.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Copyright 2025 © BeeAI a Series of LF Projects, LLC
22
# SPDX-License-Identifier: Apache-2.0
33

4-
from beeai_framework.agents.experimental import (
4+
from beeai_framework.agents.requirement import (
55
RequirementAgent,
66
RequirementAgentRunState,
77
)
8-
from beeai_framework.agents.experimental.events import RequirementAgentStartEvent
8+
from beeai_framework.agents.requirement.events import RequirementAgentStartEvent
99
from beeai_framework.backend import AssistantMessage
1010
from beeai_framework.context import RunContext
1111
from beeai_framework.emitter import Emitter, EventMeta
@@ -20,10 +20,13 @@
2020

2121
class ClarificationSchema(BaseModel):
2222
thoughts: str = Field(
23-
..., description="Your reasoning process and analysis of what information is needed from the user."
23+
...,
24+
description="Your reasoning process and analysis of what information is needed from the user.",
2425
)
2526
question_to_user: str = Field(
26-
..., description="The specific question or clarification request to ask the user.", min_length=1
27+
...,
28+
description="The specific question or clarification request to ask the user.",
29+
min_length=1,
2730
)
2831

2932

@@ -63,7 +66,9 @@ async def _run(
6366
context: RunContext,
6467
) -> StringToolOutput:
6568
if not self._state:
66-
raise ToolInputValidationError("State is not set for the ClarificationTool.")
69+
raise ToolInputValidationError(
70+
"State is not set for the ClarificationTool."
71+
)
6772

6873
# Store the clarification request in the agent state
6974
self._state.result = input
@@ -85,7 +90,9 @@ def clarification_tool_middleware(ctx: RunContext) -> None:
8590
"""
8691
assert isinstance(ctx.instance, RequirementAgent)
8792

88-
clarification_tool = next((t for t in ctx.instance._tools if isinstance(t, ClarificationTool)), None)
93+
clarification_tool = next(
94+
(t for t in ctx.instance._tools if isinstance(t, ClarificationTool)), None
95+
)
8996
if clarification_tool is None:
9097
raise ValueError("ClarificationTool is not found in the agent's tools.")
9198

0 commit comments

Comments
 (0)