kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
fix: defer saving new message util got response from openAI
rodzic
9932fca55c
commit
44a4a9121e
|
@ -156,7 +156,8 @@ export class ChatGPTAPI {
|
|||
parentMessageId,
|
||||
text
|
||||
}
|
||||
await this._upsertMessage(message)
|
||||
|
||||
const latestQuestion = message
|
||||
|
||||
const { messages, maxTokens, numTokens } = await this._buildMessages(
|
||||
text,
|
||||
|
@ -287,7 +288,9 @@ export class ChatGPTAPI {
|
|||
}
|
||||
}
|
||||
).then((message) => {
|
||||
return this._upsertMessage(message).then(() => message)
|
||||
return this._upsertMessage(latestQuestion).then(() =>
|
||||
this._upsertMessage(message).then(() => message)
|
||||
)
|
||||
})
|
||||
|
||||
if (timeoutMs) {
|
||||
|
|
Ładowanie…
Reference in New Issue