Hi Team,
I appreciate any help on this.
I am actually building a GPT action and trying to call my external API and need to post a .zip file to my API.
This is how I have constructed my GPT schema -
{
"openapi": "3.1.0",
"info": {
"title": "***",
"description": "***",
"version": "v1.0.0"
},
"servers": [
{
"url": "***"
}
],
"paths": {
"/fileUpload": {
"post": {
"description": "****",
"operationId": "UploadFile",
"requestBody": {
"content": {
"multipart/form-data": {
"schema": {
"type": "object",
"properties": {
"fileSource": {
"type": "string",
"format": "binary"
},
"name": {
"type": "string"
}
},
"required": ["fileSource", "name"]
}
}
},
"required": true
},
"responses": {
"200": {
"description": "File uploaded successfully"
},
"400": {
"description": "Error in file upload"
}
}
}
}
},
"components": {
"schemas": {}
}
}
Can someone please suggest how can make it work. I have working code built in PowerShell and that has below lines of code and that could be the reason why it is not working but the problem is not sure how to pass these values from GPT action schema -
"Content-Disposition: form-data; name=`"fileSource`"; filename=`"$projectName.zip`"",
"Content-Type: application/x-zip-compressed$LF",
Thank you for your response.
I’m uncertain about how to build this plugin. Is there comprehensive documentation available on file uploads supported by the GPT action? I can make the necessary changes to my API if required but at least I can find something on what is supported.
This is how I am receiving posted file at API side
[HttpPost]
public async Task PostFile([FromForm] RequestModel requestModel)
{
return Ok(await _service.Scan(requestModel));
}
Thanks
Custom GPT implementations provided by OpenAI do not have the capability to directly send files, such as a .zip
file, as part of their API interactions. Custom GPT models, like other GPT-3 based models, primarily deal with text input and output. They do not natively support binary data handling, which is required for file operations like sending a .zip
file.
If your goal is to integrate file sending capabilities (like a .zip
file upload) with a GPT-based system, you would typically need to handle this separately from the GPT model. This usually involves:
- Client-Side Handling: Your application’s client side (which could be a web or desktop application) would handle the file selection and uploading part.
- Server-Side Processing: The server, which could be a separate API or service, would receive the file, process it as needed, and possibly interact with the GPT model for any text-based processing.
- GPT Model Interaction: If needed, the server can interact with the GPT model to generate or process text, which can be based on the contents or metadata of the uploaded file. This would require custom logic to extract text from the file and then feed it to the GPT model.
For instance, if you have a server endpoint to handle file uploads, you would upload the file to this endpoint first. After processing the file as needed (like extracting text or relevant data), you can then send any necessary text to the GPT model for further processing or generation tasks.
Remember, GPT’s capabilities are primarily around text generation and processing, so any non-textual data needs to be handled outside of the GPT model and then possibly converted to a text format that the model can understand.
3 Likes
Thanks for your input Paul. I will do some more research and take it from there.
Hello, regarding the issue of uploading files to a third-party API, have you come to a conclusion?
@PaulBellow , I think ChatGPT has introduced file upload option for search. I am wondering if this file upload capability is available for API based ChatGPT action as well where I need to allow user to upload a zip file for scanning??