UnrecognizedFunctionError with Github API in a GPT Action

So I totally get that this is all still very fresh and likely rushed into production.

I am getting an UnrecognizedFunctionError accessing an Action configured to fetch and put data into Github. I got the schema from Github and have not altered it. I have an auth token that works in curl to make these same calls.

This just seems like maybe it is not-ready-for-primetime? It would really help to have better debugging tooling for this aspect of GPTs.

Posting here in the hopes that someone can spot something I have looked. Thanks in advance if you can!

I have the Schema here, if it helps!:

{
  "openapi": "3.0.3",
  "info": {
    "version": "1.1.4",
    "title": "GitHub v3 REST API",
    "description": "GitHub's v3 REST API.",
    "license": {
      "name": "MIT",
      "url": "https://spdx.org/licenses/MIT"
    },
    "termsOfService": "https://docs.github.com/articles/github-terms-of-service",
    "contact": {
      "name": "Support",
      "url": "https://support.github.com/contact?tags=dotcom-rest-api"
    },
    "x-github-plan": "api.github.com"
  },
  "tags": [
    {
      "name": "repos",
      "description": "Interact with GitHub Repos."
    }
  ],
  "servers": [
    {
      "url": "https://api.github.com"
    }
  ],
  "externalDocs": {
    "description": "GitHub v3 REST API",
    "url": "https://docs.github.com/rest/"
  },
  "paths": {
    "/repos/{owner}/{repo}/contents/{path}": {
      "get": {
        "summary": "Get repository content",
        "description": "Gets the contents of a file or directory in a repository. Specify the file path or directory in `:path`. If you omit\n`:path`, you will receive the contents of the repository's root directory. See the description below regarding what the API response includes for directories. \n\nFiles and symlinks support [a custom media type](https://docs.github.com/rest/overview/media-types) for\nretrieving the raw content or rendered HTML (when supported). All content types support [a custom media\ntype](https://docs.github.com/rest/overview/media-types) to ensure the content is returned in a consistent\nobject format.\n\n**Notes**:\n*   To get a repository's contents recursively, you can [recursively get the tree](https://docs.github.com/rest/git/trees#get-a-tree).\n*   This API has an upper limit of 1,000 files for a directory. If you need to retrieve more files, use the [Git Trees\nAPI](https://docs.github.com/rest/git/trees#get-a-tree).\n *  Download URLs expire and are meant to be used just once. To ensure the download URL does not expire, please use the contents API to obtain a fresh download URL for each download.\n Size limits:\nIf the requested file's size is:\n* 1 MB or smaller: All features of this endpoint are supported.\n* Between 1-100 MB: Only the `raw` or `object` [custom media types](https://docs.github.com/rest/repos/contents#custom-media-types-for-repository-contents) are supported. Both will work as normal, except that when using the `object` media type, the `content` field will be an empty string and the `encoding` field will be `\"none\"`. To get the contents of these larger files, use the `raw` media type.\n * Greater than 100 MB: This endpoint is not supported.\n\n If the content is a directory:\nThe response will be an array of objects, one object for each item in the directory.\nWhen listing the contents of a directory, submodules have their \"type\" specified as \"file\". Logically, the value\n_should_ be \"submodule\". This behavior exists in API v3 [for backwards compatibility purposes](https://git.io/v1YCW).\nIn the next major version of the API, the type will be returned as \"submodule\".\n\n If the content is a symlink: \nIf the requested `:path` points to a symlink, and the symlink's target is a normal file in the repository, then the\nAPI responds with the content of the file (in the format shown in the example. Otherwise, the API responds with an object \ndescribing the symlink itself.\n\n If the content is a submodule:\nThe `submodule_git_url` identifies the location of the submodule repository, and the `sha` identifies a specific\ncommit within the submodule repository. Git uses the given URL when cloning the submodule repository, and checks out\nthe submodule at that specific commit.\n\nIf the submodule repository is not hosted on github.com, the Git URLs (`git_url` and `_links[\"git\"]`) and the\ngithub.com URLs (`html_url` and `_links[\"html\"]`) will have null values.",
        "tags": ["repos"],
        "operationId": "repos/get-content",
        "externalDocs": {
          "description": "API method documentation",
          "url": "https://docs.github.com/rest/repos/contents#get-repository-content"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/owner"
          },
          {
            "$ref": "#/components/parameters/repo"
          },
          {
            "name": "path",
            "description": "path parameter",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "x-multi-segment": true
          },
          {
            "name": "ref",
            "description": "The name of the commit/branch/tag. Default: the repository’s default branch.",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/vnd.github.object": {
                "schema": {
                  "$ref": "#/components/schemas/content-tree"
                },
                "examples": {
                  "response-if-content-is-a-file": {
                    "$ref": "#/components/examples/content-file-response-if-content-is-a-file"
                  },
                  "response-if-content-is-a-directory": {
                    "$ref": "#/components/examples/content-file-response-if-content-is-a-directory-object"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/content-directory"
                    },
                    {
                      "$ref": "#/components/schemas/content-file"
                    },
                    {
                      "$ref": "#/components/schemas/content-symlink"
                    },
                    {
                      "$ref": "#/components/schemas/content-submodule"
                    }
                  ]
                },
                "examples": {
                  "response-if-content-is-a-file": {
                    "$ref": "#/components/examples/content-file-response-if-content-is-a-file"
                  },
                  "response-if-content-is-a-directory": {
                    "$ref": "#/components/examples/content-file-response-if-content-is-a-directory"
                  },
                  "response-if-content-is-a-symlink": {
                    "$ref": "#/components/examples/content-file-response-if-content-is-a-symlink"
                  },
                  "response-if-content-is-a-submodule": {
                    "$ref": "#/components/examples/content-file-response-if-content-is-a-submodule"
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/not_found"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "302": {
            "$ref": "#/components/responses/found"
          }
        },
        "x-github": {
          "githubCloudOnly": false,
          "enabledForGitHubApps": true,
          "category": "repos",
          "subcategory": "contents"
        }
      },
      "put": {
        "summary": "Create or update file contents",
        "description": "Creates a new file or replaces an existing file in a repository. You must authenticate using an access token with the `repo` scope to use this endpoint. If you want to modify files in the `.github/workflows` directory, you must authenticate using an access token with the `workflow` scope.\n\n**Note:** If you use this endpoint and the \"[Delete a file](https://docs.github.com/rest/repos/contents/#delete-a-file)\" endpoint in parallel, the concurrent requests will conflict and you will receive errors. You must use these endpoints serially instead.",
        "tags": ["repos"],
        "operationId": "repos/create-or-update-file-contents",
        "externalDocs": {
          "description": "API method documentation",
          "url": "https://docs.github.com/rest/repos/contents#create-or-update-file-contents"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/owner"
          },
          {
            "$ref": "#/components/parameters/repo"
          },
          {
            "name": "path",
            "description": "path parameter",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "x-multi-segment": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "message": {
                    "type": "string",
                    "description": "The commit message."
                  },
                  "content": {
                    "type": "string",
                    "description": "The new file content, using Base64 encoding."
                  },
                  "sha": {
                    "type": "string",
                    "description": "**Required if you are updating a file**. The blob SHA of the file being replaced."
                  },
                  "branch": {
                    "type": "string",
                    "description": "The branch name. Default: the repository’s default branch."
                  },
                  "committer": {
                    "type": "object",
                    "description": "The person that committed the file. Default: the authenticated user.",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "The name of the author or committer of the commit. You'll receive a `422` status code if `name` is omitted."
                      },
                      "email": {
                        "type": "string",
                        "description": "The email of the author or committer of the commit. You'll receive a `422` status code if `email` is omitted."
                      },
                      "date": {
                        "type": "string",
                        "example": "\"2013-01-05T13:13:22+05:00\""
                      }
                    },
                    "required": ["name", "email"]
                  },
                  "author": {
                    "type": "object",
                    "description": "The author of the file. Default: The `committer` or the authenticated user if you omit `committer`.",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "The name of the author or committer of the commit. You'll receive a `422` status code if `name` is omitted."
                      },
                      "email": {
                        "type": "string",
                        "description": "The email of the author or committer of the commit. You'll receive a `422` status code if `email` is omitted."
                      },
                      "date": {
                        "type": "string",
                        "example": "\"2013-01-15T17:13:22+05:00\""
                      }
                    },
                    "required": ["name", "email"]
                  }
                },
                "required": ["message", "content"]
              },
              "examples": {
                "example-for-creating-a-file": {
                  "summary": "Example for creating a file",
                  "value": {
                    "message": "my commit message",
                    "committer": {
                      "name": "Monalisa Octocat",
                      "email": "octocat@github.com"
                    },
                    "content": "bXkgbmV3IGZpbGUgY29udGVudHM="
                  }
                },
                "example-for-updating-a-file": {
                  "summary": "Example for updating a file",
                  "value": {
                    "message": "a new commit message",
                    "committer": {
                      "name": "Monalisa Octocat",
                      "email": "octocat@github.com"
                    },
                    "content": "bXkgdXBkYXRlZCBmaWxlIGNvbnRlbnRz",
                    "sha": "95b966ae1c166bd92f8ae7d1c313e738c731dfc3"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/file-commit"
                },
                "examples": {
                  "example-for-updating-a-file": {
                    "$ref": "#/components/examples/file-commit-example-for-updating-a-file"
                  }
                }
              }
            }
          },
          "201": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/file-commit"
                },
                "examples": {
                  "example-for-creating-a-file": {
                    "$ref": "#/components/examples/file-commit-example-for-creating-a-file"
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/not_found"
          },
          "422": {
            "$ref": "#/components/responses/validation_failed"
          },
          "409": {
            "$ref": "#/components/responses/conflict"
          }
        },
        "x-github": {
          "githubCloudOnly": false,
          "enabledForGitHubApps": true,
          "category": "repos",
          "subcategory": "contents"
        }
      },
      "delete": {
        "summary": "Delete a file",
        "description": "Deletes a file in a repository.\n\nYou can provide an additional `committer` parameter, which is an object containing information about the committer. Or, you can provide an `author` parameter, which is an object containing information about the author.\n\nThe `author` section is optional and is filled in with the `committer` information if omitted. If the `committer` information is omitted, the authenticated user's information is used.\n\nYou must provide values for both `name` and `email`, whether you choose to use `author` or `committer`. Otherwise, you'll receive a `422` status code.\n\n**Note:** If you use this endpoint and the \"[Create or update file contents](https://docs.github.com/rest/repos/contents/#create-or-update-file-contents)\" endpoint in parallel, the concurrent requests will conflict and you will receive errors. You must use these endpoints serially instead.",
        "tags": ["repos"],
        "operationId": "repos/delete-file",
        "externalDocs": {
          "description": "API method documentation",
          "url": "https://docs.github.com/rest/repos/contents#delete-a-file"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/owner"
          },
          {
            "$ref": "#/components/parameters/repo"
          },
          {
            "name": "path",
            "description": "path parameter",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "x-multi-segment": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "message": {
                    "type": "string",
                    "description": "The commit message."
                  },
                  "sha": {
                    "type": "string",
                    "description": "The blob SHA of the file being deleted."
                  },
                  "branch": {
                    "type": "string",
                    "description": "The branch name. Default: the repository’s default branch"
                  },
                  "committer": {
                    "type": "object",
                    "description": "object containing information about the committer.",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "The name of the author (or committer) of the commit"
                      },
                      "email": {
                        "type": "string",
                        "description": "The email of the author (or committer) of the commit"
                      }
                    }
                  },
                  "author": {
                    "type": "object",
                    "description": "object containing information about the author.",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "The name of the author (or committer) of the commit"
                      },
                      "email": {
                        "type": "string",
                        "description": "The email of the author (or committer) of the commit"
                      }
                    }
                  }
                },
                "required": ["message", "sha"]
              },
              "examples": {
                "default": {
                  "value": {
                    "message": "my commit message",
                    "committer": {
                      "name": "Monalisa Octocat",
                      "email": "octocat@github.com"
                    },
                    "sha": "329688480d39049927147c162b9d2deaf885005f"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/file-commit"
                },
                "examples": {
                  "default": {
                    "$ref": "#/components/examples/file-commit"
                  }
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/validation_failed"
          },
          "404": {
            "$ref": "#/components/responses/not_found"
          },
          "409": {
            "$ref": "#/components/responses/conflict"
          },
          "503": {
            "$ref": "#/components/responses/service_unavailable"
          }
        },
        "x-github": {
          "githubCloudOnly": false,
          "enabledForGitHubApps": true,
          "category": "repos",
          "subcategory": "contents"
        }
      }
    }
  }
}

Same here. I have a test api with 2 endpoints. One of which works fine and GPT can reach the api without issues. The second action is throwing UnrecognizedFunctionError. I’m checking the API logs and GPT is not even making the request.

I also encountered this UnrecognizedFunctionError while trying to use an API with a valid OpenAPI schema.

I think this error occurs because the GPT does not know which endpoint to call. So it can’t match the action from the prompt with an action from the OpenAPI schema.

I have found two possible issues:

  • operationId is missing
  • operationId has a name that is not easy to match to a specific action. For example, instead of “repos/get-content”, an action name like “GetRepositoryConent” could help.

Thanks! I significantly simplified it and now it just throws an error.

Which error are you getting now? Can you share more details about what you changed?

Sorry I realized that wasn’t helpful! I am still getting the same error, but I DID get ChatGPT to admit that this was “a known issue that is being addressed”.

I don’t know whether this is a hallucination or not but it was interesting. I tried to get it to reveal more known issues (like if it has a list of them) but it wouldn’t divulge them.

It would be nice if the GPTs had a known issues list in their “common knowledge” so they could save us from banging our heads against these issues. They could just tell us “Yeah that isn’t working quite right yet, we know about it, and it will be fixed in the future”