Documentation
¶
Index ¶
- type Answer
- type BooleanAnswer
- type BooleanCriteria
- type BooleanQuestion
- type ChatAssistantMessage
- type ChatChoice
- type ChatCompletionChunk
- type ChatCompletionChunkChoice
- type ChatCompletionChunkDelta
- type ChatCompletionRequest
- type ChatCompletionResult
- type ChatCompletionStream
- type ChatContentPart
- type ChatExaCategory
- type ChatExaContents
- type ChatExaExtras
- type ChatExaHighlights
- type ChatExaHighlightsEnabled
- type ChatExaHighlightsOptions
- type ChatExaSearchConfig
- type ChatExaSearchTool
- type ChatExaSearchType
- type ChatExaSection
- type ChatExaSubpageTarget
- type ChatExaSubpageTargetString
- type ChatExaSubpageTargetStrings
- type ChatExaText
- type ChatExaTextEnabled
- type ChatExaTextOptions
- type ChatExaVerbosity
- type ChatFilePart
- type ChatFunctionCall
- type ChatGatewayOptions
- type ChatImageURLPart
- type ChatJSONSchemaResponseFormat
- type ChatLegacyJSONResponseFormat
- type ChatMessage
- type ChatMessageContent
- type ChatParallelExcerpts
- type ChatParallelFetchPolicy
- type ChatParallelMode
- type ChatParallelSearchConfig
- type ChatParallelSearchTool
- type ChatParallelSourcePolicy
- type ChatPartsContent
- type ChatPerplexityQuery
- type ChatPerplexityQueryString
- type ChatPerplexityQueryStrings
- type ChatPerplexityRecency
- type ChatPerplexitySearchConfig
- type ChatPerplexitySearchTool
- type ChatProvider
- type ChatProviderOptions
- type ChatProviderTimeouts
- type ChatResponseFormat
- type ChatResponseFormatType
- type ChatServerTool
- type ChatServerToolsRequest
- type ChatSpecificToolChoice
- type ChatStop
- type ChatStopString
- type ChatStopStrings
- type ChatTakoContentFormat
- type ChatTakoDataMode
- type ChatTakoDataSource
- type ChatTakoEffort
- type ChatTakoLocation
- type ChatTakoOutputSettings
- type ChatTakoSearchConfig
- type ChatTakoSearchTool
- type ChatTakoSources
- type ChatTakoWebCategory
- type ChatTakoWebSource
- type ChatTextContent
- type ChatTextPart
- type ChatTool
- type ChatToolCall
- type ChatToolChoice
- type ChatToolChoiceMode
- type ChatUsage
- type ChoiceAnswer
- type ChoiceQuestion
- type Client
- func (client *Client) CreateChatCompletion(ctx context.Context, request ChatCompletionRequest) (*ChatCompletionResult, error)
- func (client *Client) CreateChatCompletionWithServerTools(ctx context.Context, request ChatServerToolsRequest) (*ChatCompletionResult, error)
- func (client *Client) CreateResponse(ctx context.Context, request ResponsesRequest) (*ResponseResult, error)
- func (client *Client) CreateResponseWithBuiltInTools(ctx context.Context, request ResponsesBuiltInToolsRequest) (*ResponseResult, error)
- func (client *Client) Embed(ctx context.Context, modelID string, request EmbeddingRequest) (*EmbeddingResult, error)
- func (client *Client) Evaluate(ctx context.Context, modelID string, request EvaluationRequest) (*EvaluationResult, error)
- func (client *Client) GenerateImage(ctx context.Context, modelID string, request ImageRequest) (*ImageResult, error)
- func (client *Client) GenerateSpeech(ctx context.Context, modelID string, request SpeechRequest) (*SpeechResult, error)
- func (client *Client) Rerank(ctx context.Context, modelID string, request RerankRequest) (*RerankResult, error)
- func (client *Client) StreamChatCompletion(ctx context.Context, request ChatCompletionRequest) (*ChatCompletionStream, error)
- func (client *Client) StreamChatCompletionWithServerTools(ctx context.Context, request ChatServerToolsRequest) (*ChatCompletionStream, error)
- func (client *Client) StreamResponse(ctx context.Context, request ResponsesRequest) (*ResponseStream, error)
- func (client *Client) StreamResponseWithBuiltInTools(ctx context.Context, request ResponsesBuiltInToolsRequest) (*ResponseStream, error)
- func (client *Client) Transcribe(ctx context.Context, modelID string, request TranscriptionRequest) (*TranscriptionResult, error)
- type ConfigurationError
- type EmbeddingRequest
- type EmbeddingResult
- type EmbeddingUsage
- type EvaluationRequest
- type EvaluationResult
- type ImageAspectRatio
- type ImageBase64
- type ImageBytes
- type ImageInput
- type ImageRequest
- type ImageResult
- type ImageSize
- type ImageURL
- type ImageUsage
- type JSONField
- type Option
- func WithAPIKey(key string) Option
- func WithBaseURL(baseURL string) Option
- func WithHTTPClient(client *http.Client) Option
- func WithHeaders(headers http.Header) Option
- func WithOIDCToken(token string) Option
- func WithOIDCTokenSource(source TokenSource) Option
- func WithPublicBaseURL(baseURL string) Option
- func WithRetryPolicy(policy RetryPolicy) Option
- func WithTeam(teamIDOrSlug string) Option
- type OptionalJSON
- type ProviderOption
- type ProviderWarning
- type ProviderWarningType
- type Question
- type RawResponseEvent
- type RerankDocument
- type RerankDocuments
- type RerankItem
- type RerankJSON
- type RerankObjects
- type RerankRequest
- type RerankResult
- type RerankText
- type RerankTexts
- type ResponseBuiltInTool
- type ResponseError
- func (e *ResponseError) BodyTruncated() bool
- func (e *ResponseError) Code() string
- func (e *ResponseError) Error() string
- func (e *ResponseError) GenerationID() string
- func (e *ResponseError) Message() string
- func (e *ResponseError) Param() any
- func (e *ResponseError) RawResponseBody() []byte
- func (e *ResponseError) RequestID() string
- func (e *ResponseError) ResponseID() string
- func (e *ResponseError) RetryAfter() (time.Duration, bool)
- func (e *ResponseError) Retryable() bool
- func (e *ResponseError) StatusCode() int
- func (e *ResponseError) Type() string
- func (e *ResponseError) Unwrap() error
- type ResponseEvent
- type ResponseFunctionCall
- type ResponseFunctionCallOutput
- type ResponseInput
- type ResponseInputItem
- type ResponseItemsInput
- type ResponseJSONSchemaFormat
- type ResponseMessage
- type ResponseMetadata
- type ResponseOutputTextDeltaEvent
- type ResponseReasoning
- type ResponseResult
- type ResponseSpecificToolChoice
- type ResponseStream
- type ResponseText
- type ResponseTextFormat
- type ResponseTextFormatType
- type ResponseTextInput
- type ResponseTool
- type ResponseToolChoice
- type ResponseToolChoiceMode
- type ResponseValidationError
- func (e *ResponseValidationError) BodyTruncated() bool
- func (e *ResponseValidationError) Error() string
- func (e *ResponseValidationError) Path() string
- func (e *ResponseValidationError) RawResponseBody() []byte
- func (e *ResponseValidationError) Reason() string
- func (e *ResponseValidationError) RequestID() string
- func (e *ResponseValidationError) ResponseID() string
- func (e *ResponseValidationError) StatusCode() int
- func (e *ResponseValidationError) Unwrap() error
- type ResponseWebSearchTool
- type ResponseXSearchOptionsTool
- type ResponseXSearchTool
- type ResponsesBuiltInToolsRequest
- type ResponsesRequest
- type RetryPolicy
- type Rounding
- type ScoreAnswer
- type ScoreQuestion
- type SpeechRequest
- type SpeechResult
- type TokenSource
- type TranscriptionAudio
- type TranscriptionBase64
- type TranscriptionBytes
- type TranscriptionRequest
- type TranscriptionResult
- type TranscriptionSegment
- type TransportError
- type Usage
- type ValidationError
- type Warning
- type WarningType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Answer ¶
type Answer interface {
// contains filtered or unexported methods
}
Answer is the closed set of supported evaluation answer variants.
type BooleanAnswer ¶
type BooleanAnswer struct {
Probability float64
}
BooleanAnswer reports P(true).
type BooleanCriteria ¶
type BooleanCriteria struct {
True OptionalJSON
False OptionalJSON
}
BooleanCriteria optionally describes true and false. A non-nil zero value emits an empty criteria object; each OptionalJSON controls key presence.
type BooleanQuestion ¶
type BooleanQuestion struct {
Instructions any
Criteria *BooleanCriteria
}
BooleanQuestion asks for P(true). Instructions is required and must be a JSON-compatible string, object, or array. Nil Criteria omits the wire field.
type ChatAssistantMessage ¶
type ChatChoice ¶
type ChatCompletionChunk ¶
type ChatCompletionChunk struct {
Object string
Choices []ChatCompletionChunkChoice
// contains filtered or unexported fields
}
ChatCompletionChunk is one documented chat.completion.chunk payload. Fields not represented by this type remain available through RawJSON.
func (*ChatCompletionChunk) RawJSON ¶
func (c *ChatCompletionChunk) RawJSON() []byte
RawJSON returns a fresh copy of the complete chunk JSON.
type ChatCompletionChunkChoice ¶
type ChatCompletionChunkChoice struct {
Delta ChatCompletionChunkDelta
}
ChatCompletionChunkChoice is one choice in a streamed chat completion chunk. Its position in Choices preserves its wire order.
type ChatCompletionChunkDelta ¶
type ChatCompletionChunkDelta struct {
Content string
}
ChatCompletionChunkDelta contains the documented streamed text content.
type ChatCompletionRequest ¶
type ChatCompletionRequest struct {
Model string
Messages []ChatMessage
Temperature *float64
MaxTokens *int
TopP *float64
FrequencyPenalty *float64
PresencePenalty *float64
Stop ChatStop
SafetyIdentifier *string
Tools []ChatTool
ToolChoice ChatToolChoice
ResponseFormat ChatResponseFormat
Models []string
ProviderOptions *ChatProviderOptions
Provider *ChatProvider
}
ChatCompletionRequest is a non-streaming Chat Completions request.
type ChatCompletionResult ¶
type ChatCompletionResult struct {
ID JSONField[string]
Object JSONField[string]
Created JSONField[int64]
Model JSONField[string]
Choices JSONField[[]ChatChoice]
Usage JSONField[ChatUsage]
// contains filtered or unexported fields
}
func (*ChatCompletionResult) RawJSON ¶
func (r *ChatCompletionResult) RawJSON() []byte
type ChatCompletionStream ¶
type ChatCompletionStream struct {
// contains filtered or unexported fields
}
ChatCompletionStream is a caller-owned, incrementally read Chat Completions stream. It starts no producer goroutine and retains no transcript.
func (*ChatCompletionStream) Close ¶
func (s *ChatCompletionStream) Close() error
Close stops the stream and closes its response body exactly once. It is safe to call repeatedly and may unblock a concurrent Next.
func (*ChatCompletionStream) Err ¶
func (s *ChatCompletionStream) Err() error
Err returns the terminal stream error. Successful [DONE] termination and an explicit Close return nil. The returned error remains stable.
func (*ChatCompletionStream) Event ¶
func (s *ChatCompletionStream) Event() *ChatCompletionChunk
Event returns the current chunk, or nil before the first successful Next and after Next terminates.
func (*ChatCompletionStream) Next ¶
func (s *ChatCompletionStream) Next() bool
Next advances to the next JSON chunk. It returns false after the required [DONE] terminal marker, after Close, or on error. Event is valid only after Next returns true.
type ChatContentPart ¶
type ChatContentPart interface {
// contains filtered or unexported methods
}
type ChatExaCategory ¶
type ChatExaCategory string
const ( ChatExaCategoryCompany ChatExaCategory = "company" ChatExaCategoryPeople ChatExaCategory = "people" ChatExaCategoryResearchPaper ChatExaCategory = "research paper" ChatExaCategoryNews ChatExaCategory = "news" ChatExaCategoryPersonalSite ChatExaCategory = "personal site" ChatExaCategoryFinancialReport ChatExaCategory = "financial report" )
type ChatExaContents ¶
type ChatExaContents struct {
Text ChatExaText
Highlights ChatExaHighlights
MaxAgeHours *int
LivecrawlTimeout *int
Subpages *int
SubpageTarget ChatExaSubpageTarget
Extras *ChatExaExtras
}
type ChatExaExtras ¶
type ChatExaHighlights ¶
type ChatExaHighlights interface {
// contains filtered or unexported methods
}
type ChatExaHighlightsEnabled ¶
type ChatExaHighlightsEnabled bool
type ChatExaSearchConfig ¶
type ChatExaSearchConfig struct {
Query string
Type *ChatExaSearchType
NumResults *int
Category *ChatExaCategory
UserLocation *string
IncludeDomains *[]string
ExcludeDomains *[]string
StartPublishedDate *string
EndPublishedDate *string
Contents *ChatExaContents
}
type ChatExaSearchTool ¶
type ChatExaSearchTool struct{ Config ChatExaSearchConfig }
type ChatExaSearchType ¶
type ChatExaSearchType string
const ( ChatExaSearchAuto ChatExaSearchType = "auto" ChatExaSearchFast ChatExaSearchType = "fast" ChatExaSearchInstant ChatExaSearchType = "instant" )
type ChatExaSection ¶
type ChatExaSection string
const ( ChatExaSectionHeader ChatExaSection = "header" ChatExaSectionBanner ChatExaSection = "banner" ChatExaSectionBody ChatExaSection = "body" ChatExaSectionSidebar ChatExaSection = "sidebar" ChatExaSectionMetadata ChatExaSection = "metadata" )
type ChatExaSubpageTarget ¶
type ChatExaSubpageTarget interface {
// contains filtered or unexported methods
}
type ChatExaSubpageTargetString ¶
type ChatExaSubpageTargetString string
type ChatExaSubpageTargetStrings ¶
type ChatExaSubpageTargetStrings []string
type ChatExaText ¶
type ChatExaText interface {
// contains filtered or unexported methods
}
type ChatExaTextEnabled ¶
type ChatExaTextEnabled bool
type ChatExaTextOptions ¶
type ChatExaTextOptions struct {
MaxCharacters *int
IncludeHTMLTags *bool
Verbosity *ChatExaVerbosity
IncludeSections *[]ChatExaSection
ExcludeSections *[]ChatExaSection
}
type ChatExaVerbosity ¶
type ChatExaVerbosity string
const ( ChatExaVerbosityCompact ChatExaVerbosity = "compact" ChatExaVerbosityStandard ChatExaVerbosity = "standard" ChatExaVerbosityFull ChatExaVerbosity = "full" )
type ChatFilePart ¶
type ChatFunctionCall ¶
type ChatGatewayOptions ¶
type ChatGatewayOptions struct {
Order []string
Models []string
Sort *string
ProviderTimeouts *ChatProviderTimeouts
}
type ChatImageURLPart ¶
type ChatMessage ¶
type ChatMessage struct {
Role string
Content ChatMessageContent
}
ChatMessage is one input message. Content must be ChatTextContent or ChatPartsContent.
type ChatMessageContent ¶
type ChatMessageContent interface {
// contains filtered or unexported methods
}
type ChatParallelExcerpts ¶
type ChatParallelFetchPolicy ¶
type ChatParallelFetchPolicy struct{ MaxAgeSeconds *int }
type ChatParallelMode ¶
type ChatParallelMode string
const ( ChatParallelModeOneShot ChatParallelMode = "one-shot" ChatParallelModeAgentic ChatParallelMode = "agentic" )
type ChatParallelSearchConfig ¶
type ChatParallelSearchConfig struct {
Objective string
SearchQueries *[]string
Mode *ChatParallelMode
MaxResults *int
SourcePolicy *ChatParallelSourcePolicy
Excerpts *ChatParallelExcerpts
FetchPolicy *ChatParallelFetchPolicy
}
type ChatParallelSearchTool ¶
type ChatParallelSearchTool struct{ Config ChatParallelSearchConfig }
type ChatPartsContent ¶
type ChatPartsContent []ChatContentPart
type ChatPerplexityQuery ¶
type ChatPerplexityQuery interface {
// contains filtered or unexported methods
}
type ChatPerplexityQueryString ¶
type ChatPerplexityQueryString string
type ChatPerplexityQueryStrings ¶
type ChatPerplexityQueryStrings []string
type ChatPerplexityRecency ¶
type ChatPerplexityRecency string
const ( ChatPerplexityRecencyDay ChatPerplexityRecency = "day" ChatPerplexityRecencyWeek ChatPerplexityRecency = "week" ChatPerplexityRecencyMonth ChatPerplexityRecency = "month" ChatPerplexityRecencyYear ChatPerplexityRecency = "year" )
type ChatPerplexitySearchConfig ¶
type ChatPerplexitySearchConfig struct {
Query ChatPerplexityQuery
MaxResults *int
MaxTokensPerPage *int
MaxTokens *int
Country *string
SearchDomainFilter *[]string
SearchLanguageFilter *[]string
SearchAfterDate *string
SearchBeforeDate *string
LastUpdatedAfterFilter *string
LastUpdatedBeforeFilter *string
SearchRecencyFilter *ChatPerplexityRecency
}
type ChatPerplexitySearchTool ¶
type ChatPerplexitySearchTool struct{ Config ChatPerplexitySearchConfig }
type ChatProvider ¶
type ChatProvider struct{ Sort string }
type ChatProviderOptions ¶
type ChatProviderOptions struct{ Gateway ChatGatewayOptions }
ChatProviderOptions contains documented AI Gateway routing options.
type ChatProviderTimeouts ¶
type ChatResponseFormat ¶
type ChatResponseFormat interface {
// contains filtered or unexported methods
}
type ChatResponseFormatType ¶
type ChatResponseFormatType string
const ( ChatResponseFormatText ChatResponseFormatType = "text" ChatResponseFormatJSON ChatResponseFormatType = "json" )
type ChatServerTool ¶
type ChatServerTool interface {
// contains filtered or unexported methods
}
type ChatServerToolsRequest ¶
type ChatServerToolsRequest struct {
Request ChatCompletionRequest
ServerTools []ChatServerTool
}
ChatServerToolsRequest adds typed server tools without changing ChatCompletionRequest.
type ChatSpecificToolChoice ¶
type ChatSpecificToolChoice struct{ Name string }
type ChatStopString ¶
type ChatStopString string
type ChatStopStrings ¶
type ChatStopStrings []string
type ChatTakoContentFormat ¶
type ChatTakoContentFormat string
const ( ChatTakoContentFormatCardJSON ChatTakoContentFormat = "card_json" ChatTakoContentFormatCSV ChatTakoContentFormat = "csv" ChatTakoContentFormatJSONCompact ChatTakoContentFormat = "json_compact" ChatTakoContentFormatJSONRecords ChatTakoContentFormat = "json_records" )
type ChatTakoDataMode ¶
type ChatTakoDataMode string
const ( ChatTakoDataModeInline ChatTakoDataMode = "inline" ChatTakoDataModeURL ChatTakoDataMode = "url" )
type ChatTakoDataSource ¶
type ChatTakoDataSource struct {
Count *int
IncludeContents *bool
Mode *ChatTakoDataMode
ContentFormat *ChatTakoContentFormat
MaxRows *int
NodeIDs *[]string
Strict *bool
}
type ChatTakoEffort ¶
type ChatTakoEffort string
const ( ChatTakoEffortDeep ChatTakoEffort = "deep" ChatTakoEffortFast ChatTakoEffort = "fast" ChatTakoEffortInstant ChatTakoEffort = "instant" )
type ChatTakoLocation ¶
type ChatTakoOutputSettings ¶
type ChatTakoSearchConfig ¶
type ChatTakoSearchConfig struct {
Query string
Effort *ChatTakoEffort
Sources *ChatTakoSources
Location *ChatTakoLocation
CountryCode *string
Locale *string
Timezone *string
OutputSettings *ChatTakoOutputSettings
IncludeRelated *int
}
type ChatTakoSearchTool ¶
type ChatTakoSearchTool struct{ Config ChatTakoSearchConfig }
type ChatTakoSources ¶
type ChatTakoSources struct {
Data *ChatTakoDataSource
Web *ChatTakoWebSource
}
type ChatTakoWebCategory ¶
type ChatTakoWebCategory string
const ( ChatTakoWebCategoryFinance ChatTakoWebCategory = "finance" ChatTakoWebCategoryNews ChatTakoWebCategory = "news" ChatTakoWebCategorySports ChatTakoWebCategory = "sports" )
type ChatTakoWebSource ¶
type ChatTextContent ¶
type ChatTextContent string
type ChatTextPart ¶
type ChatTextPart struct{ Text string }
type ChatToolCall ¶
type ChatToolChoice ¶
type ChatToolChoice interface {
// contains filtered or unexported methods
}
type ChatToolChoiceMode ¶
type ChatToolChoiceMode string
const ( ChatToolChoiceAuto ChatToolChoiceMode = "auto" ChatToolChoiceNone ChatToolChoiceMode = "none" ChatToolChoiceRequired ChatToolChoiceMode = "required" )
type ChoiceAnswer ¶
ChoiceAnswer reports a selected criterion and, when present, its probability distribution. A nil Probabilities map means the wire key was absent.
type ChoiceQuestion ¶
ChoiceQuestion asks the provider to select one keyed criterion. Instructions is required; Criteria must contain at least one JSON-compatible description.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client accesses the Vercel AI Gateway public Responses and Chat Completions generation APIs and the provider Evaluation Model API.
func NewClient ¶
NewClient applies options in order and constructs a client without network calls. Credential precedence is explicit API key, AI_GATEWAY_API_KEY, explicit OIDC token/source, then VERCEL_OIDC_TOKEN. Blank environment values are absent. Missing credentials and invalid options return ConfigurationError.
func (*Client) CreateChatCompletion ¶
func (client *Client) CreateChatCompletion(ctx context.Context, request ChatCompletionRequest) (*ChatCompletionResult, error)
CreateChatCompletion validates and submits one non-streaming Chat Completions request.
func (*Client) CreateChatCompletionWithServerTools ¶
func (client *Client) CreateChatCompletionWithServerTools(ctx context.Context, request ChatServerToolsRequest) (*ChatCompletionResult, error)
CreateChatCompletionWithServerTools validates and submits a request with typed Gateway server tools.
func (*Client) CreateResponse ¶
func (client *Client) CreateResponse(ctx context.Context, request ResponsesRequest) (*ResponseResult, error)
CreateResponse validates and submits one non-streaming Responses API request.
func (*Client) CreateResponseWithBuiltInTools ¶
func (client *Client) CreateResponseWithBuiltInTools(ctx context.Context, request ResponsesBuiltInToolsRequest) (*ResponseResult, error)
CreateResponseWithBuiltInTools validates and submits one non-streaming Responses API request with sealed built-in tool declarations.
func (*Client) Embed ¶
func (client *Client) Embed(ctx context.Context, modelID string, request EmbeddingRequest) (*EmbeddingResult, error)
Embed validates and submits exactly one Embedding Model V4 request. It does not batch or retry.
func (*Client) Evaluate ¶
func (client *Client) Evaluate(ctx context.Context, modelID string, request EvaluationRequest) (*EvaluationResult, error)
Evaluate validates and submits an Evaluation Model V4 request. A nil context is a ValidationError at $["context"]. Only HTTP status 200 is success; every other status is a ResponseError, and response Content-Type is ignored. Retries occur only when explicitly configured and may duplicate billable work.
func (*Client) GenerateImage ¶
func (client *Client) GenerateImage(ctx context.Context, modelID string, request ImageRequest) (*ImageResult, error)
GenerateImage validates and submits exactly one Image Model V4 request. It never retries.
func (*Client) GenerateSpeech ¶
func (client *Client) GenerateSpeech(ctx context.Context, modelID string, request SpeechRequest) (*SpeechResult, error)
GenerateSpeech validates and submits exactly one Speech Model V4 request. It never retries.
func (*Client) Rerank ¶
func (client *Client) Rerank(ctx context.Context, modelID string, request RerankRequest) (*RerankResult, error)
Rerank validates and submits exactly one Reranking Model V4 request. It does not retry.
func (*Client) StreamChatCompletion ¶
func (client *Client) StreamChatCompletion(ctx context.Context, request ChatCompletionRequest) (*ChatCompletionStream, error)
StreamChatCompletion validates and starts a streaming Chat Completions request. A non-200 response is consumed and returned as ResponseError before a stream is exposed. Streaming responses are never retried after headers.
func (*Client) StreamChatCompletionWithServerTools ¶
func (client *Client) StreamChatCompletionWithServerTools(ctx context.Context, request ChatServerToolsRequest) (*ChatCompletionStream, error)
StreamChatCompletionWithServerTools starts a stream with typed Gateway server tools.
func (*Client) StreamResponse ¶
func (client *Client) StreamResponse(ctx context.Context, request ResponsesRequest) (*ResponseStream, error)
StreamResponse validates and starts a streaming Responses API request. A non-200 response is consumed and returned as ResponseError before a stream is exposed. Streaming responses are never retried after headers are received.
func (*Client) StreamResponseWithBuiltInTools ¶
func (client *Client) StreamResponseWithBuiltInTools(ctx context.Context, request ResponsesBuiltInToolsRequest) (*ResponseStream, error)
StreamResponseWithBuiltInTools validates and starts a streaming Responses API request with sealed built-in tool declarations.
func (*Client) Transcribe ¶
func (client *Client) Transcribe(ctx context.Context, modelID string, request TranscriptionRequest) (*TranscriptionResult, error)
Transcribe validates and submits exactly one Transcription Model V4 request. It never retries.
type ConfigurationError ¶
type ConfigurationError struct {
// contains filtered or unexported fields
}
ConfigurationError reports client construction failure. Option is one of WithBaseURL, WithPublicBaseURL, WithHTTPClient, WithAPIKey, WithOIDCToken, WithOIDCTokenSource, WithTeam, WithHeaders, WithRetryPolicy, or credentials; Reason is a stable closed value documented by Option. A nil receiver's accessors return empty strings and Error returns "gateway configuration error".
func (*ConfigurationError) Error ¶
func (e *ConfigurationError) Error() string
Error returns a safe diagnostic that never contains credentials or payloads.
func (*ConfigurationError) Option ¶
func (e *ConfigurationError) Option() string
Option returns the option that failed, or an empty string when unavailable.
func (*ConfigurationError) Reason ¶
func (e *ConfigurationError) Reason() string
Reason returns the stable failure reason, or an empty string when unavailable.
type EmbeddingRequest ¶
type EmbeddingRequest struct {
Values []string
ProviderOptions []ProviderOption
}
EmbeddingRequest contains one or more strings to embed and optional sealed provider options.
type EmbeddingResult ¶
type EmbeddingResult struct {
Embeddings [][]float64
Usage *EmbeddingUsage
Warnings []ProviderWarning
ProviderMetadata map[string]json.RawMessage
Response ResponseMetadata
}
EmbeddingResult is a strictly validated Embedding Model V4 result.
type EmbeddingUsage ¶
type EmbeddingUsage struct{ Tokens *int64 }
EmbeddingUsage reports the provider token count. Tokens is non-nil whenever Usage is non-nil.
type EvaluationRequest ¶
type EvaluationRequest struct {
State any
Questions map[string]Question
ProviderOptions map[string]map[string]any
}
EvaluationRequest contains shared State, a nonempty keyed Questions map, and optional ProviderOptions. State and question instructions/criteria are validated recursively as JSON-compatible input before network I/O.
type EvaluationResult ¶
type EvaluationResult struct {
Answers map[string]Answer
Rounding *Rounding
Usage *Usage
Warnings []Warning
ProviderMetadata map[string]map[string]any
Response ResponseMetadata
}
EvaluationResult is a strictly validated Evaluation Model V4 result. Missing warnings normalize to a non-nil empty slice; other metadata preserves the documented absent-versus-present distinction.
type ImageAspectRatio ¶
type ImageAspectRatio string
type ImageBase64 ¶
type ImageBase64 struct {
MediaType string
Data string
ProviderOptions []ProviderOption
}
type ImageBytes ¶
type ImageBytes struct {
MediaType string
Data []byte
ProviderOptions []ProviderOption
}
type ImageInput ¶
type ImageInput interface {
// contains filtered or unexported methods
}
type ImageRequest ¶
type ImageRequest struct {
Prompt *string
Count int
Size *ImageSize
AspectRatio *ImageAspectRatio
Seed *int64
Files []ImageInput
Mask *ImageInput
ProviderOptions []ProviderOption
}
type ImageResult ¶
type ImageResult struct {
Images [][]byte
Retryable *bool
Warnings []ProviderWarning
ProviderMetadata map[string]json.RawMessage
Response ResponseMetadata
Usage *ImageUsage
}
type ImageURL ¶
type ImageURL struct {
URL string
ProviderOptions []ProviderOption
}
type ImageUsage ¶
type Option ¶
type Option func(*clientConfig) error
Option configures a Client during NewClient. Options are applied in order and construction stops at the first error.
func WithAPIKey ¶
WithAPIKey selects an explicit API key, which has highest precedence. It rejects empty/all-Unicode-whitespace input and otherwise preserves it exactly.
func WithBaseURL ¶
WithBaseURL sets the provider base URL. It requires a whitespace-exact, absolute, non-opaque HTTP(S) URL with host and without userinfo, query, or fragment. Existing paths are allowed. Only trailing path slashes are removed; scheme, host, port, escaping, and the remaining path are preserved before Evaluate appends /evaluation-model.
func WithHTTPClient ¶
WithHTTPClient rejects nil and stores the supplied pointer without cloning or mutating the client or transport. Subsequent concurrent mutation is the caller's responsibility under the same rules as http.Client.
func WithHeaders ¶
WithHeaders accepts nil or clones the supplied map when applied and again per request, preserving values, order, duplicates, and nil/empty slices. It rejects protocol/auth/team-owned names case-insensitively even without values: Authorization, Content-Type, Ai-Gateway-Protocol-Version, Ai-Gateway-Auth-Method, Ai-Evaluation-Model-Specification-Version, Ai-Embedding-Model-Specification-Version, Ai-Reranking-Model-Specification-Version, Ai-Image-Model-Specification-Version, Ai-Speech-Model-Specification-Version, Ai-Transcription-Model-Specification-Version, Ai-Language-Model-Specification-Version, Ai-Model-Id, and X-Vercel-Ai-Gateway-Team.
func WithOIDCToken ¶
WithOIDCToken selects a fixed explicit OIDC token. It rejects blank input and otherwise preserves it exactly. The last explicit OIDC form wins, but neither explicit OIDC form displaces an explicit or environment API key.
func WithOIDCTokenSource ¶
func WithOIDCTokenSource(source TokenSource) Option
WithOIDCTokenSource selects a non-nil refresh-capable OIDC source. It rejects nil and typed-nil sources. The last explicit OIDC form wins, but neither form displaces an explicit or environment API key.
func WithPublicBaseURL ¶
WithPublicBaseURL sets the base URL for public Gateway APIs. It rejects the same invalid URLs as WithBaseURL plus any literal fragment delimiter, while preserving escaped path data. It does not affect the provider-protocol URL.
func WithRetryPolicy ¶
func WithRetryPolicy(policy RetryPolicy) Option
WithRetryPolicy copies, validates, resolves, and stores policy. Invalid fields return ConfigurationError with Option "WithRetryPolicy" and a stable Reason.
type OptionalJSON ¶
OptionalJSON distinguishes an omitted value from an explicitly present JSON null. Set=false omits the containing key and requires Value=nil; Set=true emits Value, including nil as JSON null.
type ProviderOption ¶
type ProviderOption interface {
// contains filtered or unexported methods
}
ProviderOption is the closed set of provider-specific request options. This release intentionally provides no concrete implementations.
type ProviderWarning ¶
type ProviderWarning struct {
Type ProviderWarningType
Feature string
Details *string
Setting string
Message string
}
ProviderWarning is the closed V4 provider warning union.
type ProviderWarningType ¶
type ProviderWarningType string
ProviderWarningType identifies a closed provider warning variant.
const ( ProviderWarningUnsupported ProviderWarningType = "unsupported" ProviderWarningCompatibility ProviderWarningType = "compatibility" ProviderWarningDeprecated ProviderWarningType = "deprecated" ProviderWarningOther ProviderWarningType = "other" )
type Question ¶
type Question interface {
// contains filtered or unexported methods
}
Question is the closed set of supported evaluation question variants.
type RawResponseEvent ¶
type RawResponseEvent struct {
Type string
Event string
ID string
// contains filtered or unexported fields
}
RawResponseEvent retains an otherwise uninterpreted JSON event. Event is the SSE event name, ID is the SSE event ID, and Type is the JSON discriminator.
func (RawResponseEvent) RawJSON ¶
func (e RawResponseEvent) RawJSON() []byte
RawJSON returns a fresh copy of the event JSON.
type RerankDocument ¶
type RerankDocument interface {
// contains filtered or unexported methods
}
RerankDocument is the sealed reconstructed result-document union.
type RerankDocuments ¶
type RerankDocuments interface {
// contains filtered or unexported methods
}
RerankDocuments is the sealed homogeneous request-document envelope.
type RerankItem ¶
type RerankItem struct {
OriginalIndex int
Score float64
Document RerankDocument
}
RerankItem is one provider-ordered ranking result.
type RerankJSON ¶
type RerankJSON struct{ Value json.RawMessage }
RerankJSON is a reconstructed JSON object document. Value is independently owned.
type RerankObjects ¶
type RerankObjects struct{ Values []json.RawMessage }
RerankObjects contains JSON object documents.
type RerankRequest ¶
type RerankRequest struct {
Query string
Documents RerankDocuments
TopN *int
ProviderOptions []ProviderOption
}
RerankRequest contains a query, one homogeneous document envelope, and optional controls.
type RerankResult ¶
type RerankResult struct {
Results []RerankItem
Warnings []ProviderWarning
ProviderMetadata map[string]json.RawMessage
Response ResponseMetadata
}
RerankResult is a strictly validated Reranking Model V4 result.
type RerankText ¶
type RerankText struct{ Text string }
RerankText is a reconstructed text document.
type ResponseBuiltInTool ¶
type ResponseBuiltInTool interface {
// contains filtered or unexported methods
}
ResponseBuiltInTool is the sealed set of Responses built-in tool declarations.
type ResponseError ¶
type ResponseError struct {
// contains filtered or unexported fields
}
ResponseError reports a non-200 Gateway HTTP response. Its structured envelope, ID, retry, truncation, and defensive-copy body accessors are safe for nil receivers and return zero values; Error omits raw bodies, headers, credentials, request data, and wrapped cause text.
func (*ResponseError) BodyTruncated ¶
func (e *ResponseError) BodyTruncated() bool
BodyTruncated reports whether retained response bytes omit a suffix.
func (*ResponseError) Code ¶
func (e *ResponseError) Code() string
Code returns a string code or a numeric code's original JSON lexical form.
func (*ResponseError) Error ¶
func (e *ResponseError) Error() string
Error returns a safe diagnostic that never contains raw response bytes, request data, headers, or credentials.
func (*ResponseError) GenerationID ¶
func (e *ResponseError) GenerationID() string
GenerationID returns the top-level Gateway generation ID.
func (*ResponseError) Message ¶
func (e *ResponseError) Message() string
Message returns the known Gateway error message.
func (*ResponseError) Param ¶
func (e *ResponseError) Param() any
Param returns a recursively defensive-copied JSON-compatible parameter.
func (*ResponseError) RawResponseBody ¶
func (e *ResponseError) RawResponseBody() []byte
RawResponseBody returns a fresh copy of retained response bytes. An upstream or intermediary may have echoed sensitive request state or provider options; callers must sanitize the bytes before logging or persistence.
func (*ResponseError) RequestID ¶
func (e *ResponseError) RequestID() string
RequestID returns the top-level Gateway request ID.
func (*ResponseError) ResponseID ¶
func (e *ResponseError) ResponseID() string
ResponseID returns the top-level Gateway response ID.
func (*ResponseError) RetryAfter ¶
func (e *ResponseError) RetryAfter() (time.Duration, bool)
RetryAfter returns the parsed Retry-After delay and whether it was valid.
func (*ResponseError) Retryable ¶
func (e *ResponseError) Retryable() bool
Retryable reports the final status-only retry classification.
func (*ResponseError) StatusCode ¶
func (e *ResponseError) StatusCode() int
StatusCode returns the HTTP status, or zero when unavailable.
func (*ResponseError) Type ¶
func (e *ResponseError) Type() string
Type returns the known Gateway error type.
func (*ResponseError) Unwrap ¶
func (e *ResponseError) Unwrap() error
Unwrap returns the underlying cause, if any.
type ResponseEvent ¶
type ResponseEvent interface {
// contains filtered or unexported methods
}
ResponseEvent is one event read from a Responses API stream. Callers should use a type switch to distinguish ResponseOutputTextDeltaEvent from RawResponseEvent.
type ResponseFunctionCall ¶
type ResponseInput ¶
type ResponseInput interface {
// contains filtered or unexported methods
}
type ResponseInputItem ¶
type ResponseInputItem interface {
// contains filtered or unexported methods
}
type ResponseItemsInput ¶
type ResponseItemsInput []ResponseInputItem
type ResponseMessage ¶
type ResponseMetadata ¶
ResponseMetadata describes a successful HTTP response. ModelID is the caller-supplied ID. Headers and Body are defensive copies and non-nil after a successful bounded read, including an empty body; zero values mean no response metadata. Body is limited to 1 MiB and may contain echoed state or provider options, so it must be sanitized before logging or persistence.
type ResponseOutputTextDeltaEvent ¶
ResponseOutputTextDeltaEvent is the documented response.output_text.delta event. Event is the SSE event name and ID is the SSE event ID.
type ResponseReasoning ¶
type ResponseResult ¶
type ResponseResult struct {
// contains filtered or unexported fields
}
ResponseResult retains the complete bounded status-200 JSON object.
func (*ResponseResult) RawJSON ¶
func (r *ResponseResult) RawJSON() []byte
type ResponseSpecificToolChoice ¶
type ResponseSpecificToolChoice struct{ Name string }
type ResponseStream ¶
type ResponseStream struct {
// contains filtered or unexported fields
}
ResponseStream is a caller-owned, incrementally read Responses API stream. It does not start a producer goroutine and does not retain a transcript.
func (*ResponseStream) Close ¶
func (s *ResponseStream) Close() error
Close stops the stream and closes its response body exactly once. It is safe to call repeatedly and may be called to unblock a concurrent Next.
func (*ResponseStream) Err ¶
func (s *ResponseStream) Err() error
Err returns the terminal stream error. Clean EOF and an explicit Close return nil. The returned error remains stable after termination.
func (*ResponseStream) Event ¶
func (s *ResponseStream) Event() ResponseEvent
Event returns the current event, or nil before the first successful Next and after Next terminates.
func (*ResponseStream) Next ¶
func (s *ResponseStream) Next() bool
Next advances to the next event. It returns false at clean framed EOF, after Close, or on error. Event is valid only after Next returns true.
type ResponseText ¶
type ResponseText struct{ Format ResponseTextFormat }
type ResponseTextFormat ¶
type ResponseTextFormat interface {
// contains filtered or unexported methods
}
type ResponseTextFormatType ¶
type ResponseTextFormatType string
const ( ResponseTextFormatText ResponseTextFormatType = "text" ResponseTextFormatJSONObject ResponseTextFormatType = "json_object" )
type ResponseTextInput ¶
type ResponseTextInput string
type ResponseTool ¶
type ResponseToolChoice ¶
type ResponseToolChoice interface {
// contains filtered or unexported methods
}
type ResponseToolChoiceMode ¶
type ResponseToolChoiceMode string
const ( ResponseToolChoiceAuto ResponseToolChoiceMode = "auto" ResponseToolChoiceRequired ResponseToolChoiceMode = "required" ResponseToolChoiceNone ResponseToolChoiceMode = "none" )
type ResponseValidationError ¶
type ResponseValidationError struct {
// contains filtered or unexported fields
}
ResponseValidationError reports malformed or contract-invalid status-200 output. Its path/reason, ID, truncation, and defensive-copy body accessors are nil-safe and return zero values; Error omits raw bodies, headers, credentials, request data, and wrapped cause text.
func (*ResponseValidationError) BodyTruncated ¶
func (e *ResponseValidationError) BodyTruncated() bool
BodyTruncated reports whether retained response bytes omit a suffix.
func (*ResponseValidationError) Error ¶
func (e *ResponseValidationError) Error() string
Error returns a bounded diagnostic that never contains response paths, reasons, raw response bytes, request data, headers, or credentials. Detailed validation state remains available through the typed accessors.
func (*ResponseValidationError) Path ¶
func (e *ResponseValidationError) Path() string
Path returns the canonical wire-response path.
func (*ResponseValidationError) RawResponseBody ¶
func (e *ResponseValidationError) RawResponseBody() []byte
RawResponseBody returns a fresh copy of retained response bytes. An upstream or intermediary may have echoed sensitive request state or provider options; callers must sanitize the bytes before logging or persistence.
func (*ResponseValidationError) Reason ¶
func (e *ResponseValidationError) Reason() string
Reason returns the stable response-validation reason.
func (*ResponseValidationError) RequestID ¶
func (e *ResponseValidationError) RequestID() string
RequestID returns the top-level Gateway request ID.
func (*ResponseValidationError) ResponseID ¶
func (e *ResponseValidationError) ResponseID() string
ResponseID returns the top-level Gateway response ID.
func (*ResponseValidationError) StatusCode ¶
func (e *ResponseValidationError) StatusCode() int
StatusCode returns 200 for a response validation failure, or zero when unavailable.
func (*ResponseValidationError) Unwrap ¶
func (e *ResponseValidationError) Unwrap() error
Unwrap returns the underlying decoding or validation cause, if any.
type ResponseWebSearchTool ¶
type ResponseWebSearchTool struct{}
ResponseWebSearchTool declares OpenAI-provider native web search. It always emits {"type":"web_search","search_context_size":"low"}. First-party public-HTTP compatibility evidence covers openai/gpt-5.4-mini; callers must choose a compatible OpenAI model. Gateway routing and fallback compatibility are not promised, and future model IDs are not rejected locally.
type ResponseXSearchOptionsTool ¶
type ResponseXSearchOptionsTool struct {
AllowedXHandles []string
ExcludedXHandles []string
FromDate *string
ToDate *string
EnableImageUnderstanding *bool
EnableVideoUnderstanding *bool
}
ResponseXSearchOptionsTool declares Gateway-native SpaceXAI x_search with request options. Nil fields are omitted; non-nil empty slices are emitted.
type ResponseXSearchTool ¶
type ResponseXSearchTool struct{}
ResponseXSearchTool declares Gateway-native SpaceXAI x_search. It emits only {"type":"x_search"}.
type ResponsesBuiltInToolsRequest ¶
type ResponsesBuiltInToolsRequest struct {
Request ResponsesRequest
Tools []ResponseBuiltInTool
}
ResponsesBuiltInToolsRequest adds sealed Responses built-in tool declarations without changing the source-compatible ResponsesRequest field inventory.
type ResponsesRequest ¶
type ResponsesRequest struct {
Model string
Input ResponseInput
MaxOutputTokens *int
Temperature *float64
TopP *float64
PresencePenalty *float64
FrequencyPenalty *float64
Instructions *string
Tools []ResponseTool
ToolChoice ResponseToolChoice
ParallelToolCalls *bool
AllowedTools []string
Reasoning *ResponseReasoning
Text *ResponseText
Truncation *string
PreviousResponseID *string
Store *bool
Metadata map[string]string
Caching *string
CacheAnchorItems *int
CacheTTL *string
PromptCacheKey *string
}
ResponsesRequest is a non-streaming Responses API request.
type RetryPolicy ¶
type RetryPolicy struct {
MaxAttempts int
InitialDelay time.Duration
MaxDelay time.Duration
Multiplier float64
Jitter float64
}
RetryPolicy configures bounded retries. MaxAttempts counts the initial request: zero and one mean one attempt, and 2 through 10 enable retries that may duplicate billable, non-idempotent generation or evaluation work. Streaming responses are not retried after response headers are received. With retries enabled, zero InitialDelay, MaxDelay, and Multiplier resolve to 100*time.Millisecond, 2*time.Second, and 2; zero Jitter disables jitter. Explicit InitialDelay must be 1ms..1m, MaxDelay 1ms..5m and at least InitialDelay, Multiplier 1..10, and Jitter 0..1. Delay before retry r (starting at 1) is the saturated min(MaxDelay, InitialDelay*Multiplier^(r-1)), with symmetric jitter applied as a fraction and rounded to a time.Duration nanosecond. Valid Retry-After replaces and is capped by MaxDelay. Waiting is context-cancellable.
type Rounding ¶
Rounding reports provider decimal places. A nil Rounding object means the wire object was absent; an empty object is non-nil. Each nil field means its key was absent, while a non-nil pointer may contain zero and must be 0..15.
type ScoreAnswer ¶
ScoreAnswer reports a score and, when present, its probability distribution. A nil Probabilities map means the wire key was absent.
type ScoreQuestion ¶
ScoreQuestion asks for a score over ordered criteria indexed from zero. Instructions is required; Criteria must contain at least two descriptions.
type SpeechRequest ¶
type SpeechRequest struct {
Text string
Voice string
Instructions string
Language string
OutputFormat string
Speed *float64
ProviderOptions []ProviderOption
}
SpeechRequest describes one provider-protocol speech synthesis request.
type SpeechResult ¶
type SpeechResult struct {
Audio string
Warnings []ProviderWarning
ProviderMetadata map[string]json.RawMessage
Response ResponseMetadata
}
SpeechResult contains the provider's opaque audio string and response details.
type TokenSource ¶
TokenSource supplies an OIDC bearer token once per HTTP attempt using the current operation's request context. Errors and blank tokens become a TransportError whose Operation is "resolve OIDC token"; no credential fallback occurs.
type TranscriptionAudio ¶
type TranscriptionAudio interface {
// contains filtered or unexported methods
}
TranscriptionAudio is the closed set of supported transcription audio inputs.
type TranscriptionBase64 ¶
TranscriptionBase64 carries an opaque caller-provided audio string.
type TranscriptionBytes ¶
TranscriptionBytes carries raw audio bytes, encoded once as standard base64 on the wire.
type TranscriptionRequest ¶
type TranscriptionRequest struct {
Audio TranscriptionAudio
ProviderOptions []ProviderOption
}
TranscriptionRequest describes one provider-protocol transcription request.
type TranscriptionResult ¶
type TranscriptionResult struct {
Text string
Segments []TranscriptionSegment
Language *string
DurationSeconds *float64
Warnings []ProviderWarning
ProviderMetadata map[string]json.RawMessage
Response ResponseMetadata
}
TranscriptionResult contains one transcription and response details.
type TranscriptionSegment ¶
TranscriptionSegment is a timestamped transcription segment.
type TransportError ¶
type TransportError struct {
// contains filtered or unexported fields
}
TransportError reports failure resolving an OIDC token, encoding or creating a request, sending it, or reading a body. Operation is exactly "resolve OIDC token", "encode request", "create request", "send request", or "read response body". A nil receiver returns empty Operation, nil Unwrap, and "gateway transport error" from Error.
func (*TransportError) Error ¶
func (e *TransportError) Error() string
Error returns a safe diagnostic that never includes the wrapped error text.
func (*TransportError) Operation ¶
func (e *TransportError) Operation() string
Operation returns the stable transport operation, or an empty string.
func (*TransportError) Unwrap ¶
func (e *TransportError) Unwrap() error
Unwrap returns the underlying transport cause.
type Usage ¶
Usage reports token counts. A nil Usage object means the wire object was absent; an empty object is non-nil. Each nil field means its key was absent; a non-nil pointer may contain zero and is a non-negative JSON integer that fits int64.
type ValidationError ¶
type ValidationError struct {
// contains filtered or unexported fields
}
ValidationError reports an invalid evaluation request with a canonical public request Path and stable Reason. It does not unwrap. A nil receiver's accessors return empty strings and Error returns "gateway validation error".
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error returns a stable diagnostic that never contains request values or caller-controlled validation metadata. Detailed state remains available through Path and Reason.
func (*ValidationError) Path ¶
func (e *ValidationError) Path() string
Path returns the canonical request path, or an empty string when unavailable.
func (*ValidationError) Reason ¶
func (e *ValidationError) Reason() string
Reason returns the stable failure reason, or an empty string when unavailable.
type Warning ¶
type Warning struct {
Type WarningType
Feature string
Details *string
Setting string
Message string
}
Warning is the lossless public form of one wire warning. Unsupported and compatibility warnings require Feature and may set Details; deprecated warnings require Setting and Message; other warnings require Message. Nil Details distinguishes an omitted details key from an empty string.
type WarningType ¶
type WarningType string
WarningType identifies an evaluation warning variant.
const ( // WarningUnsupported reports an unsupported feature. WarningUnsupported WarningType = "unsupported" // WarningCompatibility reports compatibility behavior. WarningCompatibility WarningType = "compatibility" // WarningDeprecated reports a deprecated setting. WarningDeprecated WarningType = "deprecated" // WarningOther reports another provider warning. WarningOther WarningType = "other" )
Source Files
¶
- auth.go
- chat.go
- chat_stream.go
- chat_validate.go
- chat_wire.go
- client.go
- doc.go
- embedding.go
- embedding_validate.go
- embedding_wire.go
- errors.go
- evaluation.go
- evaluation_response.go
- evaluation_validate.go
- evaluation_wire.go
- headers.go
- image.go
- image_validate.go
- image_wire.go
- jsonvalue.go
- provider_options.go
- rerank.go
- rerank_validate.go
- rerank_wire.go
- response_error.go
- responses.go
- responses_stream.go
- responses_tools.go
- responses_validate.go
- responses_wire.go
- retry.go
- speech.go
- speech_validate.go
- speech_wire.go
- sse.go
- transcription.go
- transcription_validate.go
- transcription_wire.go
- transport.go
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
evaluate
command
Command evaluate demonstrates one Evaluation Model V4 request.
|
Command evaluate demonstrates one Evaluation Model V4 request. |
|
generate
command
Command generate demonstrates credentialed buffered and streaming requests to the Responses and Chat Completions surfaces.
|
Command generate demonstrates credentialed buffered and streaming requests to the Responses and Chat Completions surfaces. |
|
internal
|
|
|
testserver
Package testserver provides hermetic HTTP request capture for SDK tests.
|
Package testserver provides hermetic HTTP request capture for SDK tests. |