Merge PR #21: feat: add Amazon Bedrock support
This commit is contained in:
commit
8f9d4ef981
@ -178,11 +178,13 @@ def gateway(
|
|||||||
# Create components
|
# Create components
|
||||||
bus = MessageBus()
|
bus = MessageBus()
|
||||||
|
|
||||||
# Create provider (supports OpenRouter, Anthropic, OpenAI)
|
# Create provider (supports OpenRouter, Anthropic, OpenAI, Bedrock)
|
||||||
api_key = config.get_api_key()
|
api_key = config.get_api_key()
|
||||||
api_base = config.get_api_base()
|
api_base = config.get_api_base()
|
||||||
|
model = config.agents.defaults.model
|
||||||
|
is_bedrock = model.startswith("bedrock/")
|
||||||
|
|
||||||
if not api_key:
|
if not api_key and not is_bedrock:
|
||||||
console.print("[red]Error: No API key configured.[/red]")
|
console.print("[red]Error: No API key configured.[/red]")
|
||||||
console.print("Set one in ~/.nanobot/config.json under providers.openrouter.apiKey")
|
console.print("Set one in ~/.nanobot/config.json under providers.openrouter.apiKey")
|
||||||
raise typer.Exit(1)
|
raise typer.Exit(1)
|
||||||
@ -289,8 +291,10 @@ def agent(
|
|||||||
|
|
||||||
api_key = config.get_api_key()
|
api_key = config.get_api_key()
|
||||||
api_base = config.get_api_base()
|
api_base = config.get_api_base()
|
||||||
|
model = config.agents.defaults.model
|
||||||
|
is_bedrock = model.startswith("bedrock/")
|
||||||
|
|
||||||
if not api_key:
|
if not api_key and not is_bedrock:
|
||||||
console.print("[red]Error: No API key configured.[/red]")
|
console.print("[red]Error: No API key configured.[/red]")
|
||||||
raise typer.Exit(1)
|
raise typer.Exit(1)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user