mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 19:00:59 +03:00
Bugfix/Anthropic messages in agentflow (#3801)
fix anthropic messages in agentflow
This commit is contained in:
@@ -1001,6 +1001,21 @@ export const removeInvalidImageMarkdown = (output: string): string => {
|
||||
return typeof output === 'string' ? output.replace(/!\[.*?\]\((?!https?:\/\/).*?\)/g, '') : output
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract output from array
|
||||
* @param {any} output
|
||||
* @returns {string}
|
||||
*/
|
||||
export const extractOutputFromArray = (output: any): string => {
|
||||
if (Array.isArray(output)) {
|
||||
return output.map((o) => o.text).join('\n')
|
||||
} else if (typeof output === 'object') {
|
||||
if (output.text) return output.text
|
||||
else return JSON.stringify(output)
|
||||
}
|
||||
return output
|
||||
}
|
||||
|
||||
/**
|
||||
* Loop through the object and replace the key with the value
|
||||
* @param {any} obj
|
||||
|
||||
Reference in New Issue
Block a user