-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Comparing changes
Open a pull request
base repository: openai/openai-agents-python
base: 18cb55e
head repository: openai/openai-agents-python
compare: db85a6d
- 9 commits
- 17 files changed
- 9 contributors
Commits on Jul 8, 2025
-
docs: mention 'name' is required in Agent constructor . fix: mention …
…'name' as required in Agent init doc (#1033) ## What Updated the docs under `docs/agents.md` to clarify that the `name` argument is required when initializing an `Agent`. ## Why Without this clarification, users get a confusing error: `TypeError: Agent.__init__() missing 1 required positional argument: 'name'` This matches the actual constructor in the source code and helps future devs avoid frustration. ## Reference - Source: [`agent.py`](https://github.com/openai/openai-agents-python/blob/main/src/agents/agent.py)
Configuration menu - View commit details
-
Copy full SHA for 586d4b2 - Browse repository at this point
Copy the full SHA 586d4b2View commit details -
Fix agent lifecycle example output to reflect correct hook execution …
…order (#1015) **Problem:** The expected output in the agent lifecycle example incorrectly shows agent start hooks (`on_start`) running after tool execution and multiple times for the same agent. This misleads developers about when these lifecycle events actually occur. **Solution:** Updated the expected output to accurately reflect the OpenAI Agents framework behavior: - Agent start hooks run immediately when an agent begins execution - Start hooks only run once per agent activation, controlled by the `should_run_agent_start_hooks` flag - After handoffs, the new agent's start hook runs as the first event
Configuration menu - View commit details
-
Copy full SHA for f09874c - Browse repository at this point
Copy the full SHA f09874cView commit details -
### Summary Add MCP prompt support to enable user-controlled agent instruction generation. This enhancement allows MCP servers to provide prompts that can be used to dynamically generate agent instructions, enabling more flexible and user-controlled agent behavior. **Key changes:** - Added abstract `list_prompts()` and `get_prompt()` methods to base `MCPServer` class - Implemented prompt support in `MCPServerStdio` and `MCPServerStreamableHttp` classes - Added comprehensive test suite for prompt functionality - Created example MCP prompt server with working demonstration - Updated documentation with prompt usage examples **Note:** This PR implements MCP prompt support only. Resource support is not included in this implementation. ### Test plan - **Unit tests**: Added 11 comprehensive tests in `tests/mcp/test_prompt_server.py` covering: - Prompt listing and retrieval - Argument formatting and validation - Agent integration with prompt-generated instructions - Streaming and non-streaming scenarios - Error handling for missing prompts - **Integration tests**: Updated existing MCP test suite to handle new abstract methods - **Example verification**: Created working example with MCP prompt server and client - **All tests pass**: 450/450 tests passing after adding optional dependencies ### Issue number Partially addresses #544 (prompts only, resources not implemented) ### Checks - [x] I've added new tests (if relevant) - [x] I've added/updated the relevant documentation - [x] I've run `make lint` and `make format` - [x] I've made sure tests pass --------- Co-authored-by: thein <thein@MacBook-Pro.local>
Configuration menu - View commit details
-
Copy full SHA for d1d2ecc - Browse repository at this point
Copy the full SHA d1d2eccView commit details -
Add on_start support to VoiceWorkflowBase and VoicePipeline (#922)
I added an optional `on_start()` method to `VoiceWorkflowBase`, allowing voice workflows to emit an initial TTS message before any user input. This aligns with the usage pattern suggested in #488 The `VoicePipeline._run_multi_turn()` method was updated to call this hook and stream any yielded messages via TTS before transcription begins. No changes are required to existing workflows, as the method defaults to returning an empty `AsyncIterator[str]`. Resolves #488 and thus improves UX for voice agents that need to greet or instruct users proactively. All tests pass under Python 3.12. Let me know if you'd like an example workflow or docs added in a follow-up!
Configuration menu - View commit details
-
Copy full SHA for e5ba91b - Browse repository at this point
Copy the full SHA e5ba91bView commit details -
Add Makefile check rule to run all the linters and checkers (#1038)
It adds a Makefile rule `check` to run all linters and checkers in a single command. With only `make check` instead of 3-4 commands, it can help to forget one of them before pushing a PR.
Configuration menu - View commit details
-
Copy full SHA for 6358cd9 - Browse repository at this point
Copy the full SHA 6358cd9View commit details -
Support for file_input content (#fix 893) (#1009)
PDF and file upload are supported by litellm and various models. This PR enables them. fixes #893
Configuration menu - View commit details
-
Copy full SHA for 1720e4a - Browse repository at this point
Copy the full SHA 1720e4aView commit details -
description_override is not properly used for function_schema.descrip…
…tion (#1000) Describe the bug A clear and concise description of what the bug is. In the function_schema method of the OpenAI Agents SDK, the following line: ```python description=description_override or doc_info.description if doc_info else None ``` does not honor description_override when `use_docstring_info=False`. This happens because of operator precedence in Python. Without parentheses, the expression is interpreted as: ```python description=(description_override or doc_info.description) if doc_info else None ``` So when doc_info is None, even if description_override is set, it falls back to None Debug information Python version (e.g. Python 3.10) Repro steps ```python from agents.function_schema import function_schema def my_func(): pass schema = function_schema( my_func, description_override ="CustomDescription", use_docstring_info=False ) print(schema.description) # Expected: "CustomDescription", Actual: None ``` Expected behavior Even when use_docstring_info=False, if description_override is provided, it should be used for description. Suggested Fix: Update this line: description=description_override or doc_info.description if doc_info else None To this (with parentheses to enforce correct evaluation): description=description_override or (doc_info.description if doc_info else None)
Configuration menu - View commit details
-
Copy full SHA for e251fa6 - Browse repository at this point
Copy the full SHA e251fa6View commit details -
Configuration menu - View commit details
-
Copy full SHA for c92fe77 - Browse repository at this point
Copy the full SHA c92fe77View commit details -
Fix #976 MCP filtering, make agent and run ctx optional (#977)
Configuration menu - View commit details
-
Copy full SHA for db85a6d - Browse repository at this point
Copy the full SHA db85a6dView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff 18cb55e...db85a6d