Versions in this module Expand all Collapse all v1 v1.1.0 Feb 18, 2026 Changes in this version type ChatCompletionRequest + ResponseFormat *ResponseFormat + type JSONSchemaSpec struct + Schema map[string]any + type ResponseFormat struct + JSONSchema *JSONSchemaSpec + Type string v1.0.1 Dec 26, 2025 Changes in this version + const BaseURL + type APIError struct + Code string + Message string + StatusCode int + Type string + func (e *APIError) Error() string + func (e *APIError) IsRateLimitError() bool + type ChatCompletionRequest struct + FrequencyPenalty float64 + MaxTokens int + Messages []Message + Model string + PresencePenalty float64 + ReturnImages bool + ReturnRelatedQuestions bool + SearchDomainFilter []string + SearchRecencyFilter string + Stream bool + Temperature *float64 + TopK int + TopP *float64 + type ChatCompletionResponse struct + Choices []Choice + Citations []string + Created int64 + ID string + Images []ImageResult + Model string + Object string + RelatedQuestions []string + Usage Usage + type Choice struct + Delta *Message + FinishReason string + Index int + Message Message + type Client struct + func NewClient(config ClientConfig) (*Client, error) + func (c *Client) ChatCompletions(ctx context.Context, req ChatCompletionRequest) (*ChatCompletionResponse, error) + func (c *Client) Ping(ctx context.Context, model string) error + func (c *Client) Search(ctx context.Context, req SearchRequest) (*SearchResponse, error) + type ClientConfig struct + APIKey string + BaseURL string + Timeout time.Duration + type ErrorDetail struct + Code string + Message string + Type string + type ErrorResponse struct + Error ErrorDetail + type ImageResult struct + Alt string + Height int + SourceURL string + URL string + Width int + type Message struct + Content string + Role string + type SearchRequest struct + CountryCode string + DomainFilter []string + LanguageCode string + Query string + RecencyFilter string + ReturnImages bool + SafeSearch bool + type SearchResponse struct + Images []ImageResult + Results []SearchResult + type SearchResult struct + Author string + DatePublished string + Snippet string + Title string + URL string + type Usage struct + CompletionTokens int + PromptTokens int + TotalTokens int