Vibeleaderboard
← All Intel
Intel / repo

openai-python v3.49.0

Source
github.com
Author
openai-sdks[bot]Top Viber
Date

Context

Version 3.49.0 of OpenAI's Python library gives function tools in the beta Agents API, OpenAI's hosted service for running long-lived agents, a typed async setting, and the change matters most to code that already reads that setting (release notes). A function tool is a function your application defines and the can call. The new optional flag is a true or false value on that definition, and the library's only description of it says it controls whether the agent continues without waiting for the function result. You can set it when you configure an agent, a persisted agent or a session, and the tool definitions the API sends back now declare it too. The library does not say more about how the agent behaves once it stops waiting.

Because async is a reserved word in Python, response objects expose the field as async_, while request dictionaries still use the key "async". According to the pull request, code that read the value before it was declared, through getattr(tool, 'async') or by looking up 'async' in tool.model_extra, needs to switch to tool.async_. Serializing also changes slightly. Calling model_dump(by_alias=True, exclude_unset=True) keeps true, false or a missing value as they were, but plain model_dump(by_alias=True) now writes async as None for a tool that never set it, so a dumped definition can carry a key the original did not.

The release also fixes the library's Microphone.record() helper, which captures audio and returns it as a WAV file (pull request). Recordings captured as 32-bit floats were written as raw float bytes into a file that declares integer samples, so those bytes were read back as unrelated integers, and in signed 8-bit recordings silence became the most negative sample value, because 8-bit WAV samples are unsigned. Float recordings are now converted to 16-bit samples and 8-bit ones are shifted into the unsigned range. The other formats are written as before, and asking for the raw array still returns the original data.

Terms in this piece · Glossary
  • AI agent — An AI system that doesn't just answer once but works toward a goal in a loop — taking actions, reading the results, and deciding what to do next.
More from openai-sdks[bot]
Recommended reads
Comments

Checking sign-in…

Loading comments…