fix(ai): add fallback default model when Ollama model is empty
When model is not explicitly set in config or request, fall back to llama3 to prevent 'model is required' errors from Ollama.
This commit is contained in:
parent
71783f8852
commit
fe20b2c55b
1 changed files with 4 additions and 0 deletions
|
|
@ -98,6 +98,10 @@ func (c *OllamaClient) Chat(ctx context.Context, req ChatRequest) (*ChatResponse
|
|||
if model == "" {
|
||||
model = c.model
|
||||
}
|
||||
// Ultimate fallback - if no model configured anywhere, use llama3
|
||||
if model == "" {
|
||||
model = "llama3"
|
||||
}
|
||||
|
||||
ollamaReq := ollamaRequest{
|
||||
Model: model,
|
||||
|
|
|
|||
Loading…
Reference in a new issue