Feature/prebuilt2#122
Merged
Merged
Conversation
- Refactor ReactAgent constructor to include additional parameters for tools, memory, and multimodal configurations. - Introduce a new example script demonstrating the usage of ReactAgent with a weather tool. - Add helper functions for tool routing and graph configuration. - Update tests to cover new functionalities and ensure proper initialization and compilation of the agent.
…ockMCPClient tests
- Introduced _helpers.py to centralize shared helper functions and constants for tool node executors. - Split LocalExecMixin, MCPMixin, and KwargsResolverMixin into separate files for better organization and maintainability. - Updated executors to utilize the new helper functions for serialization and status extraction. - Enhanced error handling and message formatting in the execution flow. - Changed ExecutionStatus and StopRequestStatus to use StrEnum for better string representation. - Updated StreamEvent to use StrEnum for consistency. - Removed deprecated merge_two_state function from utils.py.
…tion - Introduced StructuredOutputAgent to ensure structured LLM output with automatic repair on validation failure. - Updated agent initialization to accept output schema and max attempts. - Implemented routing logic for handling valid and invalid outputs, including tool calls. - Added examples demonstrating usage of StructuredOutputAgent for structured extraction and tool integration. - Created comprehensive unit tests for StructuredOutputAgent, covering various scenarios and edge cases. - Cleaned up mock MCP client by removing unnecessary lines.
- Introduced `test_supervisor_team_agent.py` with tests covering WorkerConfig, supervisor prompt building, routing logic, and agent initialization for SupervisorTeamAgent. - Added `test_swarm_agent.py` containing tests for SwarmMemberConfig, member routing, agent initialization, and handoff tool functionality for SwarmAgent. - Both test files ensure robust validation of agent behaviors and configurations, enhancing overall test coverage for the agent framework.
- Introduced a new example script `rag_example.py` demonstrating the usage of RAGAgent in three scenarios: simple vector search, reranking with Cohere, and local reranking with CrossEncoder. - Implemented a stub store for demonstration purposes and provided instructions for production setup using QdrantStore. - Enhanced unit tests for RAGAgent, including tests for initialization, compilation, and node behavior. - Added integration tests to verify the end-to-end functionality of the RAGAgent. - Updated tests for SupervisorTeamAgent and SwarmAgent to improve clarity and maintainability.
…ReflectAgent and SupervisorTeamAgent
…tructured_output.py and supervisor_team.py
|
|
||
| def test_requires_model(self): | ||
| with pytest.raises(TypeError): | ||
| StructuredOutputAgent(output_schema=MovieReview) # type: ignore |
|
|
||
| def test_requires_output_schema(self): | ||
| with pytest.raises(TypeError): | ||
| StructuredOutputAgent(model="fake-model") # type: ignore |
…s in node handlers
…outing logic in tests
|
|
||
| def test_requires_model(self): | ||
| with pytest.raises(TypeError): | ||
| PlanActReflectAgent() # type: ignore |
| async def aget_all(self, config, **kwargs): | ||
| return [] | ||
|
|
||
| async def aupdate(self, config, record_id, **kwargs): ... |
| async def aget_all(self, config, **kwargs): | ||
| return [] | ||
|
|
||
| async def aupdate(self, config, record_id, **kwargs): ... |
| state = await retrieve(state, {}) | ||
| assert state.execution_meta.internal_data[_RAG_DOCS_KEY] == ["chunk A", "chunk B"] | ||
|
|
||
| state = await synthesize(state, {}) |
| state = await retrieve(state, {}) | ||
| state = await rerank(state, {}) | ||
| assert state.execution_meta.internal_data[_RAG_DOCS_KEY] == ["high", "mid"] | ||
| state = await synthesize(state, {}) |
| def test_compiled_graph_has_correct_nodes_without_reranker(self): | ||
| rag = RAGAgent(store=_fake_store(), agent=_fake_agent()) | ||
| graph = rag.compile() | ||
| node_names = set(graph.nodes.keys()) if hasattr(graph, "nodes") else set() |
| def __init__( | ||
| async def arerank(self, query: str, documents: list[str], top_n: int) -> list[str]: | ||
| """Re-rank *documents* for *query* and return the top *top_n* texts.""" | ||
| ... |
| ) | ||
| """ | ||
|
|
||
| async def asetup(self): ... |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request primarily removes support for Composio and LangChain tool integrations from the core tool node system, simplifies the
StateGraphinitialization, and adds new shared helpers for tool node executors. It also includes several documentation and planning file cleanups, removing outdated or redundant content.Core codebase changes:
ToolNode simplification and cleanup:
ToolNodeby eliminating related mixins, adapters, and documentation references. The class now focuses on local and MCP (Model Context Protocol) tools only. [1] [2] [3] [4]_helpers.pymodule with shared utility functions for tool node executors, such as safe serialization, status normalization, and error extraction.StateGraph improvements:
id_generatorargument inStateGraph.__init__to acceptNoneand default toDefaultIDGeneratorif not provided, improving flexibility and testability. [1] [2]_setupmethod frominfotodebugfor less noisy logs during setup._resolve_named_tool_nodes.Documentation and planning file updates:
Overview.md, as well as checklist and planning items fromChecklist.md,Plans.md,Plan2.md, andTODO.txt, likely as part of a documentation refresh or migration. [1] [2] [3] [4] [5]