mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-29 01:31:41 +00:00
refactor: integrate Nous Portal support in auxiliary client
- Added functionality to include product attribution tags for Nous Portal in auxiliary API calls. - Introduced a mechanism to determine if the auxiliary client is backed by Nous Portal, affecting the extra body of requests. - Updated various tools to utilize the new extra body configuration for enhanced tracking in API calls.
This commit is contained in:
parent
e3cb957a10
commit
7a3656aea2
5 changed files with 40 additions and 1 deletions
|
|
@ -242,6 +242,8 @@ Create a markdown summary that captures all key information in a well-organized,
|
|||
if _aux_async_client is None:
|
||||
logger.warning("No auxiliary model available for web content processing")
|
||||
return None
|
||||
from agent.auxiliary_client import get_auxiliary_extra_body
|
||||
_extra = get_auxiliary_extra_body()
|
||||
response = await _aux_async_client.chat.completions.create(
|
||||
model=model,
|
||||
messages=[
|
||||
|
|
@ -250,6 +252,7 @@ Create a markdown summary that captures all key information in a well-organized,
|
|||
],
|
||||
temperature=0.1,
|
||||
max_tokens=max_tokens,
|
||||
**({} if not _extra else {"extra_body": _extra}),
|
||||
)
|
||||
return response.choices[0].message.content.strip()
|
||||
except Exception as api_error:
|
||||
|
|
@ -362,6 +365,8 @@ Create a single, unified markdown summary."""
|
|||
fallback = fallback[:max_output_size] + "\n\n[... truncated ...]"
|
||||
return fallback
|
||||
|
||||
from agent.auxiliary_client import get_auxiliary_extra_body
|
||||
_extra = get_auxiliary_extra_body()
|
||||
response = await _aux_async_client.chat.completions.create(
|
||||
model=model,
|
||||
messages=[
|
||||
|
|
@ -370,6 +375,7 @@ Create a single, unified markdown summary."""
|
|||
],
|
||||
temperature=0.1,
|
||||
max_tokens=4000,
|
||||
**({} if not _extra else {"extra_body": _extra}),
|
||||
)
|
||||
final_summary = response.choices[0].message.content.strip()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue