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

Defer saving new message until got response from openAI #504

Merged
merged 2 commits into from Apr 2, 2023

Conversation

189
Copy link
Contributor

@189 189 commented Mar 28, 2023

defer saving new message until got response from openAI. It only can be save together with openAI's response, both save or both not. That make database clean, be non-redundancy

See the issue

@189 189 changed the title fix: defer saving new message util got response from openAI Defer saving new message until got response from openAI Mar 28, 2023
@@ -287,7 +288,9 @@ export class ChatGPTAPI {
}
}
).then((message) => {
return this._upsertMessage(message).then(() => message)
return this._upsertMessage(latestQuestion).then(() =>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will change to upsert these in parallel

Copy link
Owner

@transitive-bullshit transitive-bullshit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great! thanks :)

@transitive-bullshit transitive-bullshit merged commit 9bb7da3 into transitive-bullshit:main Apr 2, 2023
1 of 2 checks passed
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