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:
rcourtman 2025-12-15 16:59:51 +00:00
parent 71783f8852
commit fe20b2c55b

View file

@ -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,