wip: extract chat response from QA node output

This commit is contained in:
Eugene Molodkin 2025-03-03 18:43:27 +01:00
parent 24681f843c
commit 6c482fb220
No known key found for this signature in database
2 changed files with 8 additions and 1 deletions

View file

@ -48,7 +48,11 @@ export const ChatPlugin: Plugin<ChatOptions> = {
options,
);
let textMessage = sendMessageResponse.output ?? sendMessageResponse.text ?? '';
let textMessage =
sendMessageResponse.output ??
sendMessageResponse.text ??
sendMessageResponse.response?.text ?? // For QA chains
'';
if (textMessage === '' && Object.keys(sendMessageResponse).length > 0) {
try {

View file

@ -15,4 +15,7 @@ export interface LoadPreviousSessionResponse {
export interface SendMessageResponse {
output?: string;
text?: string;
response?: {
text?: string;
};
}