Documentation
¶
Overview ¶
Package grok provides a Grok (xAI) Model implementation for agentic-go. Grok models are accessed via the xAI API, which exposes an OpenAI-compatible endpoint at https://api.x.ai/v1.
The provider wraps the OpenAI provider with Grok-specific defaults and inherits both streaming and non-streaming capabilities.
Index ¶
Constants ¶
View Source
const DefaultBaseURL = "https://api.x.ai/v1"
DefaultBaseURL is the xAI API endpoint.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct {
*oaiProvider.Model
}
Model wraps the OpenAI provider for Grok (xAI). It inherits all methods including Request and RequestStream.
type Option ¶
type Option func(*config)
Option configures the Grok Model.
func WithAPIKey ¶
WithAPIKey sets the API key. If not set, the GROK_API_KEY or XAI_API_KEY env var is used.
func WithBaseURL ¶
WithBaseURL overrides the default xAI base URL.
Click to show internal directories.
Click to hide internal directories.