refactor(addImages): use in functions agent response and assure generated images are included in the response (#1120)

This commit is contained in:
Danny Avila 2023-10-29 15:36:00 -04:00 committed by GitHub
parent 5c1e44eff7
commit af69763103
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 137 additions and 7 deletions

View file

@ -357,6 +357,7 @@ If your reverse proxy is compatible to OpenAI specs in every other way, it may s
const trimmedPartial = opts.getPartialText().replaceAll(':::plugin:::\n', '');
responseMessage.text =
trimmedPartial.length === 0 ? `${partialText}${this.result.output}` : partialText;
addImages(this.result.intermediateSteps, responseMessage);
await this.generateTextStream(this.result.output, opts.onProgress, { delay: 5 });
return await this.handleResponseMessage(responseMessage, saveOptions, user);
}