-
Notifications
You must be signed in to change notification settings - Fork 9
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
Chatgpt as realtime stream response ? #14
Comments
I am going to create a new project item to address your first point to support streaming. The second point. it is not clear but please open another issue for it with clarification as will assign this issue to streaming development. |
Well , i mean when i ask a question to chatgpt , it will initiate a session. Example : I entered first my error : Me: Chatgpt : Me: Chatgpt: To solve the issue on the JPA side, you can try the following steps: Verify the entity mappings: Ensure that the JPA entity associated with the table egitmen_dersler has the correct mapping for the foreign key relationship. Make sure that the @joincolumn or @jointable annotations are correctly specified, matching the foreign key constraint name FKsnhnfh73svhpbno5xa5sqb4l3. Check the cascade options: If there are cascading relationships defined in the entity mappings, review the cascade options to ensure they are appropriate for your use case. If necessary, adjust the cascade options to match your desired behavior when deleting or updating related entities. If i directly pass 2nd question to chatgpt as webservice , it doesnt know which issue i have. So we need something like session or chat initialization. |
Openai backend does not support the session id, but you can send the messages history as part of the call. This way the model will be aware of the ongoing conversation. Example: This is the way to initiate the first conversaion: Chatbot bot = new Chatbot(openaiKey, SupportedChatModels.openai);
String mode = "You are a helpful astronomy assistant.";
ChatModelInput input = new ChatGPTInput.Builder(mode).addUserMessage("what is the space between moon and earth").build();
// the model responses
List<String> resValues = bot.chat(input); You can add the model response to the history, then add your new message: input.addMessage(new ChatGPTMessage("<replace with the model response>", "assistant"))
input.addUserMessage("<replace with your new message>") Now when you send the input to the chatbot, it will be aware of the conversation history: List<String> resValues = bot.chat(input); |
you can checkout this library: |
Hi , how can i get ChatGPT realtime response like on openai website.
This api awaits for response so much long time.
And how can i get current session id of webrequest ?
I mean i ask many questions on 1 session.
The text was updated successfully, but these errors were encountered: