openai icon indicating copy to clipboard operation
openai copied to clipboard

feat: Support dynamic responseFormat

Open DuzziG opened this issue 1 year ago • 6 comments
trafficstars

OpenAI recently introduced Structured outputs in their API. This is done by passing the desired JSON schema in the "response_format" parameter as described here: https://openai.com/index/introducing-structured-outputs-in-the-api/

Since the JSON schema is an object i.e. Map<String, dynamic> and not a String, we should remove the type requirement for "response_format" and use dynamic instead, similar to "logitBias"

DuzziG avatar Sep 06 '24 08:09 DuzziG