diff --git a/readme.MD b/readme.MD index 716f5c0..d3bb3e7 100644 --- a/readme.MD +++ b/readme.MD @@ -113,7 +113,7 @@ set OPENAI_API_BASE=https://my-super-proxy.vercel.app/v1 - [x] `max_tokens` - [x] `n` (`candidateCount` <8) _n.b.: atm api does not accept >1_ - [ ] `presence_penalty` - - [ ] `response_format` + - [x] `response_format` - [ ] `seed` - [x] `stop`: string|array (`stopSequences` [1,5]) - [x] stream diff --git a/src/worker.mjs b/src/worker.mjs index 8c23947..365d13c 100644 --- a/src/worker.mjs +++ b/src/worker.mjs @@ -135,6 +135,9 @@ const transformConfig = (req) => { cfg[matchedKey] = req[key]; } } + if (req.response_format?.type === "json_object") { + cfg.response_mime_type = "application/json"; + } return cfg; };