responses

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAdapter

func NewAdapter() internalprotocol.Adapter

NewAdapter returns the Responses API protocol adapter.

func ParseRequest

func ParseRequest(data []byte) (parsedRequest, error)

ParseRequest decodes a Responses API request directly from its body. Returned strings, slices, maps, and raw JSON own their data independently of body after this function returns.

func Render

func Render(resp chat.Response) (any, error)

Render builds the same Responses envelope used for creation, replay, and application-owned GET retrieval from one Response value.

Types

type Adapter

type Adapter struct{}

Adapter encodes canonical events as OpenAI Responses.

func (Adapter) Response

func (Adapter) Response(req chat.Request, result execution.Result, meta responseMeta) (any, error)

Response builds a non-streaming Responses API response body.

func (Adapter) Stream

func (Adapter) Stream(w http.ResponseWriter, parsed parsedRequest, meta *responseMeta, limits chat.Limits) streamEncoder

Stream returns an SSE encoder for Responses API streaming events.

func (Adapter) ValidateEvent

func (Adapter) ValidateEvent(event chat.Event) error

ValidateEvent checks whether event can be encoded for the Responses API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL