fix: strip properties for fireworks (#9703)

This commit is contained in:
Ari Webb
2026-02-26 15:12:21 -08:00
committed by Caren Thomas
parent 57e7e0e52b
commit 673c1220a1

View File

@@ -639,6 +639,14 @@ class OpenAIClient(LLMClientBase):
tool.function.strict = False
request_data = data.model_dump(exclude_unset=True)
# Fireworks uses strict validation (additionalProperties: false) and rejects
# reasoning fields that are not in their schema.
is_fireworks = llm_config.model_endpoint and "fireworks.ai" in llm_config.model_endpoint
if is_fireworks and "messages" in request_data:
for message in request_data["messages"]:
for field in ("reasoning_content_signature", "redacted_reasoning_content", "omitted_reasoning_content"):
message.pop(field, None)
# If Ollama
# if llm_config.handle.startswith("ollama/") and llm_config.enable_reasoner:
# Sadly, reasoning via the OpenAI proxy on Ollama only works for Harmony/gpt-oss