You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m trying to set up an integration where LibreChat can send a Markdown file to an API endpoint (Stirling PDF) for conversion to PDF, and then return the PDF to the user. The endpoint (and my desired workflow) relies on a multipart/form-data POST request with a file upload (not just string content).
My use case:
User: Uploads a Markdown file in LibreChat and requests a PDF conversion.
LibreChat: Sends the Markdown file (using a plugin/tool/action) to POST /api/v1/convert/markdown/pdf (Stirling PDF API), with the Markdown file as a multipart form upload field called fileInput.
Response: LibreChat receives the PDF from the endpoint and returns it to the user.
What I’ve tried:
I created an OpenAPI 3.0 spec with the correct properties (type: string, format: binary) for the file field, matched to OpenAPI file upload guidelines.
The endpoint works perfectly with curl, Swagger UI, and Postman (when using the file upload field and sending proper multipart form data).
However, LibreChat’s plugin/tool interface only provides a text box for the file field instead of a file upload control, resulting in a 400 error from the API because it receives a string instead of a real file.
The backend error from the API is:
Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.web.multipart.MultipartFile' for property 'fileInput'
This makes me believe LibreChat does not yet support file uploads through plugins/tools, even when the OpenAPI spec defines the input as a format: binary string.
My question / request:
Does LibreChat currently support plugins/tools with file upload fields (multipart form), defined as type: string, format: binary in the OpenAPI spec?
If this is not supported yet, are there workarounds, or is support planned?
If it is supported, are there any additional configurations or syntax I need to enable file upload fields in the UI and correct POST requests in backend actions?
Would you be able to point to an example of a working file-upload plugin/action/tool for reference?
Thanks for your help!
(If a feature request is appropriate, please let me know and I’ll file one.)
Action definition
openapi: 3.0.0
info:
title: Markdown to PDF
version: 1.0.0
servers:
- url: http://stirling-pdf:8080
paths:
/api/v1/convert/markdown/pdf:
post:
summary: Converts a Markdown file (uploaded as fileInput) to PDF
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
fileInput:
type: string
format: binary
description: The Markdown file to upload and convert
required:
- fileInput
responses:
'200':
description: Returns the resulting PDF
content:
application/pdf:
schema:
type: string
format: binary
```
**References:**
- [OpenAPI 3 — File Uploads](https://swagger.io/docs/specification/describing-request-body/file-upload/)
- [Stirling PDF API docs](https://github.com/Stirling-Tools/Stirling-PDF)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello LibreChat team,
I’m trying to set up an integration where LibreChat can send a Markdown file to an API endpoint (Stirling PDF) for conversion to PDF, and then return the PDF to the user. The endpoint (and my desired workflow) relies on a
multipart/form-dataPOST request with a file upload (not just string content).My use case:
POST /api/v1/convert/markdown/pdf(Stirling PDF API), with the Markdown file as a multipart form upload field calledfileInput.What I’ve tried:
type: string,format: binary) for the file field, matched to OpenAPI file upload guidelines.curl, Swagger UI, and Postman (when using the file upload field and sending proper multipart form data).format: binarystring.My question / request:
Does LibreChat currently support plugins/tools with file upload fields (multipart form), defined as
type: string,format: binaryin the OpenAPI spec?Thanks for your help!
(If a feature request is appropriate, please let me know and I’ll file one.)
Action definition
Beta Was this translation helpful? Give feedback.
All reactions