feat(devgen/providers):improve provider error handling and response parsing

This commit is contained in:
sankalp committed 2026-06-06 16:27:03 +05:45
1 parent 5660e40eb4
commit 51d2b7549f
6 files changed
+64 -39

No files matched your search

+4 -1
View File
@@ -9,7 +9,10 @@ class AnthropicProvider:
) -> str:
"""Generates a response using the Anthropic API."""
if not api_key:
raise ValueError("Anthropic API key is required.")
raise ValueError(
"Anthropic API key is missing. "
"Set it via `devgen setup config` or pass --api-key."
)
try:
client = anthropic.Anthropic(api_key=api_key)