Documentation ¶
Overview ¶
Package xai is the x.ai provider
Index ¶
- Constants
- type Provider
- func (p *Provider) GetChatCompletions(ctx context.Context, req openai.ChatCompletionRequest, _ metadata.M) (openai.ChatCompletionResponse, error)
- func (p *Provider) GetChatCompletionsStream(ctx context.Context, req openai.ChatCompletionRequest, _ metadata.M) (provider.ResponseRecver, error)
- func (p *Provider) Name() string
Constants ¶
View Source
const BaseURL = "https://api.x.ai/v1"
View Source
const DefaultModel = "grok-beta"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct { // APIKey is the API key for x.ai APIKey string // Model is the model for x.ai // eg. "grok-beta" Model string // contains filtered or unexported fields }
Provider is the provider for x.ai
func NewProvider ¶
NewProvider creates a new x.ai ai provider
func (*Provider) GetChatCompletions ¶
func (p *Provider) GetChatCompletions(ctx context.Context, req openai.ChatCompletionRequest, _ metadata.M) (openai.ChatCompletionResponse, error)
GetChatCompletions implements ai.LLMProvider.
func (*Provider) GetChatCompletionsStream ¶
func (p *Provider) GetChatCompletionsStream(ctx context.Context, req openai.ChatCompletionRequest, _ metadata.M) (provider.ResponseRecver, error)
GetChatCompletionsStream implements ai.LLMProvider.
Click to show internal directories.
Click to hide internal directories.