parseResponseToStructuredResponse

Parses a structured response from the assistant message using the provided structured output configuration and language model. If a fixing parser is specified in the configuration, it will be used; otherwise, the structure will be parsed directly.

Return

A StructuredResponse<T> containing the parsed structure and the original assistant message.

Parameters

T

The type of the structured output.

response

The assistant's response message to be parsed.

config

The structured output configuration defining how the response should be parsed.

model

The language model to be used for parsing the structured output.