VoiceflowVVoiceflow
Powered by
static-pinkS
Voiceflow•2y ago•
3 replies
static-pink

Where's the bug - RestSharp or Voiceflow?

I have a client with a large document library and part of our requirement is uploading PDFs to the VF KB.

I have used the VF C# sample code here https://developer.voiceflow.com/reference/post_v3alpha-knowledge-base-docs-upload

Using this code I always receive a 400 Bad Request when uploading PDFs, however text files upload OK.

If the encoding of the PDF attachment is forced to text/plain then PDFs will upload but are not parsed correctly by the VF API with thousands of encoded characters, a 3 chunk file becomes a 1000 chunk file.

I contacted VF support, here is their response:

I got my colleague to review your code, and he said this issue may arise because you are manually passing a FormBoundary, while RestSharp usually handles multipart boundaries automatically.
Additionally, because the .txt file upload is currently functional, this does not appear to be a bug, and is thus outside of the scope of Support.

'My code' is actually 'their code'. I have tried with and without manually added form boundaries and the problem remains, also if it works for text and not PDFs then I can't see how form boundaries can be the issue.

So my questions is: Can anybody get the Voiceflow RestSharp sample code to upload correctly encoded PDFs to the KB from outside the VF network?

It should be noted:
* Uploading using the VF website works OK.
* Uploads work OK when I use the native HTTP client.
* Uploading using RestSharp (as recommended by the documentation) from outside the VF network has the issue.
Voiceflow banner
VoiceflowJoin
Voiceflow is your community to get help, stay up to date on product releases, and connect with builders, experts, and the Voiceflow team⚡
13,087Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?
Recent Announcements
jacklyn

# Let your agents search the web 🔎 Hey everyone! We just released the web search tool for the agent step! Your agents can now automatically search the web for information, letting your agent supplement the LLM's knowledge and the data in its knowledge base with live, up-to-date information. Plus.... * You can restrict searches to specific domains, so your agent only searches sites that you own * This is a tool, so you remain in control of when the agent searches the web * Results are automatically summarized in a way that your agent can automatically understand Under the hood, we're using OpenAI's web search API. Give it a try, and let us know what you think! https://docs.voiceflow.com/changelog/native-web-search-tool

jacklyn · 3mo ago

jacklyn

jacklynbiggin's Thread

jacklyn · 3mo ago

hurt-tomato

connor_maclean's Thread

hurt-tomato · 3mo ago

Similar Threads

For The Voiceflow team
primary-violetPprimary-violet / ❓┃help
8mo ago
Voiceflow's font not working outside
spotty-amberSspotty-amber / ❓┃help
11mo ago
Connecting voiceflow with Openai's CustomGPT
ordinary-sapphireOordinary-sapphire / ❓┃help
2y ago
Voiceflow down ?
sacred-emeraldSsacred-emerald / ❓┃help
2w ago