mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 23:01:09 +03:00
Feature/Add teams, gmail, outlook tools (#4577)
* add teams, gmail, outlook tools * update docs link * update credentials for oauth2 * add jira tool * add google drive, google calendar, google sheets tools, powerpoint, excel, word doc loader * update jira logo * Refactor Gmail and Outlook tools to remove maxOutputLength parameter and enhance request handling. Update response formatting to include parameters in the output. Adjust Google Drive tools to simplify success messages by removing unnecessary parameter details.
This commit is contained in:
@@ -15,7 +15,7 @@ import { AnalyticHandler } from '../../../src/handler'
|
||||
import { DEFAULT_SUMMARIZER_TEMPLATE } from '../prompt'
|
||||
import { ILLMMessage } from '../Interface.Agentflow'
|
||||
import { Tool } from '@langchain/core/tools'
|
||||
import { ARTIFACTS_PREFIX, SOURCE_DOCUMENTS_PREFIX } from '../../../src/agents'
|
||||
import { ARTIFACTS_PREFIX, SOURCE_DOCUMENTS_PREFIX, TOOL_ARGS_PREFIX } from '../../../src/agents'
|
||||
import { flatten } from 'lodash'
|
||||
import zodToJsonSchema from 'zod-to-json-schema'
|
||||
import { getErrorMessage } from '../../../src/error'
|
||||
@@ -1429,6 +1429,17 @@ class Agent_Agentflow implements INode {
|
||||
}
|
||||
}
|
||||
|
||||
let toolInput
|
||||
if (typeof toolOutput === 'string' && toolOutput.includes(TOOL_ARGS_PREFIX)) {
|
||||
const [output, args] = toolOutput.split(TOOL_ARGS_PREFIX)
|
||||
toolOutput = output
|
||||
try {
|
||||
toolInput = JSON.parse(args)
|
||||
} catch (e) {
|
||||
console.error('Error parsing tool input from tool:', e)
|
||||
}
|
||||
}
|
||||
|
||||
// Add tool message to conversation
|
||||
messages.push({
|
||||
role: 'tool',
|
||||
@@ -1444,7 +1455,7 @@ class Agent_Agentflow implements INode {
|
||||
// Track used tools
|
||||
usedTools.push({
|
||||
tool: toolCall.name,
|
||||
toolInput: toolCall.args,
|
||||
toolInput: toolInput ?? toolCall.args,
|
||||
toolOutput
|
||||
})
|
||||
} catch (e) {
|
||||
@@ -1667,6 +1678,17 @@ class Agent_Agentflow implements INode {
|
||||
}
|
||||
}
|
||||
|
||||
let toolInput
|
||||
if (typeof toolOutput === 'string' && toolOutput.includes(TOOL_ARGS_PREFIX)) {
|
||||
const [output, args] = toolOutput.split(TOOL_ARGS_PREFIX)
|
||||
toolOutput = output
|
||||
try {
|
||||
toolInput = JSON.parse(args)
|
||||
} catch (e) {
|
||||
console.error('Error parsing tool input from tool:', e)
|
||||
}
|
||||
}
|
||||
|
||||
// Add tool message to conversation
|
||||
messages.push({
|
||||
role: 'tool',
|
||||
@@ -1682,7 +1704,7 @@ class Agent_Agentflow implements INode {
|
||||
// Track used tools
|
||||
usedTools.push({
|
||||
tool: toolCall.name,
|
||||
toolInput: toolCall.args,
|
||||
toolInput: toolInput ?? toolCall.args,
|
||||
toolOutput
|
||||
})
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user