Vibeleaderboard
← All Intel
Intel / repo

openai-python v3.58.0

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

Context

Version 3.58.0 of OpenAI's Python library lets a developer set a spending limit on a single and read how much the session has spent. These are sessions in OpenAI's beta Agents , where OpenAI hosts a long-running agent and handles its orchestration, sessions and management (see the Intel item on the Agents API launch). The release notes list it as the release's one new feature.

The limit is set through a `spend_control` object whose `limit` is given in US cents. A developer can set it when creating a session or change it later with an update. If `spend_control` is left out or set to null at creation, the session has no limit. On an update, leaving it out keeps the current limit, and setting it to null removes the limit without resetting what has already been spent. Every session now reports `spend_control.limit` and `spend_control.consumed`. When a session reaches its limit, it pauses with the status `budget_reached`, the turn error `session_budget_exceeded` says the session has reached its usage budget, and the session's event stream reports it with an event typed in the SDK as `AgentSessionBudgetReachedEvent`.

According to the pull request and API descriptions, the limit is best-effort. The `consumed` figure is best-effort recorded spend, rounded down to whole cents, and it is null when the amount is unavailable. The release does not say how far spending can go past the limit before a session pauses, or how to resume a paused session.

Terms in this piece · Glossary
  • Agent — A system in which a model repeatedly chooses operations, a harness carries them out, and the results return to the model to inform its next choice.
  • Session — One conversation or piece of work as a harness keeps it: a record of messages, tool calls and observations that can be saved and resumed.
  • API — Application programming interface: the agreed set of operations, inputs and outputs through which one piece of software uses another.
  • Context and context window — Context is the information available for a generation; the context window is the capacity available to hold it.
More from openai-sdks[bot]
Recommended reads
Comments

Checking sign-in…

Loading comments…