mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 19:00:59 +03:00
Bugfix/Gsuite tool params (#5189)
* fix gsuite tool params * custom assistant only check for mandatory fields for visible params * azure chat openai fix for gpt5 * return raw from executeJavaScriptCode * add json5 for parsing * azure chatopenai use maxCompletionTokens
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { z } from 'zod'
|
||||
import fetch from 'node-fetch'
|
||||
import { DynamicStructuredTool } from '../OpenAPIToolkit/core'
|
||||
import { TOOL_ARGS_PREFIX } from '../../../src/agents'
|
||||
import { TOOL_ARGS_PREFIX, formatToolError } from '../../../src/agents'
|
||||
|
||||
export const desc = `Use this when you want to access Google Docs API for managing documents`
|
||||
|
||||
@@ -256,7 +256,7 @@ class CreateDocumentTool extends BaseGoogleDocsTool {
|
||||
|
||||
return createResponse
|
||||
} catch (error) {
|
||||
return `Error creating document: ${error}`
|
||||
return formatToolError(`Error creating document: ${error}`, params)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -288,7 +288,7 @@ class GetDocumentTool extends BaseGoogleDocsTool {
|
||||
const response = await this.makeGoogleDocsRequest({ endpoint, params })
|
||||
return response
|
||||
} catch (error) {
|
||||
return `Error getting document: ${error}`
|
||||
return formatToolError(`Error getting document: ${error}`, params)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -381,7 +381,7 @@ class UpdateDocumentTool extends BaseGoogleDocsTool {
|
||||
return `No updates specified` + TOOL_ARGS_PREFIX + JSON.stringify(params)
|
||||
}
|
||||
} catch (error) {
|
||||
return `Error updating document: ${error}`
|
||||
return formatToolError(`Error updating document: ${error}`, params)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -429,7 +429,7 @@ class InsertTextTool extends BaseGoogleDocsTool {
|
||||
})
|
||||
return response
|
||||
} catch (error) {
|
||||
return `Error inserting text: ${error}`
|
||||
return formatToolError(`Error inserting text: ${error}`, params)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -478,7 +478,7 @@ class ReplaceTextTool extends BaseGoogleDocsTool {
|
||||
})
|
||||
return response
|
||||
} catch (error) {
|
||||
return `Error replacing text: ${error}`
|
||||
return formatToolError(`Error replacing text: ${error}`, params)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -534,7 +534,7 @@ class AppendTextTool extends BaseGoogleDocsTool {
|
||||
})
|
||||
return response
|
||||
} catch (error) {
|
||||
return `Error appending text: ${error}`
|
||||
return formatToolError(`Error appending text: ${error}`, params)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -583,7 +583,7 @@ class GetTextContentTool extends BaseGoogleDocsTool {
|
||||
|
||||
return JSON.stringify({ textContent }) + TOOL_ARGS_PREFIX + JSON.stringify(params)
|
||||
} catch (error) {
|
||||
return `Error getting text content: ${error}`
|
||||
return formatToolError(`Error getting text content: ${error}`, params)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -631,7 +631,7 @@ class InsertImageTool extends BaseGoogleDocsTool {
|
||||
})
|
||||
return response
|
||||
} catch (error) {
|
||||
return `Error inserting image: ${error}`
|
||||
return formatToolError(`Error inserting image: ${error}`, params)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -680,7 +680,7 @@ class CreateTableTool extends BaseGoogleDocsTool {
|
||||
})
|
||||
return response
|
||||
} catch (error) {
|
||||
return `Error creating table: ${error}`
|
||||
return formatToolError(`Error creating table: ${error}`, params)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user