Hello,
I’m trying to make a custom GPT that calls a third parti API (Our Own Server), and sends it a document in a post request, to extract certain information which then I would tell GPT to process in a certain way.
I defined the API call as an action and explained how to fill the parameters and that it should send the file as a multipart/form-data but it fails. sometimes I see the request in the server logs but returns error 422.
The endpoint itself works fine, I’ve tested it with cURL Postman and swagger editor.
I’ve tried many times but it just doesn’t work and GPT doesn’t help much on why it is failing.
The action configuration:
openapi: "3.0.0"
info:
title: Send a Document and a process it
description: Sends a document to the server and process it
version: 1.0.0
servers:
- url: <server>
paths:
/endpoint:
post:
description: Send a document and process it
operationId: SendDocument
parameters: []
requestBody:
description: document to be uploaded
required: true
content:
multipart/form-data:
schema:
type: object
properties:
customer:
type: string
process:
type: string
file:
type: string
format: binary
responses:
'201':
description: Null response
default:
description: unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
components:
headers:
content-disposition:
description: the content-disposition header
schema:
type: string
required: true
schemas:
Error:
type: object
required:
- code
- message
properties:
code:
type: integer
format: int32
message:
type: string