mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-02 02:01:47 +00:00
feat: provider modules — ProviderProfile ABC, 29 providers, fetch_models, transport single-path Introduces providers/ as the single source of truth for every inference provider. All 29 providers declared with correct data cross-checked against auth.py, runtime_provider.py and auxiliary_client.py. Rebased onto main (30307a980). Incorporates post-salvage fixes from56724147e(gmi aux model google/gemini-3.1-flash-lite-preview, already set in providers/gmi.py).
43 lines
1.3 KiB
Python
43 lines
1.3 KiB
Python
"""Vercel AI Gateway provider profile.
|
|
|
|
AI Gateway routes to multiple backends. Hermes sends attribution
|
|
headers and full reasoning config passthrough.
|
|
"""
|
|
|
|
from typing import Any
|
|
|
|
from providers import register_provider
|
|
from providers.base import ProviderProfile
|
|
|
|
|
|
class VercelAIGatewayProfile(ProviderProfile):
|
|
"""Vercel AI Gateway — attribution headers + reasoning passthrough."""
|
|
|
|
def build_api_kwargs_extras(
|
|
self,
|
|
*,
|
|
reasoning_config: dict | None = None,
|
|
supports_reasoning: bool = True,
|
|
**ctx: Any,
|
|
) -> tuple[dict[str, Any], dict[str, Any]]:
|
|
extra_body: dict[str, Any] = {}
|
|
if supports_reasoning and reasoning_config is not None:
|
|
extra_body["reasoning"] = dict(reasoning_config)
|
|
elif supports_reasoning:
|
|
extra_body["reasoning"] = {"enabled": True, "effort": "medium"}
|
|
return extra_body, {}
|
|
|
|
|
|
vercel = VercelAIGatewayProfile(
|
|
name="ai-gateway",
|
|
aliases=("vercel", "vercel-ai-gateway", "ai_gateway", "aigateway"),
|
|
env_vars=("AI_GATEWAY_API_KEY",),
|
|
base_url="https://ai-gateway.vercel.sh/v1",
|
|
default_headers={
|
|
"HTTP-Referer": "https://hermes-agent.nousresearch.com",
|
|
"X-Title": "Hermes Agent",
|
|
},
|
|
default_aux_model="google/gemini-3-flash",
|
|
)
|
|
|
|
register_provider(vercel)
|