#“UnrecognizedKwargsError” on POST Request via GPT Action

1 messages · Page 1 of 1 (latest)

gilded mountain
#

I am getting this UnrecognizedKwargsError error when POSTing to endpoints via a custom GPT action. I have found only one forum (https://community.openai.com/t/getting-strange-unrecognizedkwargserror-error/169600) on this which was regarding the assistants api, and have implemented the suggestions but nothing. This is an OpenAI-specific error apparently, so I’m wondering if anyone else has come across this as there is currently no info available. I was able to get it to POST using a schema earlier today, and I see that other custom GPTs are able to POST, and I can tell that the request is not making it to my endpoint, nor is it improperly formatted (getting the gpt to output a curl command for the action it is trying to use results in a fully functional curl command). GET requests are working fine, at least in my current setup.

This will not specify this error after the request has failed, it will simply show the typical “error communicating with {domain}” error. However, when inquiring of the GPT “what error was output?” The UnrecognizedKwargsError is specified.

OpenAI Developer Forum

As far as I can tell ChatGPT is calling my API with exactly the right type of request. I can even use curl to verify the JSON is valid. But I always get this strange UnrecognizedKwargsError error from ChatGPT. My understanding is that this error was NOT generated by my codes. But it was generated by some backend magic from OpenAI? I suppose the...

gilded mountain
#

To anyone experiencing the same error, this is how I resolved it:

Old schema:

            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "topic": {
                    "type": "string",
                    "description": "The topic of the knowledge data."
                  },
                  "keywords": {
                    "type": "string",
                    "description": "Keywords associated with the topic."
                  },
                  "knowledge": {
                    "type": "string",
                    "description": "The detailed knowledge information."
                  }
                }
              }
            }
          }```

new schema:
```"requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "topic": {
                    "type": "string",
                    "description": "The topic of the knowledge data."
                  },
                  "keywords": {
                    "type": "string",
                    "description": "Keywords associated with the topic."
                  },
                  "knowledge": {
                    "type": "string",
                    "description": "The detailed knowledge information."
                  }
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "topic": {
                    "type": "string",
                    "description": "The topic of the knowledge data."
                  },
                  "keywords": {
                    "type": "string",
                    "description": "Keywords associated with the topic."
                  },
                  "knowledge": {
                    "type": "string",
                    "description": "The detailed knowledge information."
                  }
                },
                "required": ["topic", "keywords", "knowledge"]
              }
            }
          }
        }```

Pretty sure that the x-www-form-urlencoded section can now be removed as it is working via the json upload, but I am just happy it is working finally