ParsesTextResponses
trait ParsesTextResponses
Traits
Methods
Decode a structured output payload, tolerating markdown code fences.
Validate the DeepSeek response data.
Parse the DeepSeek response data into a single step response.
Extract usage data from the response.
Extract and map the finish reason from the response.
Details
in
DecodesStructuredOutput at line 12
protected array
decodeStructuredOutput(string|null $text)
Decode a structured output payload, tolerating markdown code fences.
at line 25
protected void
validateTextResponse(array $data)
Validate the DeepSeek response data.
at line 43
protected StepResponse
parseTextResponse(array $data, Provider $provider, bool $structured)
Parse the DeepSeek response data into a single step response.
DeepSeek thinking-mode responses can include reasoning_content on each
choice's message. We capture it into replayBlocks; the message
mapper only replays it for assistant messages that include tool calls.
at line 81
protected TextUsage
extractUsage(array $data)
Extract usage data from the response.
at line 96
protected FinishReason
extractFinishReason(array $choice)
Extract and map the finish reason from the response.