Skip to content

Commit

Permalink
fix(editor): Fix chat crashing when rendering output-parsed content (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegIvaniv authored Oct 11, 2024
1 parent 1078fa6 commit 4aaebfd
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,12 @@ function extractResponseMessage(responseData?: IDataObject) {
if (!matchedPath) return JSON.stringify(responseData, null, 2);
return get(responseData, matchedPath) as string;
const matchedOutput = get(responseData, matchedPath);
if (typeof matchedOutput === 'object') {
return '```json\n' + JSON.stringify(matchedOutput, null, 2) + '\n```';
}
return matchedOutput?.toString() ?? '';
}
async function sendMessage(message: string, files?: File[]) {
Expand Down

0 comments on commit 4aaebfd

Please sign in to comment.