Skip to content

Commit 347c2e0

Browse files
committed
Updated
1 parent 916e045 commit 347c2e0

96 files changed

Lines changed: 3372 additions & 5739 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1

Whitespace-only changes.

cmd/llm/main.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
agent "github.com/mutablelogic/go-llm/pkg/agent"
1717
anthropic "github.com/mutablelogic/go-llm/pkg/provider/anthropic"
1818
google "github.com/mutablelogic/go-llm/pkg/provider/google"
19+
mistral "github.com/mutablelogic/go-llm/pkg/provider/mistral"
1920
session "github.com/mutablelogic/go-llm/pkg/session"
2021
version "github.com/mutablelogic/go-llm/pkg/version"
2122
logger "github.com/mutablelogic/go-server/pkg/logger"
@@ -34,6 +35,7 @@ type Globals struct {
3435
// API Keys
3536
GeminiAPIKey string `name:"gemini-api-key" env:"GEMINI_API_KEY" help:"Google Gemini API key"`
3637
AnthropicAPIKey string `name:"anthropic-api-key" env:"ANTHROPIC_API_KEY" help:"Anthropic API key"`
38+
MistralAPIKey string `name:"mistral-api-key" env:"MISTRAL_API_KEY" help:"Mistral API key"`
3739
NewsAPIKey string `name:"news-api-key" env:"NEWS_API_KEY" help:"NewsAPI key"`
3840
WeatherAPIKey string `name:"weather-api-key" env:"WEATHER_API_KEY" help:"WeatherAPI key"`
3941
HAEndpoint string `name:"ha-endpoint" env:"HA_ENDPOINT" help:"Home Assistant endpoint URL"`
@@ -184,9 +186,22 @@ func (g *Globals) Agent() (agent.Agent, error) {
184186
opts = append(opts, agent.WithClient(anthropicClient))
185187
}
186188

189+
// Add Mistral client if API key is set
190+
if g.MistralAPIKey != "" {
191+
var clientOpts []client.ClientOpt
192+
if g.Debug {
193+
clientOpts = append(clientOpts, client.OptTrace(os.Stderr, true))
194+
}
195+
mistralClient, err := mistral.New(g.MistralAPIKey, clientOpts...)
196+
if err != nil {
197+
return nil, fmt.Errorf("failed to create Mistral client: %w", err)
198+
}
199+
opts = append(opts, agent.WithClient(mistralClient))
200+
}
201+
187202
// Check if at least one client is configured
188203
if len(opts) == 0 {
189-
return nil, fmt.Errorf("no API keys configured. Set --gemini-api-key or --anthropic-api-key (or use environment variables)")
204+
return nil, fmt.Errorf("no API keys configured. Set --gemini-api-key, --anthropic-api-key, or --mistral-api-key (or use environment variables)")
190205
}
191206

192207
return agent.NewAgent(opts...)

etc/_old/_anthropic/batch.go

Lines changed: 0 additions & 235 deletions
This file was deleted.

0 commit comments

Comments
 (0)