mirror of
https://github.com/mudler/LocalAI.git
synced 2026-04-11 18:29:47 -04:00
fix(mcp): make responses compliant to OpenAI APIs (#6436)
The result is enclosed in the Message field. Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
committed by
GitHub
parent
fa6bbd9fa2
commit
69d565e55d
@@ -122,7 +122,7 @@ func MCPCompletionEndpoint(cl *config.ModelConfigLoader, ml *model.ModelLoader,
|
||||
ID: id,
|
||||
Created: created,
|
||||
Model: input.Model, // we have to return what the user sent here, due to OpenAI spec.
|
||||
Choices: []schema.Choice{{Text: f.LastMessage().Content}},
|
||||
Choices: []schema.Choice{{Message: &schema.Message{Role: "assistant", Content: &f.LastMessage().Content}}},
|
||||
Object: "text_completion",
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user