📤 refactor: Utilize intermediateReply when message.content is Empty

This commit is contained in:
Danny Avila 2024-02-19 11:03:42 -05:00 committed by GitHub
parent ee97179edb
commit d8038e3b19
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1097,6 +1097,14 @@ ${convo}
logger.debug('[OpenAIClient] chatCompletion response', chatCompletion);
if (!message?.content?.trim() && intermediateReply.length) {
logger.debug(
'[OpenAIClient] chatCompletion: using intermediateReply due to empty message.content',
{ intermediateReply },
);
return intermediateReply;
}
return message.content;
} catch (err) {
if (