mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
add identifier for openrouter calls
This commit is contained in:
parent
cbff32585d
commit
9a858b8d67
5 changed files with 53 additions and 14 deletions
|
|
@ -71,10 +71,17 @@ DEFAULT_MIN_LENGTH_FOR_SUMMARIZATION = 5000
|
|||
_aux_sync_client, DEFAULT_SUMMARIZER_MODEL = get_text_auxiliary_client()
|
||||
_aux_async_client: AsyncOpenAI | None = None
|
||||
if _aux_sync_client is not None:
|
||||
_aux_async_client = AsyncOpenAI(
|
||||
api_key=_aux_sync_client.api_key,
|
||||
base_url=str(_aux_sync_client.base_url),
|
||||
)
|
||||
_async_kwargs = {
|
||||
"api_key": _aux_sync_client.api_key,
|
||||
"base_url": str(_aux_sync_client.base_url),
|
||||
}
|
||||
if "openrouter" in str(_aux_sync_client.base_url).lower():
|
||||
_async_kwargs["default_headers"] = {
|
||||
"HTTP-Referer": "https://github.com/NousResearch/hermes-agent",
|
||||
"X-OpenRouter-Title": "Hermes Agent",
|
||||
"X-OpenRouter-Categories": "cli-agent",
|
||||
}
|
||||
_aux_async_client = AsyncOpenAI(**_async_kwargs)
|
||||
|
||||
_debug = DebugSession("web_tools", env_var="WEB_TOOLS_DEBUG")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue