Files
mistral-go-sdk/mistral.go
vikingowl aa5c53c407 feat: v1.1.0 — sync with upstream Python SDK v2.1.3
Add Connectors, Audio Speech/Voices, Audio Realtime types,
and Observability (beta). 41 new service methods, 116 total.

Breaking: ListModels and UploadFile signatures changed
(pass nil for previous behavior).
2026-03-24 09:07:03 +01:00

39 lines
671 B
Go

package mistral
import (
"net/http"
"time"
)
// Version is the SDK version string.
const Version = "1.1.0"
const (
defaultBaseURL = "https://api.mistral.ai"
defaultTimeout = 120 * time.Second
)
// Client is a Mistral AI API client.
type Client struct {
apiKey string
baseURL string
httpClient *http.Client
maxRetries int
retryDelay time.Duration
}
// NewClient creates a new Mistral AI client with the given API key.
func NewClient(apiKey string, opts ...Option) *Client {
c := &Client{
apiKey: apiKey,
baseURL: defaultBaseURL,
httpClient: &http.Client{
Timeout: defaultTimeout,
},
}
for _, opt := range opts {
opt(c)
}
return c
}