Your lightweight open-source personal agent.
Python agent-frameworkai-agentai-agentschatbotchatopsdiscord-botllm-agentsllmslocal-llmmcpmodel-context-protocolmulti-agentopenai-compatibleopenclawpersonal-ai-assistantpythonself-hostedtelegram-bot-ai-assistantwebuiworkflow-automation
Merge branch 'main' of https://github.com/kunalk16/nanobot into feat-support-azure-openai
Kunal Karmakar33c52cfb745a
diff --cc nanobot/cli/commands.pyindex 2d0f3c207,7d2c16125..ca5d8d7dd--- a/nanobot/cli/commands.py+++ b/nanobot/cli/commands.py@@@ -200,10 -212,7 +212,8 @@@ def onboard()def _make_provider(config: Config):"""Create the appropriate LLM provider from config."""- from nanobot.providers.custom_provider import CustomProvider- from nanobot.providers.litellm_provider import LiteLLMProviderfrom nanobot.providers.openai_codex_provider import OpenAICodexProvider+ from nanobot.providers.azure_openai_provider import AzureOpenAIProvidermodel = config.agents.defaults.modelprovider_name = config.get_provider_name(model)@@@ -221,20 -231,7 +232,21 @@@default_model=model,)+ # Azure OpenAI: direct Azure OpenAI endpoint with deployment name+ if provider_name == "azure_openai":+ if not p or not p.api_key or not p.api_base:+ console.print("[red]Error: Azure OpenAI requires api_key and api_base.[/red]")+ console.print("Set them in ~/.nanobot/config.json under providers.azure_openai section")+ console.print("Use the model field to specify the deployment name.")+ raise typer.Exit(1)++ return AzureOpenAIProvider(+ api_key=p.api_key,+ api_base=p.api_base,+ default_model=model,+ )++ from nanobot.providers.litellm_provider import LiteLLMProviderfrom nanobot.providers.registry import find_by_namespec = find_by_name(provider_name)if not model.startswith("bedrock/") and not (p and p.api_key) and not (spec and spec.is_oauth):diff --cc nanobot/providers/registry.pyindex 93a1138f0,59ba31a8f..3ba1a0ec1--- a/nanobot/providers/registry.py+++ b/nanobot/providers/registry.py@@@ -80,20 -79,8 +79,18 @@@ PROVIDERS: tuple[ProviderSpec, ...] =litellm_prefix="",is_direct=True,),++ # === Azure OpenAI (direct API calls with API version 2024-10-21) =====+ ProviderSpec(+ name="azure_openai",+ keywords=("azure", "azure-openai"),+ env_key="",+ display_name="Azure OpenAI",+ litellm_prefix="",+ is_direct=True,+ ),-# === Gateways (detected by api_key / api_base, not model name) =========# Gateways can route any model, so they win in fallback.-# OpenRouter: global gateway, keys start with "sk-or-"ProviderSpec(name="openrouter",