Enha: avoid recursion in llm calls

This commit is contained in:
Grail Finder
2026-01-31 12:57:53 +03:00
parent fa192a2624
commit 3a11210f52
5 changed files with 132 additions and 60 deletions

View File

@@ -279,3 +279,16 @@ func listChatRoles() []string {
charset = append(charset, cbc...)
return charset
}
func deepseekModelValidator() error {
if cfg.CurrentAPI == cfg.DeepSeekChatAPI || cfg.CurrentAPI == cfg.DeepSeekCompletionAPI {
if chatBody.Model != "deepseek-chat" && chatBody.Model != "deepseek-reasoner" {
if err := notifyUser("bad request", "wrong deepseek model name"); err != nil {
logger.Warn("failed ot notify user", "error", err)
return err
}
return nil
}
}
return nil
}