Flowise icon indicating copy to clipboard operation
Flowise copied to clipboard

[BUG] syntaxerror: Unexpected token 'F', Failed is not valid JSON

Open simsherpa opened this issue 2 years ago • 3 comments

Describe the bug Thank you so much for this very inspired resource!

I am encountering the following error with the flow below:

SyntaxError: Unexpected token 'F', "Failed to "... is not valid JSON at JSON.parse () at parseJSONFromBytes (node:internal/deps/undici/undici:6613:19) at successSteps (node:internal/deps/undici/undici:6587:27) at node:internal/deps/undici/undici:1236:60 at node:internal/process/task_queues:140:7 at AsyncResource.runInAsyncScope (node:async_hooks:206:9) at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { attemptNumber: 7, retriesLeft: 0 }

To Reproduce Steps to reproduce the behavior:

  1. Copy Conversational Retrieval QA Chain flow from Marketplace
  2. Replace Text File component with PDF File component
  3. Replace OpenAI components with HuggingFace component
  4. Enter API Keys
  5. Save flow
  6. Select PDF
  7. Enter Prompt in Chat panel

Expected behavior A clear and concise description of what you expected to happen.

Expected the flow to execute allowing inspection of PDF file entries.

Screenshots If applicable, add screenshots to help explain your problem.

image

Flow If applicable, add exported flow in order to help replicating the problem. PDF-Explorer Chatflow.zip

Setup

  • Installation: npx flowise start
  • Flowise Version: 1.2.11
  • OS: macOS (Sonoma)
  • Browser: Arc/chrome

Additional context Add any other context about the problem here.

simsherpa avatar Jun 18 '23 02:06 simsherpa

hey @simsherpa do you face same problem when using ChatOpenAI and OpenAIEmbedding nodes?

HenryHengZJ avatar Jun 19 '23 18:06 HenryHengZJ

Hi @HenryHengZJ, thanks for the follow-up. I'm exploring strictly open source LLMs -- so I do not have an OpenAI account and therefore have not tried those OpenAI components. Any other suggestions?

simsherpa avatar Jun 19 '23 21:06 simsherpa

hey @simsherpa do you face same problem when using ChatOpenAI and OpenAIEmbedding nodes?

Hey, @HenryHengZJ, it was functioning properly when utilizing the ChatOpenAI and OpenAIEmbedding nodes. However, we are currently seeking an open-source language model like LLM-Falcon. Could you please investigate this matter?

trepont avatar Jul 04 '23 11:07 trepont

I have this same problem in two different flows. Both uing ChatOpenAi. The common characteristic is that it is a LLM Chain feeding an OutPut prediction into an Prompt Template, and the LLM Chain outputs predictions that contains "

Seems like the " character is not being escaped, and thus it is breaking the json.

image

image

raffareis avatar Jul 17 '23 22:07 raffareis

good news we have a PR addressing this issue - https://github.com/FlowiseAI/Flowise/pull/558

HenryHengZJ avatar Jul 17 '23 23:07 HenryHengZJ

Update: The former PR got closed, now on #612

raffareis avatar Jul 28 '23 17:07 raffareis