mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-01 00:11:39 +08:00
Compare commits
1 Commits
fix/plugin
...
hermes/her
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5628412d98 |
@@ -702,7 +702,7 @@ def _resolve_api_key_provider() -> Tuple[Optional[OpenAI], Optional[str]]:
|
|||||||
logger.debug("Auxiliary text client: %s (%s) via pool", pconfig.name, model)
|
logger.debug("Auxiliary text client: %s (%s) via pool", pconfig.name, model)
|
||||||
extra = {}
|
extra = {}
|
||||||
if "api.kimi.com" in base_url.lower():
|
if "api.kimi.com" in base_url.lower():
|
||||||
extra["default_headers"] = {"User-Agent": "KimiCLI/1.3"}
|
extra["default_headers"] = {"User-Agent": "KimiCLI/1.30.0"}
|
||||||
elif "api.githubcopilot.com" in base_url.lower():
|
elif "api.githubcopilot.com" in base_url.lower():
|
||||||
from hermes_cli.models import copilot_default_headers
|
from hermes_cli.models import copilot_default_headers
|
||||||
|
|
||||||
@@ -721,7 +721,7 @@ def _resolve_api_key_provider() -> Tuple[Optional[OpenAI], Optional[str]]:
|
|||||||
logger.debug("Auxiliary text client: %s (%s)", pconfig.name, model)
|
logger.debug("Auxiliary text client: %s (%s)", pconfig.name, model)
|
||||||
extra = {}
|
extra = {}
|
||||||
if "api.kimi.com" in base_url.lower():
|
if "api.kimi.com" in base_url.lower():
|
||||||
extra["default_headers"] = {"User-Agent": "KimiCLI/1.3"}
|
extra["default_headers"] = {"User-Agent": "KimiCLI/1.30.0"}
|
||||||
elif "api.githubcopilot.com" in base_url.lower():
|
elif "api.githubcopilot.com" in base_url.lower():
|
||||||
from hermes_cli.models import copilot_default_headers
|
from hermes_cli.models import copilot_default_headers
|
||||||
|
|
||||||
@@ -1195,7 +1195,7 @@ def _to_async_client(sync_client, model: str):
|
|||||||
|
|
||||||
async_kwargs["default_headers"] = copilot_default_headers()
|
async_kwargs["default_headers"] = copilot_default_headers()
|
||||||
elif "api.kimi.com" in base_lower:
|
elif "api.kimi.com" in base_lower:
|
||||||
async_kwargs["default_headers"] = {"User-Agent": "KimiCLI/1.3"}
|
async_kwargs["default_headers"] = {"User-Agent": "KimiCLI/1.30.0"}
|
||||||
return AsyncOpenAI(**async_kwargs), model
|
return AsyncOpenAI(**async_kwargs), model
|
||||||
|
|
||||||
|
|
||||||
@@ -1317,7 +1317,7 @@ def resolve_provider_client(
|
|||||||
final_model = model or _read_main_model() or "gpt-4o-mini"
|
final_model = model or _read_main_model() or "gpt-4o-mini"
|
||||||
extra = {}
|
extra = {}
|
||||||
if "api.kimi.com" in custom_base.lower():
|
if "api.kimi.com" in custom_base.lower():
|
||||||
extra["default_headers"] = {"User-Agent": "KimiCLI/1.3"}
|
extra["default_headers"] = {"User-Agent": "KimiCLI/1.30.0"}
|
||||||
elif "api.githubcopilot.com" in custom_base.lower():
|
elif "api.githubcopilot.com" in custom_base.lower():
|
||||||
from hermes_cli.models import copilot_default_headers
|
from hermes_cli.models import copilot_default_headers
|
||||||
extra["default_headers"] = copilot_default_headers()
|
extra["default_headers"] = copilot_default_headers()
|
||||||
@@ -1400,7 +1400,7 @@ def resolve_provider_client(
|
|||||||
# Provider-specific headers
|
# Provider-specific headers
|
||||||
headers = {}
|
headers = {}
|
||||||
if "api.kimi.com" in base_url.lower():
|
if "api.kimi.com" in base_url.lower():
|
||||||
headers["User-Agent"] = "KimiCLI/1.3"
|
headers["User-Agent"] = "KimiCLI/1.30.0"
|
||||||
elif "api.githubcopilot.com" in base_url.lower():
|
elif "api.githubcopilot.com" in base_url.lower():
|
||||||
from hermes_cli.models import copilot_default_headers
|
from hermes_cli.models import copilot_default_headers
|
||||||
|
|
||||||
|
|||||||
@@ -752,7 +752,7 @@ def run_doctor(args):
|
|||||||
_url = (_base.rstrip("/") + "/models") if _base else _default_url
|
_url = (_base.rstrip("/") + "/models") if _base else _default_url
|
||||||
_headers = {"Authorization": f"Bearer {_key}"}
|
_headers = {"Authorization": f"Bearer {_key}"}
|
||||||
if "api.kimi.com" in _url.lower():
|
if "api.kimi.com" in _url.lower():
|
||||||
_headers["User-Agent"] = "KimiCLI/1.0"
|
_headers["User-Agent"] = "KimiCLI/1.30.0"
|
||||||
_resp = httpx.get(
|
_resp = httpx.get(
|
||||||
_url,
|
_url,
|
||||||
headers=_headers,
|
headers=_headers,
|
||||||
|
|||||||
@@ -794,7 +794,7 @@ class AIAgent:
|
|||||||
client_kwargs["default_headers"] = copilot_default_headers()
|
client_kwargs["default_headers"] = copilot_default_headers()
|
||||||
elif "api.kimi.com" in effective_base.lower():
|
elif "api.kimi.com" in effective_base.lower():
|
||||||
client_kwargs["default_headers"] = {
|
client_kwargs["default_headers"] = {
|
||||||
"User-Agent": "KimiCLI/1.3",
|
"User-Agent": "KimiCLI/1.30.0",
|
||||||
}
|
}
|
||||||
elif "portal.qwen.ai" in effective_base.lower():
|
elif "portal.qwen.ai" in effective_base.lower():
|
||||||
client_kwargs["default_headers"] = _qwen_portal_headers()
|
client_kwargs["default_headers"] = _qwen_portal_headers()
|
||||||
@@ -4181,7 +4181,7 @@ class AIAgent:
|
|||||||
|
|
||||||
self._client_kwargs["default_headers"] = copilot_default_headers()
|
self._client_kwargs["default_headers"] = copilot_default_headers()
|
||||||
elif "api.kimi.com" in normalized:
|
elif "api.kimi.com" in normalized:
|
||||||
self._client_kwargs["default_headers"] = {"User-Agent": "KimiCLI/1.3"}
|
self._client_kwargs["default_headers"] = {"User-Agent": "KimiCLI/1.30.0"}
|
||||||
elif "portal.qwen.ai" in normalized:
|
elif "portal.qwen.ai" in normalized:
|
||||||
self._client_kwargs["default_headers"] = _qwen_portal_headers()
|
self._client_kwargs["default_headers"] = _qwen_portal_headers()
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user