-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit 4724b5e
committed
change to tool call item
Signed-off-by: myan <myan@redhat.com>
Adds example for financial agent
Indentation for mkdocs.yml
feat: add voice pipeline support
> Co-authored-by: rm@openai.com
fix tests
update tests
v0.0.6 (voice support)
[doc] fix invalid imports
include reference to new audio span related concepts
removing erroneous changes
fixing whitespace
fixing object path
Make the optional dependency installation compatible with zsh
fixed from agents.voice import SingleAgentVoiceWorkflow, VoicePipeline in quickstart.md
from agents.voice import SingleAgentVoiceWorkflow, VoicePipeline,
remove extra "," from the first line
docs: add Langfuse to tracing documentation
Remove redundant weaker tracing assertions
lint
Create py.typed
- Ensure library is properly typehinted
More fetch_normalized_spans
More fetch_normalized_spans
More fetch_normalized_spans
More fetch_normalized_spans
empty assertions
More fetch_normalized_spans
fix line in guardrails
Read tracing API data lazily
Add Weights & Biases to tracing docs
Fix circular dependency in voice streamed example by renaming agents.py to my_workflow.py
Fix type-checking for circular dependency in voice streamed example
Fix circular dependency in voice streamed example with cleaner import pattern
fix annotation numbering in context management
Fix inconsistent numbering between code and explanatory annotations in
the context management documentation.
Fix voice pipeline code examples in quickstart docs
Update issues.yml
Update quickstart.md
Improve tracing error messages
fix typos in /examples
fix typos in src/
fix typos in tests
revert src/ change per request
chore: ignore PyCharm .idea/ directory
Uncomment .idea/ directory in .gitignore to ensure PyCharm IDE
project configuration files are excluded from version control.
[0/n] Only run tests on py3.9, not mypy
We don't need to run mypy on 3.9 anyway. Also it causes issues with the rest of this stack.
run checks
Fix potential infinite tool call loop by resetting tool_choice after tool execution
Rename test file for better clarity
Revert test file name to match project naming style
Update documentation for tool_choice auto-reset feature
fix: optimize tool_choice reset logic and fix lint errors
- Refactor tool_choice reset to target only problematic edge cases
- Replace manual ModelSettings recreation with dataclasses.replace
- Fix line length and error handling lint issues in tests
docs: Update tool_choice reset documentation to match implementation
fix: prevent modifying the original agent's model_settings
This fixes the issue where the original agent's model_settings was being directly modified during the tool choice reset process. The original implementation caused the agent's tool_choice to unintentionally reset to "auto" for subsequent runs, which could be unexpected behavior.
The fix creates new copies of the agent and model settings objects using dataclasses.replace() instead of modifying the original objects. This ensures that the tool choice reset is limited to the current run only, maintaining the expected behavior for sequential runs with the same agent.
Addresses feedback from @baderalfahad about the agent instance being modified when it should maintain its original state between runs.
refactor: streamline tool_choice reset logic
This update moves the tool_choice reset logic to a more appropriate location within the RunImpl class, ensuring that the original agent's model_settings remains unmodified during the reset process. The logic now checks for problematic scenarios before creating a modified copy of the agent's settings, maintaining expected behavior across sequential runs. This change enhances clarity and efficiency in handling tool choices.
Addresses previous feedback regarding the modification of the agent instance and improves the overall structure of the reset logic.
refactor: improve comments for clarity in tool_choice reset logic
Fix parallel_tool_calls when False
[1/n] Add MCP types to the SDK
1. Add the MCP dep for python 3.10, since it doesn't support 3.9 and below
2. Create MCPServer, which is the agents SDK representation of an MCP server
3. Create implementations for HTTP-SSE and StdIO servers, directly copying the [MCP SDK example](https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/clients/simple-chatbot/mcp_simple_chatbot/main.py)
4. Add a util to transform MCP tools into Agent SDK tools
Note: I added optional caching support to the servers. That way, if you happen to know a server's tools don't change, you can just cache them.
Checks pass. I added tests at the end of the stack.
[1/n] Add MCP types to the SDK
1. Add the MCP dep for python 3.10, since it doesn't support 3.9 and below
2. Create MCPServer, which is the agents SDK representation of an MCP server
3. Create implementations for HTTP-SSE and StdIO servers, directly copying the [MCP SDK example](https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/clients/simple-chatbot/mcp_simple_chatbot/main.py)
4. Add a util to transform MCP tools into Agent SDK tools
Note: I added optional caching support to the servers. That way, if you happen to know a server's tools don't change, you can just cache them.
Checks pass. I added tests at the end of the stack.
[2/n] Add MCP support to Runner
This enables users to **use** MCP inside the SDK.
1. You add a list of MCP servers to `Agent`, via `mcp_server=[...]`
2. When an agent runs, we look up its MCP tools and add them to the list of tools.
3. When a tool call occurs, we call the relevant MCP server.
Notes:
1. There's some refactoring to make sure we send the full list of tools to the Runner/Model etc.
2. Right now, you could have a locally defined tool that conflicts with an MCP defined tool. I didn't add errors for that, will do in a followup.
See unit tests. Also has an end to end example next PR.
[3/n] Add an MCP stdio example
Spins up a stdio server with some local files, then asks the model questions.
Run the example, see it work.
[4/n] Add docs for MCP
Just adding docs.
-
Make the reset behavior on tool use configurable
1. Making it configurable on the agent.
2. Doing bookkeeping in the Runner to track this, to prevent mutating agents.
3. Not resetting the global tool choice in RunConfig.
Unit tests.
.
fix(examples): make sure audio playback finishes
Add graphviz as a dependency in pyproject.toml
Add visualization functions for agents using Graphviz
Add unit tests for visualization functions in test_visualizations.py
Add documentation and example for agent visualization using Graphviz
Linting
feat: add visualization functions for agent graphs
refactor: move graphviz dependency to visualization section
feat: add documentation for agent visualization using Graphviz
feat: add visualization module for agent graphs using Graphviz
rename: test_visualization.py
style: improve code formatting and readability in visualization functions
style: improve string formatting
style: improve string formatting in visualization functions
feat: add optional dependency for visualization using Graphviz
feat: enhance visualization functions with optional type hints and improved handling of agents and handoffs
refactor: clean up visualization functions by removing unused nodes and improving type hints
Add visualization optional dependency for graphviz
Rename visualization dependency to viz in pyproject.toml
Refactor visualization node label formatting in get_all_nodes function
Update installation instructions for visualization dependency to use 'viz'
Update visualization.md
Update pyproject.toml
Add graphviz as a dependency and update import statements
Add visualization.md to navigation in mkdocs.yml
Refactor get_all_edges function to remove unused parent parameter
Add Jupyter Notebook files to .gitignore
Add start and end nodes to graph visualization and update edge generation
Refactor visualization functions to improve formatting and streamline edge generation
Fix type ignore comment for agent check in get_all_edges function
linting
Remove Jupyter Notebook files from .gitignore
[5/n] MCP tracing
Adds tracing and tests for tracing.
- Tools are added to the agents
- Theres a span for the mcp tools lookup
- Functions have MCP data
Unit tests
.
adding Git MCP server example
fixing lint issues
added readme, fixed typo
delete config
Signed-off-by: myan <myan@redhat.com>
change the tool into action which contain the tool_call
Signed-off-by: myan <myan@redhat.com>
action
Signed-off-by: myan <myan@redhat.com>
fix the error
Signed-off-by: myan <myan@redhat.com>
fix the teset
Signed-off-by: myan <myan@redhat.com>
remvoe
Signed-off-by: myan <myan@redhat.com>1 parent e474d0f commit 4724b5eCopy full SHA for 4724b5e
File tree
40 files changed
+18011
-68
lines changedFilter options
- .github/workflows
- .vscode
- docs
- examples
- basic
- financial_research_agent
- mcp
- filesystem_example
- git_example
- research_bot/agents
- src/agents
- extensions
- mcp
- models
- tracing
- voice
- tests
- mcp
- voice
40 files changed
+18011
-68
lines changed.github/workflows/tests.yml
Copy file name to clipboardExpand all lines: .github/workflows/tests.yml+3Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
| 13 | + | |
| 14 | + | |
| 15 | + | |
13 | 16 |
| |
14 | 17 |
| |
15 | 18 |
| |
|
+4Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
141 | 141 |
| |
142 | 142 |
| |
143 | 143 |
| |
| 144 | + | |
144 | 145 |
| |
145 | 146 |
| |
| 147 | + | |
| 148 | + | |
| 149 | + |
0 commit comments