#What is the API call that ChatGPT uses? I'm having trouble replicating its results in the API
26 messages · Page 1 of 1 (latest)
GPT-4's system message is as follows: "role": "system", "content": "You are ChatGPT, a large language model trained by OpenAI, based on the GPT-4 architecture. Knowledge cutoff: 2021-09. Current date: <call current date here>
Is that all? I still can't make my calls to the GPT3.5turbo API get similar results to ChatGPT web UI
Show me your call
result = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=[
{"role": "system", "content": "You are ChatGPT, a large language model trained by OpenAI, based on the GPT-3.5 architecture. Knowledge cutoff: 2021-09. Current date: 2023-05-21."},
{"role": "user", "content": FINAL_PROMPT},
]
)
where FINAL_PROMPT is the same thing I send in the web UI
So you aren't using any options specified in the api docs
I thought they defaulted to reasonable values
You mean like temperature?
Try setting temperature to 0.7
I don't rightly know what the "default" is but 0.7 is the favored value.
What variation between the API and ChatGPT are you referring to?
Ah ok, I think the API defaults to 1.0
I'll try it now
It's not 1. 1 is too high.
In particular I'm having the API do some progressive summarization, and the web UI is much better at keeping details whereas the API calls are unnecessarily terse and removing information
Yeah! I'm reading it now the API defaults to 1 but ChatGPT defaults to 0.7
And you're properly passing the context of the previous messages?
The API doesn't remember conversations so unless you're feeding prior messages to it in each call, it treats everything as if it's a totally new discussion.
Yes I think so. Well, in both web and API I start a new completion for each new summarization. All the information is in the prompt.
Right but what I mean is, if you're sending it multiple messages as in a normal "chat" you must feed all the prior messages in your promots. Are you doing that?
If you ask it a question and then ask it a second question that needs the context of the first, without adding both of those to the new prompt the model will behave erratically.
No for each completion I just send the one message, it looks like this:
User
Progressively summarize the relationship of the two characters based on the conversations provided, adding or modifying the previous summary returning a new summary. [and other stuff]
EXAMPLE
Current summary:
The human asks what the AI thinks of artificial intelligence. The AI thinks artificial intelligence is a force for good.
Next of conversation:
Human: Why do you think artificial intelligence is a force for good?
AI: Because artificial intelligence will help humans reach their full potential.
New summary:
The human has been chatting with an AI. The human is curious about the AI's views of artificial intelligence. The AI seems to feel positively about artificial intelligence and feels it will help humans achieve more. The AI tends to answer directly to the point.
END OF EXAMPLE
Current summary:
I have been chatting with my friend.
Next conversation:
A: Hi friend!
B: Hello!
New summary:
And I update the current summary and next conversation sections for each call
Anyway I think it's working, with the 0.7 temperature! Thank you!