mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-30 06:41:51 +00:00
fix: strip image parts for non-vision models with provider profiles
_propare_messages_for_non_vision_model() was only called in the legacy flag path (no provider profile). Providers with registered profiles (e.g. DeepSeek, Kimi) bypassed the strip, causing HTTP 400 errors when image_url content blocks reached their non-vision APIs. This mirrors the existing behavior in the legacy path, ensuring all non-vision models get image stripping regardless of profile status. Vision-capable models are unaffected (the function is a no-op for them).
This commit is contained in:
parent
bde3c7982c
commit
75e5d0f6bd
1 changed files with 5 additions and 0 deletions
|
|
@ -10033,6 +10033,11 @@ class AIAgent:
|
|||
if _ephemeral_out is not None:
|
||||
self._ephemeral_max_output_tokens = None
|
||||
|
||||
# Strip image parts for non-vision models that have provider profiles
|
||||
# (e.g. DeepSeek, Kimi). The legacy path below already does this, but
|
||||
# registered providers with profiles were bypassing the strip.
|
||||
api_messages = self._prepare_messages_for_non_vision_model(api_messages)
|
||||
|
||||
return _ct.build_kwargs(
|
||||
model=self.model,
|
||||
messages=api_messages,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue