mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-07 08:02:23 +00:00
feat(xai-oauth): add xAI Grok OAuth (SuperGrok Subscription) provider — port to extracted modules
Original commit b62c99797 by Jaaneek targeted six locations in
pre-refactor run_agent.py. Re-applied to the extracted post-PR locations:
- api_mode dispatch → agent/agent_init.py
- is_xai_responses build_api_kwargs → agent/chat_completion_helpers.py
- codex_auth_retry block + 401 hint → agent/conversation_loop.py
- _try_refresh_codex_client_credentials body → run_agent.py (kept)
The non-run_agent.py portions of the commit (auxiliary_client, codex
transport, hermes_cli/auth, tools/xai_http, tests, docs) merged cleanly
from main via the prior merge commit.
Co-authored-by: Jaaneek <Jaaneek@users.noreply.github.com>
This commit is contained in:
parent
7d221aa1f2
commit
b07524e53a
4 changed files with 64 additions and 14 deletions
|
|
@ -284,7 +284,7 @@ def build_api_kwargs(agent, api_messages: list) -> dict:
|
|||
and "/backend-api/codex" in agent._base_url_lower
|
||||
)
|
||||
)
|
||||
is_xai_responses = agent.provider == "xai" or agent._base_url_hostname == "api.x.ai"
|
||||
is_xai_responses = agent.provider in {"xai", "xai-oauth"} or agent._base_url_hostname == "api.x.ai"
|
||||
_msgs_for_codex = agent._prepare_messages_for_non_vision_model(api_messages)
|
||||
return _ct.build_kwargs(
|
||||
model=agent.model,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue