Hi everyone,
I’m currently working on creating a custom GPT model, and I need some guidance on sending files to an external API endpoint. My goal is to have the GPT model send a file as multipart/form-data when a user attaches a file in a playground environment. Below, you can find the OpenAPI schema for the endpoint:
{
"openapi": "3.0.0",
"info": {
"title": "Receive API",
"description": "Some description",
"version": "1.0.0"
},
"servers": [
{
"url": "URL address"
}
],
"paths": {
"/v2": {
"post": {
"summary": "description",
"description": "xxxxxxxx",
"operationId": "V2",
"requestBody": {
"required": true,
"content": {
"multipart/form-data": {
"schema": {
"type": "object",
"properties": {
"file": {
"type": "string",
"format": "binary"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successful",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
}
}
}
}
},
"security": [
{
"bearerAuth": []
}
]
}
}
},
"components": {
"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT"
}
},
"schemas": {}
}
}
However, I’m encountering an issue where the file content is not included in the request body, and I consistently receive the following error message:
{
"response_data": {
"detail": [
{
"type": "missing",
"loc": [
"body",
"file"
],
"msg": "Field required",
"input": null,
"url": "https://errors.pydantic.dev/2.5/v/missing"
}
]
},
"status_code": 422,
"action_id": "g-bf3979cc51b8108aa720d1f18c3d9e4bc9b670aa"
}
I’m wondering if it’s possible to send a file from a GPT model to an external endpoint, and if so, should I modify the schema for this endpoint? Any advice or insights on how to achieve this would be greatly appreciated.
Thank you in advance for your help!