Connect to API using Web and error 1110

I am using AI-Companion, the Do-It result is the same as above
Original JSON parsed to JSONLint:
{
"active_docs": "9YziSqpbHVha3Lkao23uvSXR2On1/document/ UEL-IS","conversation_id": "65783f4c0218916ddd553ca9","history": "[{"prompt":""}]"," question": "bye","user": "9YziSq pbHVha3Lkao23uvSXR2On1 ","user_type": "premium"
}


JSON Lint result
Also the square brackets are there, please check again

When I pressed Do-It, the same


appeared in the app

RIght, I forgot Local in the the field for active_docs, run again, still nothing

All that happens when I pressed Do It block is just retriggering the function without anymore helpful text

{
"active_docs": "9YziSqpbHVha3Lkao23uvSXR2On1/document/ UEL-IS","conversation_id": "65783f4c0218916ddd553ca9","history": "[{"prompt":""}]"," question": "bye","user": "9YziSq pbHVha3Lkao23uvSXR2On1 ","user_type": "premium"
}

Questions:

  1. there is a space before UEL-IS?
  2. there is a space in the question tag?

Post again your latest screenshot of the blocks

Taifun

The space is due to text wrapping when displaying the error I guess.



Used an emu
The first D is printed out with button pressed
The second D is with Do-It

Ok, you now corrected the space in the question tag

Please show us

  1. your latest relevant blocks including Do it result of the JSON string and not some other print_stuff thing. We would like to see it as it is

  1. the latest error message

Taifun

ah, so right click the dictionary, I used value "1+1" for question
image
{"active_docs":"local/9YziSqpbHVha3Lkao23uvSXR2On1/document/UEL-IS","conversation_id":"65783f4c0218916ddd553ca9","history":"[{"prompt":""}]","project":"document","question":"1+1","user":"9YziSqpbHVha3Lkao23uvSXR2On1","user_type":"premium"}


JSON lint return it as valid

do it for the request headers list:
image
Error message:
image

The issue might be the history tag... the value is an array and that array should not have double quotes around

Current:
"history":"[{"prompt":""}]"

Correct should be:

"history":[{"prompt":""}]

Taifun

I have it working here!

Sometime in the past we had a similar problem, even though it requires a POST request, it also needs a user agent (thinking you are using a browser!)

These are draggable blocks

1 Like

Nice,
So you changed the headers from list to dictionary too

Do It Result: {"content-type":"application/json","User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 OPR/99.0.0.0"}

Maybe internet connection speed really does affect the process cause it still not work for me

Said that because some firebase code for another project I have keep returning cannot connect to backend on my end but can run on other with the exact same setup and keys.

Thanks, regardless.

Remember at some point to change your API key :wink:

Of course
Security and all that :slight_smile: