Commit Graph

1014 Commits

Author SHA1 Message Date
xianghuijin 2a61d474e4 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.
2025-03-23 17:20:23 +08:00
xianghuijin b6ed16686b docs: Update tool_choice reset documentation to match implementation 2025-03-22 14:22:47 +08:00
xianghuijin 0746325a67 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
2025-03-22 14:10:09 +08:00
Rohan Mehta 84e3c22645 Fix code examples in voice pipeline quickstart docs (#277) 2025-03-21 21:44:14 -04:00
Raduan77 db2de55dff revert src/ change per request 2025-03-22 01:06:01 +01:00
Rohan Mehta 7af3f82a18 [docs] fix annotation numbering in context management (#293)
Fix inconsistent numbering between code and explanatory annotations in
the context management documentation.
2025-03-21 19:33:30 -04:00
Rohan Mehta 428b76c695 Fix circular dependency in voice streamed example by renaming agents #291 (#292)
Fix circular dependency in voice streamed example by renaming agents.py
to my_workflow.py

Fix circular dependency in voice streamed example by renaming agents
#291
2025-03-21 19:33:12 -04:00
Aviral Garg 8769a3ebf0 Fix circular dependency in voice streamed example with cleaner import pattern 2025-03-21 16:26:19 -07:00
Aviral Garg 75eec0aed6 Fix type-checking for circular dependency in voice streamed example 2025-03-21 16:18:04 -07:00
Rohan Mehta 289d47fda3 Add Weights & Biases to tracing docs (#294) 2025-03-21 17:59:54 -04:00
Rohan Mehta b02d544629 Read tracing API data lazily (#289) 2025-03-21 17:58:10 -04:00
Scott Condron 849aed4f3a Add Weights & Biases to tracing docs 2025-03-21 21:37:54 +00:00
Han Hwang Lim b2e04bef06 fix annotation numbering in context management
Fix inconsistent numbering between code and explanatory annotations in
the context management documentation.
2025-03-21 21:10:30 +00:00
Aviral Garg ee971e73d2 Fix circular dependency in voice streamed example by renaming agents.py to my_workflow.py 2025-03-21 13:25:46 -07:00
Dmitry Pimenov 3d97f0980d fix line in guardrails doc (#290) 2025-03-21 13:00:18 -07:00
James Hills 860eddd749 fix line in guardrails 2025-03-21 15:58:34 -04:00
Rohan Mehta 9e9ad165ab Read tracing API data lazily 2025-03-21 15:32:37 -04:00
Rohan Mehta de407c688c Replace remaining uses of `fetch_ordered_spans` and `fetch_traces` for stronger tests (#288)
Following https://github.com/openai/openai-agents-python/pull/261
2025-03-21 13:25:43 -04:00
Alex Hall e16c38a6e3 More fetch_normalized_spans 2025-03-21 18:31:06 +02:00
Alex Hall b7df4e470e empty assertions 2025-03-21 18:26:04 +02:00
Rohan Mehta 17868e38a8 Create py.typed (#285)
- Ensure library is properly typehinted
2025-03-21 12:19:48 -04:00
Alex Hall 99d6bc5199 More fetch_normalized_spans 2025-03-21 18:15:52 +02:00
Alex Hall 0d0f35787f More fetch_normalized_spans 2025-03-21 18:14:59 +02:00
Alex Hall b1cfcfd18b More fetch_normalized_spans 2025-03-21 18:13:04 +02:00
Alex Hall 5cea0dffc6 More fetch_normalized_spans 2025-03-21 18:09:19 +02:00
Richie Caputo 353d5eab77 Create py.typed
- Ensure library is properly typehinted
2025-03-21 11:16:24 -04:00
Rohan Mehta ecd06140ff Remove redundant weaker tracing assertions (#261)
Following up on https://github.com/openai/openai-agents-python/pull/25,
this removes uses of `fetch_traces` and `fetch_ordered_spans` where
there's already a stronger assertion using `fetch_normalized_spans`.
This is to help move towards the stronger style as much as possible,
since people are still adding weaker assertions such as
[this](7a0ca7930e/tests/test_concurrency.py (L59-L61))
in https://github.com/openai/openai-agents-python/pull/91. The next step
will be to find remaining uses of `fetch_ordered_spans` that can be
replaced.
2025-03-21 10:31:41 -04:00
Rohan Mehta caa3c6c856 docs: add Langfuse to tracing documentation (#284) 2025-03-21 10:31:05 -04:00
Rohan Mehta b52fea05fe fixed from agents.voice import SingleAgentVoiceWorkflow, VoicePipelin… (#275)
…e in  quickstart.md

from agents.voice import SingleAgentVoiceWorkflow, VoicePipeline,

remove extra "," from the first line
2025-03-21 10:29:13 -04:00
Jannik Maierhöfer d0e25ad1e3 docs: add Langfuse to tracing documentation 2025-03-21 13:39:17 +01:00
Alex Hall e9611e22ca Merge branch 'main' of github.com:openai/openai-agents-python into alex/cleanup-tests 2025-03-21 10:13:33 +02:00
Pepijn a32dc7825c Fix voice pipeline code examples in quickstart docs 2025-03-21 06:47:12 +01:00
Sir Qasim 56f53caa36 fixed from agents.voice import SingleAgentVoiceWorkflow, VoicePipeline in quickstart.md
from agents.voice import SingleAgentVoiceWorkflow, VoicePipeline,

remove extra "," from the first line
2025-03-21 06:58:47 +05:00
Rohan Mehta d65f05e1b6 Make the optional dependency installation compatible with zsh (#274) 2025-03-20 21:33:23 -04:00
Kazuhiro Sera 4bc92307d8 Make the optional dependency installation compatible with zsh 2025-03-21 10:01:24 +09:00
Rohan Mehta bba8ba5406 Updating tracing doc for new spans (#272) 2025-03-20 20:05:42 -04:00
Dmitry Pimenov 9dabf96fe8 fixing object path 2025-03-20 17:03:52 -07:00
Rohan Mehta a5f0646b9c [doc] fix invalid imports (#273) 2025-03-20 20:03:00 -04:00
Yoshinori Sano d212b0d0e7 [doc] fix invalid imports 2025-03-21 08:37:45 +09:00
Dmitry Pimenov 8ad5c6f245 fixing whitespace 2025-03-20 16:05:54 -07:00
Dmitry Pimenov 3e8103ad72 removing erroneous changes 2025-03-20 15:53:41 -07:00
Dmitry Pimenov 54cda1cc37 include reference to new audio span related concepts 2025-03-20 15:51:02 -07:00
Rohan Mehta 281144ecf1 v0.0.6 (voice support) (#267)
Release a new version with voice support
2025-03-20 13:13:00 -04:00
Rohan Mehta 1ed6e67080 v0.0.6 (voice support) 2025-03-20 13:10:54 -04:00
Rohan Mehta 6b34df037e update tests (#266) 2025-03-20 13:10:47 -04:00
Rohan Mehta ec66b71419 update tests 2025-03-20 13:08:38 -04:00
Rohan Mehta 57b0b5f628 feat: add voice pipeline support (#265)
> Co-authored-by: rm@openai.com
2025-03-20 12:54:42 -04:00
Dominik Kundel f476521c53 fix tests 2025-03-20 09:52:15 -07:00
Dominik Kundel 20f0793862 feat: add voice pipeline support
> Co-authored-by: rm@openai.com
2025-03-20 09:43:13 -07:00
Rohan Mehta b62379306f Indentation for mkdocs.yml (#264) 2025-03-20 11:21:27 -04:00