Expand description
Open Responses specification conformance layer.
This module implements the Open Responses specification for vendor-neutral LLM interfaces. It provides:
- Unified item types with state machine semantics
- Semantic streaming events (not raw token deltas)
- Response objects with standardized structure
- Error handling with structured error types
- Extension points for VT Code-specific item types
The implementation bridges VT Code’s internal event system (ThreadEvent)
to Open Responses-compliant structures while maintaining backwards compatibility.
Structs§
- Custom
Item - Custom/extension item type.
- Dual
Event Emitter - Adapter that wraps a VT Code event sink and also emits Open Responses events.
- Function
Call Item - A function call item representing a tool invocation request.
- Function
Call Output Item - Output from a function call execution.
- Incomplete
Details - Details about why a response was incomplete.
- Input
File Content - File input provided to the model.
- Input
Image Content - Image input provided to the model.
- Input
Tokens Details - Detailed breakdown of input token usage.
- Message
Item - A message item representing conversation content.
- Open
Response Error - Structured error object for Open Responses.
- Open
Responses Integration - Open Responses integration manager.
- Open
Usage - Token usage statistics for a response.
- Output
Tokens Details - Detailed breakdown of output token usage.
- Reasoning
Item - A reasoning item containing model’s internal thought process.
- Request
- The main request object per the Open Responses specification.
- Response
- The main response object per the Open Responses specification.
- Response
Builder - Builder for constructing Open Responses
Responseobjects from VT Code events. - Sequenced
Event - Wrapper for streaming events with sequence number for ordering. Used when serializing events for SSE transport.
- Specific
Tool Choice - Specific tool choice.
- VecStream
Emitter - Vector-based event emitter for collecting events.
Enums§
- Content
Part - Content part types supported by Open Responses.
- Image
Detail - Level of detail for image analysis.
- Incomplete
Reason - Reasons why a response may be incomplete.
- Item
Status - Lifecycle status for items in the Open Responses model.
- Message
Role - Role of a message author.
- Open
Response Error Code - Specific error codes providing additional detail.
- Open
Response Error Type - Category of error that occurred.
- Output
Item - Output items generated by the model.
- Response
Status - Status of a response.
- Response
Stream Event - Semantic streaming events per the Open Responses specification.
- Tool
Choice - Tool choice options.
- Tool
Choice Mode - Standard tool choice modes.
Constants§
- VTCODE_
EXTENSION_ PREFIX - VT Code extension prefix for custom item types and events.
Traits§
- Open
Responses Provider - Trait for types that can provide Open Responses integration.
- Stream
Event Emitter - Trait for emitting Open Responses streaming events.
- ToOpen
Response - Extension trait for converting VT Code LLM responses to Open Responses format.
Functions§
- generate_
item_ id - Generates a unique output item ID.
- generate_
response_ id - Generates a unique response ID.
- is_
valid_ extension_ type - Validates that a custom type follows the Open Responses extension naming convention.
Custom types must be prefixed with an implementor slug (e.g.,
vtcode:file_change).
Type Aliases§
- Content
Part Id - Unique identifier for a content part within an output item.
- Open
Responses Callback - Callback type for receiving Open Responses streaming events.
- Output
Item Id - Unique identifier for an output item.
- Response
Id - Unique identifier for a response.