Skip to content

Conversation

sauravbaid3
Copy link

Issue: The issue was that the Flowise UI was adding HTML/markdown formatting to JSON input fields, but the stripHTMLFromToolInput function was not being applied consistently to all JSON parsing operations. This caused:
JSON Parse Failures: When tools tried to parse input that contained HTML formatting
Inconsistent Behavior: Some fields worked while others failed
User Confusion: Valid JSON inputs were being rejected due to hidden formatting

Fix: The stripHTMLFromToolInput function:
Removes HTML formatting using TurndownService
Cleans up escaped characters that might interfere with JSON parsing
Returns clean text that can be safely parsed as JSON

@HenryHengZJ
Copy link
Contributor

thanks for the PR, can you walk me through an example?

@dmitry-kndrashuk-tfs
Copy link

hey @HenryHengZJ this is actuallu happening
input values always got wrapped with html tags
image

flowise:dev:   { inputArgName: 'chatChannelId', inputArgValue: '<p>abc</p>' },
flowise:dev:   { inputArgName: 'teamId', inputArgValue: '<p>dfr</p>' },
flowise:dev:   { inputArgName: 'maxResults', inputArgValue: '<p>10</p>' }

i had to add filtering as well

@HenryHengZJ
Copy link
Contributor

hey @HenryHengZJ this is actuallu happening input values always got wrapped with html tags image

flowise:dev:   { inputArgName: 'chatChannelId', inputArgValue: '<p>abc</p>' },
flowise:dev:   { inputArgName: 'teamId', inputArgValue: '<p>dfr</p>' },
flowise:dev:   { inputArgName: 'maxResults', inputArgValue: '<p>10</p>' }

i had to add filtering as well

your screenshot is ToolNode right? but none of your changes is related to Tool.ts ? From my latest testing, they all seems to work fine

@PinkPong
Copy link

your screenshot is ToolNode right? but none of your changes is related to Tool.ts ? From my latest testing, they all seems to work fine

yep, correct
btw, i'm having hard time to make Agent to use "internal" tools
always have to create separate tool node and link it agent
also i've got an impression that "internal" tool doesn't respect it's parameters

@PinkPong
Copy link

agent will skip teams usage
image

and here not
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants