refactor: use is_oauth flag instead of hardcoded provider name check
This commit is contained in:
@@ -292,7 +292,9 @@ def _make_provider(config: Config):
|
||||
if provider_name == "openai_codex" or model.startswith("openai-codex/"):
|
||||
return OpenAICodexProvider(default_model=model)
|
||||
|
||||
if not model.startswith("bedrock/") and not (p and p.api_key) and provider_name != "github_copilot":
|
||||
from nanobot.providers.registry import find_by_name
|
||||
spec = find_by_name(provider_name)
|
||||
if not model.startswith("bedrock/") and not (p and p.api_key) and not (spec and spec.is_oauth):
|
||||
console.print("[red]Error: No API key configured.[/red]")
|
||||
console.print("Set one in ~/.nanobot/config.json under providers section")
|
||||
raise typer.Exit(1)
|
||||
|
||||
Reference in New Issue
Block a user