Skip to main content

Module open_responses

Module open_responses 

Source
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§

CustomItem
Custom/extension item type.
DualEventEmitter
Adapter that wraps a VT Code event sink and also emits Open Responses events.
FunctionCallItem
A function call item representing a tool invocation request.
FunctionCallOutputItem
Output from a function call execution.
IncompleteDetails
Details about why a response was incomplete.
InputFileContent
File input provided to the model.
InputImageContent
Image input provided to the model.
InputTokensDetails
Detailed breakdown of input token usage.
MessageItem
A message item representing conversation content.
OpenResponseError
Structured error object for Open Responses.
OpenResponsesIntegration
Open Responses integration manager.
OpenUsage
Token usage statistics for a response.
OutputTokensDetails
Detailed breakdown of output token usage.
ReasoningItem
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.
ResponseBuilder
Builder for constructing Open Responses Response objects from VT Code events.
SequencedEvent
Wrapper for streaming events with sequence number for ordering. Used when serializing events for SSE transport.
SpecificToolChoice
Specific tool choice.
VecStreamEmitter
Vector-based event emitter for collecting events.

Enums§

ContentPart
Content part types supported by Open Responses.
ImageDetail
Level of detail for image analysis.
IncompleteReason
Reasons why a response may be incomplete.
ItemStatus
Lifecycle status for items in the Open Responses model.
MessageRole
Role of a message author.
OpenResponseErrorCode
Specific error codes providing additional detail.
OpenResponseErrorType
Category of error that occurred.
OutputItem
Output items generated by the model.
ResponseStatus
Status of a response.
ResponseStreamEvent
Semantic streaming events per the Open Responses specification.
ToolChoice
Tool choice options.
ToolChoiceMode
Standard tool choice modes.

Constants§

VTCODE_EXTENSION_PREFIX
VT Code extension prefix for custom item types and events.

Traits§

OpenResponsesProvider
Trait for types that can provide Open Responses integration.
StreamEventEmitter
Trait for emitting Open Responses streaming events.
ToOpenResponse
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§

ContentPartId
Unique identifier for a content part within an output item.
OpenResponsesCallback
Callback type for receiving Open Responses streaming events.
OutputItemId
Unique identifier for an output item.
ResponseId
Unique identifier for a response.