Versions in this module Expand all Collapse all v0 v0.4.4 Nov 21, 2026 Changes in this version type QuestionDiagnostic + Logprobs map[string]float64 v0.4.3 Nov 10, 2026 v0.4.2 Nov 9, 2026 v0.4.1 Nov 6, 2026 v0.4.0 Nov 4, 2026 Changes in this version + const GatewayKeyHeader + const GatewayURLEnv + const PrivateVertexHostSuffix + const ServerKeyHeader + var ErrImageFetch = errors.New("image URL") + var ErrUnsupportedImageFormat = errors.New("unsupported image format") + var ImageHTTPClient = func(timeout time.Duration) *http.Client + var SendGatewayKey = true + func BuildMultimodalContent(textContent string, imageInputs []string) (interface{}, error) + func CheckImageFormat(ref string, data []byte) error + func GatewayKeyFor(rawURL string) string + func GatewayKeyForRemote(remoteURL string) string + func GatewayKeyFromEnv() string + func IsPrivateVertexHost(host string) bool + func IsVertexEndpointURL(rawURL string) bool + func NormalizeSchemaSamples(schemaContent string) string + func NormalizeVertexEndpointURL(rawURL string) string + func ProbabilityEntropy(probs map[string]float64) float64 + func ServerKeyFromEnv() string + func StripKeysOnCrossOriginRedirect(req *http.Request, via []*http.Request) error + type ChatChoice struct + FinishReason string + Index int + Logprobs *ChoiceLogprobs + Message ChatMessage + type ChatCompletionRequest struct + Logprobs bool + MaxTokens int + Messages []ChatMessage + Model string + Stream bool + TopLogprobs int + type ChatCompletionResponse struct + Choices []ChatChoice + Created int64 + ID string + Model string + Object string + Usage Usage + type ChatMessage struct + Content interface{} + Role string + func (m ChatMessage) RawContent() string + type ChoiceLogprobs struct + Content []TokenLogprob + type Client struct + AuthToken string + BaseURL string + HTTPClient *http.Client + MaxRetries int + Model string + ServerKey string + func NewClient(baseURL, defaultModel string, timeout time.Duration) *Client + func (c *Client) Complete(ctx context.Context, req ChatCompletionRequest) (*ChatCompletionResponse, *RequestStats, error) + func (c *Client) Decide(ctx context.Context, schemaContent, userStateContent string, images ...string) (*StructuredDecisionResponse, *RequestStats, error) + func (c *Client) WithAuthToken(token string) *Client + type ContentPart struct + ImageURL *ImageURLPart + Text string + Type string + type Diagnostics struct + Hole string + Layout string + Questions map[string]QuestionDiagnostic + Samples SampleStats + Steps int + Thought *ThoughtDiagnostic + Timing TimingStats + type HTTPError struct + Body string + Hint string + Retries int + StatusCode int + func (e *HTTPError) Error() string + type ImageURLPart struct + URL string + type ProposedOption struct + Description string + Name string + type QuestionAnswer struct + Agreement float64 + Choice string + Confidence float64 + Entropy float64 + Evidence string + Label string + Level string + Logprob float64 + Noul float64 + PriorFused bool + PriorLogits map[string]float64 + Probabilities map[string]float64 + RawEntropy float64 + Score float64 + Stderr float64 + Type string + func (qa QuestionAnswer) DisplayType() string + func (qa QuestionAnswer) DisplayValue() string + type QuestionDiagnostic struct + ArgmaxIsLabel bool + ArgmaxToken string + Entropy float64 + LabelMass float64 + func (qd *QuestionDiagnostic) UnmarshalJSON(data []byte) error + type RequestStats struct + DenoiseMs float64 + DenoiseSteps int + Diagnostics *Diagnostics + Endpoint string + Extended bool + Model string + OutputTokens int + PrefillMs float64 + PromptTokens int + Retries int + ReusedTokens int + SamplesN int + TotalTokens int + WallTime time.Duration + type SamplePolicy struct + Extended bool + FirstReadMaxEntropy float64 + Max int + Mode string + PinnedSlots int + Threshold float64 + func (sp *SamplePolicy) UnmarshalJSON(data []byte) error + type SampleStats struct + N int + Policy SamplePolicy + func (ss *SampleStats) UnmarshalJSON(data []byte) error + type StructuredDecisionResponse struct + Answers map[string]QuestionAnswer + Diagnostics Diagnostics + SuggestedExpansions []TaxonomyExpansionSuggestion + func ParseStructuredContent(content string) (*StructuredDecisionResponse, error) + func ParseStructuredContentWithLogprobs(content string, logprobs *ChoiceLogprobs) (*StructuredDecisionResponse, error) + func (r *StructuredDecisionResponse) ApplyTemperature(t Temperature) + type TaxonomyExpansionSuggestion struct + InjectedCatchAll bool + QuestionID string + RawThought string + Stage1Choice string + Stage1Confidence float64 + Stage1Entropy float64 + SuggestedOption ProposedOption + TemplatePatchHint string + TopCandidates map[string]float64 + TriggerReason string + type Temperature struct + All float64 + ByType map[string]float64 + func ParseSchemaTemperature(schemaJSON string) (Temperature, error) + func (t *Temperature) UnmarshalJSON(b []byte) error + func (t Temperature) For(answerType string) float64 + func (t Temperature) IsSet() bool + func (t Temperature) MarshalJSON() ([]byte, error) + func (t Temperature) Validate() error + type ThoughtDiagnostic struct + Budget int + Ms float64 + Text string + Tokens int + type TimingStats struct + DenoiseMs float64 + PrefillMs float64 + PromptTokens int + Reads int + ReusedTokens int + Rounds int + Samples int + StepsRun int + TotalMs float64 + type TokenLogprob struct + Logprob float64 + Token string + TopLogprobs []TopLogprobItem + type TopLogprobItem struct + Logprob float64 + Token string + type Usage struct + CompletionTokens int + PromptTokens int + TotalTokens int