reasoning_content field. This field contains the
model’s internal reasoning, which would otherwise appear in <think></think>
tags within the content field. For some models, the reasoning content may
instead be included directly in the content field itself.
Prerequisites
We recommend using the Fireworks Python SDK to work with reasoning, as it supports Fireworks-specific parameters and response fields.The SDK is currently in alpha. Use the
--pre flag when installing to get the latest version.Basic usage
Select a reasoning model from our serverless model library.Controlling reasoning effort
You can control the reasoning token length using thereasoning_effort parameter:
Streaming with reasoning content
When streaming, the reasoning content is available in each chunk’s delta:Interleaved thinking
When building multi-turn tool-calling agents with models that support interleaved thinking, you must include thereasoning_content from previous
assistant turns in subsequent requests. You can do this in two ways:
- Pass the
Messageobject directly (recommended) - The SDK message object already contains thereasoning_contentfield alongsidecontentandtool_calls - Manually include
reasoning_content- When constructing messages as dictionaries, explicitly add thereasoning_contentfield
Interleaved thinking is triggered when the last message in your API request
has
"role": "tool", enabling the model to use its previous reasoning process
when responding to the tool result. If a model does not support interleaved
thinking, it simply ignores the extra reasoning context so this pattern is
safe to use broadly.- Pass Message object
- Manual dictionary
reasoning_content from the first turn is included in subsequent requests:
main.py