Versions in this module Expand all Collapse all v0 v0.3.0 Sep 7, 2026 Changes in this version type StreamEvent + ToolType string type ToolCall + Type string type ToolResult + Type string v0.2.0 Aug 15, 2026 Changes in this version + type Assembler struct + func (a *Assembler) Apply(event StreamEvent) + func (a *Assembler) Done() bool + func (a *Assembler) Response() Response + type ContentBlock struct + Extensions Extensions + Provider Format + Raw json.RawMessage + Result *ToolResult + Signature string + Source *Source + Text string + ToolCall *ToolCall + Type ContentType + func Refusal(text string) ContentBlock + func Text(text string) ContentBlock + type ContentType string + const ContentAudio + const ContentFile + const ContentImage + const ContentReasoning + const ContentRefusal + const ContentText + const ContentToolCall + const ContentToolResult + const ContentUnknown + const ContentVideo + type Diagnostic struct + Code string + Kind DiagnosticKind + Path string + Source Format + Target Format + type DiagnosticKind string + const DiagnosticGeneratedID + const DiagnosticLossy + const DiagnosticUnknownField + type EmbeddingInput struct + Text string + Tokens []int64 + Type EmbeddingInputType + type EmbeddingInputType string + const EmbeddingInputText + const EmbeddingInputTokens + type EmbeddingOutput struct + Embedding EmbeddingTensor + Extensions Extensions + Index int + type EmbeddingRequest struct + AutoTruncate *bool + Dimensions *int64 + EncodingFormat string + Extensions Extensions + InputType string + Inputs []EmbeddingInput + Model string + Normalize *bool + Preservation Preservation + TaskType string + Title string + Truncate string + User string + func (r *EmbeddingRequest) ClearPreservation() + func (r EmbeddingRequest) Validate() error + type EmbeddingResponse struct + Data []EmbeddingOutput + EncodingFormat string + Extensions Extensions + Model string + Preservation Preservation + Usage Usage + func (r *EmbeddingResponse) ClearPreservation() + func (r EmbeddingResponse) Validate() error + type EmbeddingTensor struct + Shape []int64 + Values []float64 + func NewEmbeddingMatrix(rows [][]float64) (EmbeddingTensor, error) + func NewEmbeddingVector(values []float64) EmbeddingTensor + func (t EmbeddingTensor) Rank() int + func (t EmbeddingTensor) Rows() ([][]float64, error) + func (t EmbeddingTensor) Validate() error + type Extensions map[string]json.RawMessage + type Format string + const FormatAnthropic + const FormatBedrock + const FormatBedrockCohereEmbeddings + const FormatBedrockTitanEmbeddings + const FormatGemini + const FormatGeminiEmbeddings + const FormatOpenAIChat + const FormatOpenAIEmbeddings + const FormatOpenAIResponses + type Instruction struct + Content []ContentBlock + Extensions Extensions + Role Role + type LossyPolicy string + const LossyAllow + const LossyReject + type Message struct + Content []ContentBlock + Extensions Extensions + ID string + Role Role + type Output struct + Choices *int64 + Logprobs *bool + MaxTokens *int64 + Modalities []string + ResponseFormat json.RawMessage + StopSequences []string + TopLogprobs *int64 + type Policy struct + Lossy LossyPolicy + Preservation PreservationPolicy + Target TargetCapabilities + UnknownFields UnknownFieldPolicy + func PermissivePolicy() Policy + func StrictPolicy() Policy + func (p Policy) Effective() Policy + type Preservation struct + Requests map[Format]json.RawMessage + Responses map[Format]json.RawMessage + type PreservationPolicy string + const PreserveDisabled + const PreserveInMemory + type ProtocolError struct + Code string + Message string + Retryable bool + Type string + type ProviderState struct + Background *bool + Conversation json.RawMessage + PreviousResponseID string + Store *bool + type Reasoning struct + BudgetTokens *int64 + Effort string + Include *bool + Level string + Provider Format + Raw json.RawMessage + type Request struct + Extensions Extensions + Instructions []Instruction + Messages []Message + Model string + Output Output + ParallelToolCalls *bool + Preservation Preservation + Reasoning Reasoning + Sampling Sampling + State ProviderState + Stream bool + ToolChoice *ToolChoice + Tools []ToolDefinition + func (r *Request) ClearPreservation() + type Response struct + Extensions Extensions + ID string + Model string + Outputs []ResponseOutput + Preservation Preservation + Usage Usage + func (r *Response) ClearPreservation() + type ResponseOutput struct + Content []ContentBlock + Extensions Extensions + ID string + Index *int + Logprobs []TokenLogprob + Role Role + StopReason StopReason + type Role string + const RoleAssistant + const RoleDeveloper + const RoleSystem + const RoleTool + const RoleUser + type Sampling struct + FrequencyPenalty *float64 + PresencePenalty *float64 + Seed *int64 + Temperature *float64 + TopK *int64 + TopP *float64 + type Source struct + Data string + Detail string + FileID string + Filename string + Kind string + MediaType string + Raw json.RawMessage + URL string + type StopReason string + const StopContentFilter + const StopEndTurn + const StopError + const StopMaxTokens + const StopToolUse + const StopUnknown + type StreamEvent struct + ContentIndex int + Delta string + Error *ProtocolError + ItemID string + Logprobs []TokenLogprob + Model string + OutputIndex int + Provider Format + Raw json.RawMessage + ResponseID string + Role Role + Signature string + StopReason StopReason + ToolCallID string + ToolName string + Type StreamEventType + Usage *Usage + type StreamEventType string + const StreamError + const StreamLogprobs + const StreamOutputDone + const StreamOutputStart + const StreamReasoningDelta + const StreamReasoningSignatureDelta + const StreamRefusalDelta + const StreamResponseDone + const StreamResponseStart + const StreamTextDelta + const StreamToolArgsDelta + const StreamToolCallStart + const StreamUnknown + const StreamUsage + type TargetCapabilities struct + Audio *bool + Files *bool + Images *bool + JSONSchema *bool + ParallelToolCalls *bool + Reasoning *bool + Tools *bool + Video *bool + type TokenLogprob struct + Chosen TokenProbability + Top []TokenProbability + type TokenProbability struct + Bytes []int64 + Logprob float64 + Token string + TokenID *int64 + type ToolCall struct + Arguments json.RawMessage + ID string + Name string + type ToolChoice struct + Name string + Raw json.RawMessage + Type ToolChoiceType + type ToolChoiceType string + const ToolChoiceAuto + const ToolChoiceNone + const ToolChoiceRaw + const ToolChoiceRequired + const ToolChoiceTool + type ToolDefinition struct + Description string + Extensions Extensions + Name string + Parameters json.RawMessage + Raw json.RawMessage + Strict *bool + Type string + type ToolResult struct + Content []ContentBlock + IsError *bool + ToolCallID string + type TranslationError struct + Code string + Detail string + Format Format + Path string + func (e *TranslationError) Error() string + type UnknownFieldPolicy string + const UnknownDrop + const UnknownPreserve + const UnknownReject + type Usage struct + AcceptedPredictionTokens *int64 + CacheCreationTokens *int64 + CachedInputTokens *int64 + InputTokens *int64 + OutputTokens *int64 + ProviderComponents map[string]int64 + ReasoningTokens *int64 + RejectedPredictionTokens *int64 + ToolUsePromptTokens *int64 + TotalTokens *int64 + type WireEvent struct + Data json.RawMessage + Event string