ChatGPT Actions - Get Files uploaded by user

I am creating MyGPT bot using ChatGPT Actions. In my use case I want to get file uploaded by user and want to process it. So, I have followed below documentation given by OpenAI -
https://platform.openai.com/docs/actions/getting-started/sending-files

But I am getting blank array under “openaiFileIdRefs”. PFA screenshots of request body.


Below is the ChatGPT Action Schema -

{
    "openapi": "3.1.0",
    "info": {
        "title": "Chatbot",
        "description": "An action that allows the user integrate with Custom Chatbot API.",
        "version": "v1.0.0"
    },
    "servers": [
        {
            "url": "https://c08f-103-238-108-221.ngrok-free.app/customGPT"
        }
    ],
    "paths": {
        "/webhook": {
            "post": {
                "description": "Allows the user to converse with a Custom Chatbot API.",
                "summary": "Respond to user's message/query or user uploaded file.",
                "operationId": "processUserQuery",
                "x-openai-isConsequential": false,
                "parameters": [],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/processUserQueryRequest"
                            }
                        }
                    },
                    "required": true
                },
                "deprecated": false,
                "security": [
                    {
                        "apiKey": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Expected response to a valid request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/processUserQueryResponse"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "processUserQueryRequest": {
                "properties": {
                    "userQuery": {
                        "type": "string",
                        "title": "User Query",
                        "description": "The User's message/query to chatbot"
                    },
                    "openaiFileIdRefs": {
                        "type": "array",
                        "title": "Files Array",
                        "description": "Uploads a file reference using its file id. File should be an image or PDF uploaded by the user. JPG, WEBP, PNG and PDF are supported.",
                        "items": {
                            "type": "object",
                            "properties": {
                                "name": {
                                    "type": "string",
                                    "title": "File Name",
                                    "description": "The name of the file."
                                },
                                "id": {
                                    "type": "string",
                                    "title": "File ID",
                                    "description": "A stable identifier for the file."
                                },
                                "mime_type": {
                                    "type": "string",
                                    "title": "Mime Type of file",
                                    "description": "The mime type of the file. For user uploaded files this is based on file extension."
                                },
                                "download_link": {
                                    "type": "string",
                                    "title": "File's     Download Link",
                                    "description": "The URL to fetch the file."
                                }
                            }
                        }
                    }
                },
                "type": "object",
                "required": [
                    "userQuery"
                ],
                "title": "Request body of processUserQuery Action"
            },
            "processUserQueryResponse": {
                "type": "object",
                "required": [
                    "displayMessage"
                ],
                "properties": {
                    "displayMessage": {
                        "type": "string",
                        "title": "Display Message",
                        "description": "The message to be displayed to the User."
                    }
                }
            }
        }
    }
}

I have also tried this exact schema which is given as example in ChatGPT Actions -

 /createWidget:
    post:
      operationId: createWidget
      summary: Creates a widget based on an image.
      description: Uploads a file reference using its file id. This file should be an image created by DALL·E or uploaded by the user. JPG, WEBP, and PNG are supported for widget creation.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                openaiFileIdRefs:
                  type: array
                  items:
                    type: string

But still not working. Can anybody help me to resolve this issue?

1 Like

Same here! Looking forward to a solution. BTW: Found this in the documentation:

https://platform.openai.com/docs/actions/sending-files

Having similar issue. Please leave a reply if you found any solution.