-
Notifications
You must be signed in to change notification settings - Fork 215
Use official OpenAI ChatGPT API #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use official OpenAI ChatGPT API #6
Conversation
|
@microsoft-github-policy-service agree |
|
@yuan-alex Thanks a lot for adding this integration! We have also recently started testing the API internally. I am adding a commit with a suggestion on how the 'system' context can be set - essentially, using the first part of the current prompt as the system message, informing ChatGPT how it should act. Feel free to propose any modifications. |
|
@saihv Hey Sai! The multi-line string for the system prompt contains both blanks and newlines. To address this, I suggest adding a new folder specifically for system prompts, which we can read from. Also, with the new system prompt, ChatGPT responds only with the code and no code-blocks. I've pasted one of the examples below. The new response using your system prompt is cleaner (and saves on token costs!) but it does mean we get less of an explanation from the model. The code block extraction function can be removed but I'm curious on what your take is. |
|
Just tested combining the existing system prompt and first user prompt into one big system prompt and it performs very well. It seems like using both the first user prompts and system prompt to set instructions for ChatGPT causes some confusion and degraded performance. |
|
Might be worth taking a look at |
|
Adding a simple response example is enough to remind ChatGPT isn't in a python shell and is supposed to respond with an explanation. |
|
@yuan-alex Wouldn't it be better to package the query/response into separate |
|
@machinekoder I haven't encountered any significant performance improvement but I'm adding it anyways since it's been generally recommended. |
|
@yuan-alex Excellent, makes this more reproducible outside this project as well. |
|
@yuan-alex Thanks for developing this interface! Merged. |
|
Hi @yuan-alex , thanks for your commit update; however, I still got some connection issues ( |
Instead of relying on an unofficial method to access ChatGPT, this PR uses the official API to avoid potential issues or errors that might arise from using an unsupported approach.
However, this also introduces a new challenge: setting a system message. This issue was not addressed in the original paper, so I decided to use one of the system prompts that were used in ChatGPT as a baseline.