github openai/openai-agents-python v0.9.0

5 hours ago

Key Changes

Python 3.9 is no longer supported

Since Python 3.9 is EOLed three months ago, this SDK no longer support the version. Please upgrade to Python 3.10 or newer.

Timeouts for function tools

Now you can pass the following options to customize function tool behavior:

  • timeout_seconds: float | None
  • timeout_behavior: ToolTimeoutBehavior = "error_as_result" # or "raise_exception"
  • timeout_error_function: ToolErrorFunction | None

Agent#as_tool() now returns FunctionTool

Additionally, the type hint for the value returned from the Agent#as_tool() method has been narrowed from Tool to FunctionTool. This change should not usually cause breaking issues, but if your code relies on the broader union type, you may need to make some adjustments on your side.

What's Changed

  • chore: drop Python 3.9 support across metadata, CI, and docs by @seratch in #2474
  • feat: #2346 add configurable timeout handling for function tools by @seratch in #2479
  • feat: add ToolOutputTrimmer for smart context management by @jkrish in #2468
  • fix: narrow Agent.as_tool return type to FunctionTool by @seratch in #2473
  • fix(tracing): propagate trace metadata to spans for processors by @seratch in #2478
  • fix(voice): handle odd-length audio buffers in StreamedAudioResult by @OiPunk in #2456

Documents & Other Changes

  • docs: update translated document pages by @github-actions[bot] in #2475
  • Release 0.9.0 by @github-actions[bot] in #2480

New Contributors

Full Changelog: v0.8.4...v0.9.0

Don't miss a new openai-agents-python release

NewReleases is sending notifications on new releases.