ParsesTextResponses
trait ParsesTextResponses
Traits
Methods
array
decodeStructuredOutput(string|null $text)
Decode a structured output payload, tolerating markdown code fences.
void
validateTextResponse(array $data)
Validate the Groq response data.
parseTextResponse(array $data, Provider $provider, bool $structured)
Parse a single Groq response into a StepResponse.
extractUsage(array $data)
Extract usage data from the response.
FinishReason
extractFinishReason(array $choice)
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 Groq response data.
at line 39
protected StepResponse
parseTextResponse(array $data, Provider $provider, bool $structured)
Parse a single Groq response into a StepResponse.
at line 74
protected TextUsage
extractUsage(array $data)
Extract usage data from the response.
at line 89
protected FinishReason
extractFinishReason(array $choice)
Extract and map the finish reason from the response.