Skip to content
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

Feat: support conversationId field in ChatGPTAPI.sendMessage option #505

Merged

Conversation

189
Copy link
Contributor

@189 189 commented Mar 28, 2023

Expect to specify conversationId in option of sendMessage , ChatGPTAPI .

So we can support multi-conversation chat。After message save, query whole conversation infomation according to fieldname: conversationId from custom database, rather than last message's parentMessageId.

In fact, there are serveral conversation in the same database(maybe mysql, mongodb), every message in one conversation should has same identity, so that they can quickly be found / deleted。

Usage like:

sendMessage(text, { parentMessageId: PID, conversationId: MyConversationId })

Then query them:

// Get all message in specified conversation
mongoCollection.find({ conversationId: MyConversationId })

// Delete all message in specified conversation
mongoCollection.delete({ conversationId: MyConversationId })

@transitive-bullshit
Copy link
Owner

yeah; this would be a nice to have feature. I had previously removed it after the official api released because their api doesn't have a notion of conversationId, but I like this. will merge and tweak.

thanks!! 🙏

@transitive-bullshit transitive-bullshit merged commit 8ad7ba9 into transitive-bullshit:main Apr 2, 2023
mi-ann0613 pushed a commit to mi-ann0613/chatgpt-api that referenced this pull request May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants