feat(gemini): improve request context for support and compatibility
Include the Hermes client name and version with Gemini inference, model and tier checks, and TTS requests. Add focused coverage for the request headers and keep the Gemini-specific context scoped to Google Gemini endpoints.
This commit is contained in:
committed by
Teknium
parent
c7e09f2571
commit
b8eb89f5c9
@@ -3594,6 +3594,8 @@ def probe_api_models(
|
||||
|
||||
tried: list[str] = []
|
||||
headers: dict[str, str] = {"User-Agent": _HERMES_USER_AGENT}
|
||||
if urllib.parse.urlparse(normalized).hostname == "generativelanguage.googleapis.com":
|
||||
headers["X-Goog-Api-Client"] = f"hermes-agent/{_HERMES_VERSION}"
|
||||
if api_key and api_mode == "anthropic_messages":
|
||||
headers["x-api-key"] = api_key
|
||||
headers["anthropic-version"] = "2023-06-01"
|
||||
|
||||
Reference in New Issue
Block a user