Versions in this module Expand all Collapse all v0 v0.0.3 May 9, 2025 Changes in this version + const CodestralEndpoint + const DefaultMaxRetries + const DefaultTimeout + const Endpoint + const ModelCodestralLatest + const ModelMistralLarge2402 + const ModelMistralLargeLatest + const ModelMistralMedium2312 + const ModelMistralMediumLatest + const ModelMistralSmall2312 + const ModelMistralSmall2402 + const ModelMistralSmallLatest + const ModelMistralTiny + const ModelOpenMistral7b + const ModelOpenMixtral8x22b + const ModelOpenMixtral8x7b + const RoleAssistant + const RoleSystem + const RoleTool + const RoleUser + const ToolChoiceAny + const ToolChoiceAuto + const ToolChoiceNone + var DefaultChatRequestParams = ChatRequestParams + type ChatCompletionResponse struct + Choices []ChatCompletionResponseChoice + Created int + ID string + Model string + Object string + Usage UsageInfo + type ChatCompletionResponseChoice struct + FinishReason FinishReason + Index int + Message ChatMessage + type ChatCompletionResponseChoiceStream struct + Delta DeltaMessage + FinishReason FinishReason + Index int + type ChatCompletionStreamResponse struct + Choices []ChatCompletionResponseChoiceStream + Created int + Error error + ID string + Model string + Object string + Usage UsageInfo + type ChatMessage struct + Content string + Role string + ToolCalls []ToolCall + type ChatRequestParams struct + MaxTokens int + RandomSeed int + ResponseFormat ResponseFormat + SafePrompt bool + Temperature float64 + ToolChoice string + Tools []Tool + TopP float64 + type Content any + type DeltaMessage struct + Content string + Role string + ToolCalls []ToolCall + type Dimensions struct + DPI int + Height int + Width int + type Document struct + DocumentUrl string + ImageUrl string + Type string + type EmbeddingObject struct + Embedding []float64 + Index int + Object string + type EmbeddingResponse struct + Data []EmbeddingObject + ID string + Model string + Object string + Usage UsageInfo + type FIMCompletionResponse struct + Choices []FIMCompletionResponseChoice + Created int + ID string + Model string + Object string + Usage UsageInfo + type FIMCompletionResponseChoice struct + FinishReason FinishReason + Index int + Message ChatMessage + type FIMRequestParams struct + MaxTokens int + Model string + Prompt string + Stop []string + Suffix string + Temperature float64 + type FinishReason string + const FinishReasonError + const FinishReasonLength + const FinishReasonStop + type Function struct + Description string + Name string + Parameters any + type FunctionCall struct + Arguments string + Name string + type MistralAPIError struct + HTTPStatus int + Headers map[string][]string + func NewMistralAPIError(message string, httpStatus int, headers map[string][]string) *MistralAPIError + func (e *MistralAPIError) Error() string + type MistralClient struct + func NewCodestralClientDefault(apiKey string) *MistralClient + func NewMistralClient(apiKey string, endpoint string, maxRetries int, timeout time.Duration) *MistralClient + func NewMistralClientDefault(apiKey string) *MistralClient + func (c *MistralClient) Chat(model string, messages []ChatMessage, params *ChatRequestParams) (*ChatCompletionResponse, error) + func (c *MistralClient) ChatStream(model string, messages []ChatMessage, params *ChatRequestParams) (<-chan ChatCompletionStreamResponse, error) + func (c *MistralClient) Embeddings(model string, input []string) (*EmbeddingResponse, error) + func (c *MistralClient) FIM(params *FIMRequestParams) (*FIMCompletionResponse, error) + func (c *MistralClient) ListModels() (*ModelList, error) + func (c *MistralClient) OCR(model string, document Document, params *OcrParams) (*OcrDocument, error) + func (c *MistralClient) Vision(model string, messages []VisionMessage, params *ChatRequestParams) (*ChatCompletionResponse, error) + type MistralConnectionError struct + func NewMistralConnectionError(message string) *MistralConnectionError + type MistralError struct + Message string + func (e *MistralError) Error() string + type ModelCard struct + Created int + ID string + Object string + OwnedBy string + Parent string + Permission []ModelPermission + Root string + type ModelList struct + Data []ModelCard + Object string + type ModelPermission struct + AllowCreateEngine bool + AllowFineTuning bool + AllowLogprobs bool + AllowSampling bool + AllowSearchIndices bool + AllowView bool + Created int + Group string + ID string + IsBlocking bool + Object string + Organization string + type OcrDocument struct + Model string + Pages []Page + UsageInfo OcrUsageInfo + type OcrParams struct + IncludeImageBase64 bool + type OcrUsageInfo struct + DocSizeBytes int + PagesProcessed int + type Page struct + Dimensions Dimensions + Images []string + Index int + Markdown string + type ResponseFormat string + const ResponseFormatJsonObject + const ResponseFormatText + type TextContent struct + Text string + Type string + type Tool struct + Function Function + Type ToolType + type ToolCall struct + Function FunctionCall + Id string + Type ToolType + type ToolType string + const ToolTypeFunction + type UsageInfo struct + CompletionTokens int + PromptTokens int + TotalTokens int + type VisionContent struct + ImageUrl string + Type string + type VisionMessage struct + Content []Content + Role string + ToolCalls []ToolCall