TheoKanning / openai-java

OpenAI Api Client in Java
MIT License
4.72k stars 1.18k forks source link

why chatGPT tell me there is a parameter named 'Conversation ID' can use , but not found in the documentation anywhere #144

Closed luoweiwei0908 closed 1 year ago

bladestone01 commented 1 year ago

Hi, What is the conclusion about this issue?

cryptoapebot commented 1 year ago

Best practice right now across OpenAI, Python APIs to it, and this project is to include a capped previous number of prompts and responses in the data structure:

List<ChatMessage> messages;

You can can also use a Guava EvictingQueue

EvictingQueue<ChatMessage> q = EvictingQueue.create(3);
....
q.add(response); // evicts the oldest response

Part of the reason OpenAI reduced the cost of ChatGPT3.5-turbo is for this very reason. Even though OpenAI's Web UI implementation does have a conversation_id, their API as far as I can see does not support it yet. Some have tried to start a conversation on the OpenAI forums about it.

conversation ID missing