-
Notifications
You must be signed in to change notification settings - Fork 22
Closed
Description
Description
I'm using a proxy (https://api.forge.tensorblock.co/v1/chat/completions) that is supposed to be OpenAI-compatible. When I send the exact same payload to OpenAI's API, it works perfectly. However, when I send the same payload to the Forge proxy, I get a validation error:
curl https://api.openai.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-..." \
-d @openai_payload.json
# ✅ Response: successcurl https://api.forge.tensorblock.co/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer forge-..." \
-d @forge_payload.json
# ❌ Response:
{
"detail": [
{
"type": "list_type",
"loc": ["body", "messages", 2, "content", "list[OpenAIContentModel]"],
"msg": "Input should be a valid list",
"input": null
},
{
"type": "string_type",
"loc": ["body", "messages", 2, "content", "str"],
"msg": "Input should be a valid string",
"input": null
}
]
}Payload
I'm attaching the exact payload as payload.json used in both cases.
Expected Behavior
Since the Forge proxy is advertised as OpenAI-compatible, it should accept and correctly handle payloads that OpenAI accepts — including tool_calls and content: null cases as returned when finish_reason = "tool_calls".
Actual Behavior
The proxy fails with a validation error, specifically rejecting content: null.
Suggested Fix
The proxy implementation should:
- Accept
content: nullwhentool_callsare present, which is valid OpenAI behavior. - Update Pydantic schema (if used) to allow
Union[str, None]instead of juststr. - Make sure
messages[].contentcan be null per OpenAI's official spec.
Metadata
Metadata
Assignees
Labels
No labels