Documentation
¶
Overview ¶
Package mistral adapts the Mistral Conversations API to sigma.
The provider currently implements streaming text conversations, thinking chunks, function tools, and session affinity. Image inputs, built-in connectors, append, and restart are intentionally not implemented. Credentials resolve through sigma.Options.AuthResolver instead of direct environment reads.
Index ¶
- Constants
- func Register(registry *sigma.Registry, providerID sigma.ProviderID, opts ...ProviderOption) error
- func RegisterDefault(providerID sigma.ProviderID, opts ...ProviderOption) error
- type PayloadHook
- type Provider
- type ProviderOption
- func WithBaseURL(baseURL string) ProviderOption
- func WithHTTPClient(client *http.Client) ProviderOption
- func WithHeader(key, value string) ProviderOption
- func WithHeaders(headers map[string]string) ProviderOption
- func WithPayloadHook(hook PayloadHook) ProviderOption
- func WithResponseHook(hook ResponseHook) ProviderOption
- type ResponseHook
Constants ¶
const DefaultBaseURL = "https://api.mistral.ai/v1"
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(registry *sigma.Registry, providerID sigma.ProviderID, opts ...ProviderOption) error
Register adds a Mistral Conversations text provider to registry.
func RegisterDefault ¶
func RegisterDefault(providerID sigma.ProviderID, opts ...ProviderOption) error
RegisterDefault adds a Mistral Conversations text provider to sigma's default registry.
Types ¶
type PayloadHook ¶
type PayloadHook func(context.Context, sigma.Model, sigma.Request, sigma.Options, map[string]any) error
PayloadHook can inspect or mutate the Mistral request payload before it is encoded.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider adapts the Mistral Conversations API to sigma.
This provider currently implements model-backed text conversations with function tools, thinking chunks, and session affinity. Image inputs, built-in connectors, append, and restart are intentionally unsupported by this adapter.
func NewProvider ¶
func NewProvider(opts ...ProviderOption) *Provider
NewProvider constructs a Mistral Conversations provider.
type ProviderOption ¶
type ProviderOption func(*Provider)
ProviderOption configures a Provider.
func WithBaseURL ¶
func WithBaseURL(baseURL string) ProviderOption
WithBaseURL configures the provider base URL, for example an httptest server URL.
func WithHTTPClient ¶
func WithHTTPClient(client *http.Client) ProviderOption
WithHTTPClient configures the provider fallback HTTP client.
func WithHeader ¶
func WithHeader(key, value string) ProviderOption
WithHeader configures a provider default request header.
func WithHeaders ¶
func WithHeaders(headers map[string]string) ProviderOption
WithHeaders configures provider default request headers.
func WithPayloadHook ¶
func WithPayloadHook(hook PayloadHook) ProviderOption
WithPayloadHook adds a request payload hook.
func WithResponseHook ¶
func WithResponseHook(hook ResponseHook) ProviderOption
WithResponseHook adds an HTTP response hook.