casual-simulation / casualos

Casual Open Simulation for the Web
https://ab1.bot
MIT License
49 stars 9 forks source link

Support `json_object` response format from OpenAI chat completions #336

Open KallynGowdy opened 10 months ago

KallynGowdy commented 10 months ago

We should support sending the json_object response_format parameter in OpenAI chat completions requests. ai.chat() should be improved to support requesting a JSON response.

See OpenAI APi Reference for details on OpenAI's API.