Documentation
¶
Overview ¶
Package moonshot implements the LLMProvider interface using the Moonshot AI platform. Moonshot's API is OpenAI-compatible, so we reuse the openai-go SDK with a custom base URL.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var APIKeyMeta = provider.ProviderMeta{ Provider: provider.ProviderMoonshot, AuthMethod: provider.AuthAPIKey, EnvVars: []string{"MOONSHOT_API_KEY"}, DisplayName: "Direct API", }
APIKeyMeta is the metadata for Moonshot via API Key
Functions ¶
func NewAPIKeyClient ¶
func NewAPIKeyClient(ctx context.Context) (provider.LLMProvider, error)
NewAPIKeyClient creates a new Moonshot client using API Key authentication. The Moonshot API is OpenAI-compatible, so we use the OpenAI SDK with a custom base URL.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements the LLMProvider interface for Moonshot AI using the OpenAI SDK.
func (*Client) ListModels ¶
ListModels returns the available models for Moonshot AI using the API.
func (*Client) Stream ¶
func (c *Client) Stream(ctx context.Context, opts provider.CompletionOptions) <-chan provider.StreamChunk
Stream sends a completion request and returns a channel of streaming chunks.
Click to show internal directories.
Click to hide internal directories.