-
Notifications
You must be signed in to change notification settings - Fork 74
MongoDB Responses API spec #771
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
Conversation
// Store in database using the same data model as our normal conversations. | ||
// Update the model to have a few additional fields: | ||
type ResponseConversation = Conversation & { | ||
store?: boolean; // true by default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i.e. "store the content of messages in the database"?
EDIT: I see later on that this is clarified
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, precisely. always store metadata. only store content if this true
// messages array. | ||
// For MongoDB, can do this by indexing messages.id and then doing an update like | ||
// db.collection.updateOne({ "messages.id": "SOME_VALUE"}, {$push: {messages: {role: "assistant", content: "new!"}}}) | ||
previous_response_id: "SOME_VALUE", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if I send two requests with the same previous_response_id
? ChatGPT supports threads for this but our conversations are single threaded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point. didn't think abt the edge case. in this case, lets return 400
to client.
Jira: n/a
Changes
Notes