Skip to content

Commit

Permalink
Support response_format
Browse files Browse the repository at this point in the history
  • Loading branch information
johnd0e committed Apr 10, 2024
1 parent d0340eb commit 745a007
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion readme.MD
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/worker.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down

0 comments on commit 745a007

Please sign in to comment.