Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions conversation/mistral/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ metadata:
A time-to-live value for a prompt cache to expire. Uses Golang durations
type: string
example: '10m'
- name: endpoint
required: false
description: |
Endpoint for the component to use.
example: "http://localhost:4566"
default: "https://api.mistral.ai/v1"
5 changes: 5 additions & 0 deletions conversation/mistral/mistral.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,14 @@ func (m *Mistral) Init(ctx context.Context, meta conversation.Metadata) error {
// Resolve model via central helper (uses metadata, then env var, then default)
model := conversation.GetMistralModel(md.Model)

if md.Endpoint == "" {
md.Endpoint = "https://api.mistral.ai/v1"
}

llm, err := mistral.New(
mistral.WithModel(model),
mistral.WithAPIKey(md.Key),
mistral.WithEndpoint(md.Endpoint),
)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion tests/conformance/conversation/conversation.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ func ConformanceTests(t *testing.T, props map[string]string, conv conversation.C
responseMessages = append(responseMessages,
llms.MessageContent{
Role: llms.ChatMessageTypeAI,
Parts: []llms.ContentPart{toolCall},
Parts: []llms.ContentPart{&toolCall},
},
llms.MessageContent{
Role: llms.ChatMessageTypeTool,
Expand Down