diff options
Diffstat (limited to 'internal/lsp/handlers_utils.go')
| -rw-r--r-- | internal/lsp/handlers_utils.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/internal/lsp/handlers_utils.go b/internal/lsp/handlers_utils.go index 66e2ed1..e3c65a5 100644 --- a/internal/lsp/handlers_utils.go +++ b/internal/lsp/handlers_utils.go @@ -262,7 +262,14 @@ func (s *Server) chatWithStats(ctx context.Context, surface surfaceKind, spec re // Perform request client := s.clientFor(spec) if client == nil { - return "", fmt.Errorf("llm client unavailable") + provider := strings.TrimSpace(spec.provider) + if provider == "" { + provider = strings.TrimSpace(s.currentConfig().Provider) + } + if provider == "" { + return "", fmt.Errorf("llm client unavailable; check the configured provider and required API key") + } + return "", fmt.Errorf("llm client unavailable for provider %q; check the configured provider and required API key", provider) } modelUsed := spec.effectiveModel(client.DefaultModel()) txt, err := client.Chat(ctx, msgs, spec.options...) |
