SDK Language
Both
Problem Statement
The Python SDK's AgentStreamContext currently includes agent, messages, and invocation_state. The TS SDK includes the same fields, plus invokeArgs, limits (inside invokeOptions), and structuredOutput (inside invokeOptions). The TS context contract must be finalized (particularly around copy vs reference semantics for args/options) and the SDKs must reach parity on AgentStreamContext fields before either AgentStreamStage can go public.
Proposed Solution
Add the equivalent of limits and structuredOutput to the Python SDK's AgentStreamContext. Handle them in the same way as the TS SDK.
Use Case
- Middleware author wants to inspects or modifies usage limits before continuing with the invocation
- Middleware author wants to inject a response schema matching their endpoint's specifications
Alternatives Solutions
No response
Additional Context
The TS SDK includes messages from the current pass inside of agent. While messages is also accessible from agent in the Python SDK, it includes the full conversation history. messages from the current pass are stored separately in AgentStreamContext to address this divergence.
SDK Language
Both
Problem Statement
The Python SDK's
AgentStreamContextcurrently includesagent,messages, andinvocation_state. The TS SDK includes the same fields, plusinvokeArgs,limits(insideinvokeOptions), andstructuredOutput(insideinvokeOptions). The TS context contract must be finalized (particularly around copy vs reference semantics for args/options) and the SDKs must reach parity onAgentStreamContextfields before eitherAgentStreamStagecan go public.Proposed Solution
Add the equivalent of
limitsandstructuredOutputto the Python SDK'sAgentStreamContext. Handle them in the same way as the TS SDK.Use Case
Alternatives Solutions
No response
Additional Context
The TS SDK includes
messagesfrom the current pass inside ofagent. Whilemessagesis also accessible fromagentin the Python SDK, it includes the full conversation history.messagesfrom the current pass are stored separately inAgentStreamContextto address this divergence.