mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
Fireworks renders a Responses request through a chat template that only accepts a system message at the very beginning, so a request carrying `instructions`, a developer item, and a replayed reasoning item (the shape Codex CLI sends from its second prompt on) came back 400 with "System message must be at the beginning". The leading system or developer items, and any developer item later in the conversation, now fold their text into top-level `instructions`, joined with blank lines, and leave `input`. A developer item that closes the conversation right after an assistant turn stays where it is as a system item, as does any system or developer item with an image or file part, so those parts still reach Fireworks. Mid-conversation system items stay untouched. Non-string `instructions` pass through unchanged. Folding into `instructions` rather than a leading system item keeps `previous_response_id` chaining working, since Fireworks prepends the stored history to `input` and a leading system item would land after it. This supersedes the leading system item approach from |
||
|---|---|---|
| .. | ||
| chat | ||
| completion | ||
| rerank | ||
| responses | ||
| test_fireworks_ai_common_utils.py | ||
| test_fireworks_ai_cost_calculator.py | ||
| test_fireworks_ai_kimi_model_metadata.py | ||