Hacker News new | ask | show | jobs
by typest 1197 days ago
Do you know of any advice or guides on how to use the chatgpt api? It's unclear to me when things should be a system message, and if not, if they should be user or assistant messages.

You say here that the simple message should be really simple. So, further instructions should be in a user message? Any idea what constitutes a "simple" system message?

2 comments

The best thing you can do is lots of testing. Setup an environment where you can isolate the prompt you are working on (the new chat playground is good for this) and load it with a system message and some assistant and user messages then play with it until you get the results you want.

I've had success with a simple system method that is one sentence defining how we are extending chatgpt.

"You are AcmeCoBot an extension of ChatGPT which we have enabled <x, y, z features> to assist users <goal>."

Then a user message with the actual instructions on what you want/need - this is much closer prompting for gpt-3.

user msg 1: Translate the following to German for me... some text assistant msg 1: an example translation

new user msg: Translate the following to German for me...

The model completes these interactions well. We may run 1-10 of these completions before using chatgpt for the last mile message that actually gets sent to a user. It takes a while to wrap your head around using the chatgpt api for a non-chat completion.

Thank you for this!
The openai chat completion guide has good examples of this