Re:OpenAI to discontinue support for the Codex API
by QuadmasterXLII on Tuesday March 21, 2023 @09:00PM
(#35255218)
I'm seeing that the chat api wants to always wrap its response in "```python ```" when it generates code. Is there a prompt trick to stop this, or should I just be stripping it manually
All you have to do is 1) call the chat completion API, 2) structure your prompt in JSON as system+agent+user, and 3) get the completion from a different JSON node. You don’t have to round trip or maintain context or anything.