__init__.py 1.1 KB

12345678910111213141516171819202122232425262728
  1. """Vercel AI Gateway provider profile: attribution headers + reasoning passthrough."""
  2. from typing import Any
  3. from providers import register_provider
  4. from providers.base import ProviderProfile
  5. class VercelAIGatewayProfile(ProviderProfile):
  6. """Vercel AI Gateway — attribution headers + reasoning passthrough."""
  7. def build_api_kwargs_extras(
  8. self, *, reasoning_config: dict | None = None, supports_reasoning: bool = True, **ctx: Any
  9. ) -> tuple[dict[str, Any], dict[str, Any]]:
  10. if not supports_reasoning:
  11. return {}, {}
  12. reasoning = dict(reasoning_config) if reasoning_config is not None else {"enabled": True, "effort": "medium"}
  13. return {"reasoning": reasoning}, {}
  14. vercel = VercelAIGatewayProfile(
  15. name="ai-gateway", aliases=("vercel", "vercel-ai-gateway", "ai_gateway", "aigateway"),
  16. env_vars=("AI_GATEWAY_API_KEY",), base_url="https://ai-gateway.vercel.sh/v1",
  17. default_headers={"HTTP-Referer": "https://hermes-agent.nousresearch.com", "X-Title": "Hermes Agent"},
  18. default_aux_model="google/gemini-3-flash",
  19. )
  20. register_provider(vercel)