#Integrating Third-Party APIs with Custom GPT and OpenAI Assistant

1 messages · Page 1 of 1 (latest)

stiff badger
#

Hello everyone,

I've been working with GPT models and have successfully created a custom GPT that accesses third-party APIs. This is achieved by configuring a JSON script in the Actions section of the GPT editor.

However, when attempting to integrate similar functionality into an OpenAI Assistant, I encountered several challenges. Despite using the same instructions and files, the responses from the Assistant and my custom GPT are notably different. Additionally, while my GPT allows direct incorporation of third-party API calls, the Assistant seems to require a different approach. The Function section in the Assistant's configuration is formatted differently and seems to operate differently from the Actions in GPT.

My questions are:
Is there a way to access my custom GPT through the OpenAI library?
Has anyone successfully implemented a method to enable the Assistant to access third-party APIs through the Functions option?

Any insights or experiences with similar integrations would be greatly appreciated.

twin ivy
#

It was working yesterday but isn't today. It's "function calling" in the documentation. Something messed it up though, and now it's mostly errors for me.

stiff badger
# twin ivy It was working yesterday but isn't today. It's "function calling" in the documen...

Yes, I understand that these are almost the same thing. But I don’t understand how to use these Functions. Here is an example from the developers, from a custom GPT that receives weather data:

{
  "openapi": "3.1.0",
  "info": {
    "title": "Get weather data",
    "description": "Retrieves current weather data for a location.",
    "version": "v1.0.0"
  },
  "servers": [
    {
      "url": "https://api.example-weather-app.com"
    }
  ],
  "paths": {
    "/location": {
      "get": {
        "description": "Get temperature for a specific location",
        "operationId": "GetCurrentWeather",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "description": "The city and state to retrieve the weather for",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "deprecated": false
      }
    }
  },
  "components": {
    "schemas": {}
  }
}```

In this example we can see that everything is clear. There is a service URL that GPT will ask for. There are also paths so that GPT decides which function to call and which request to make. Just add the correct description and everything works great.

And here is an example from Assistant Functions that receives weather data:

{
"name": "get_weather",
"description": "Determine weather in my location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state e.g. San Francisco, CA"
},
"unit": {
"type": "string",
"enum": [
"c",
"f"
]
}
},
"required": [
"location"
]
}
}```

Here I don't see any URLs or Paths, anything that would indicate that I'm connecting to an API. If anyone has an example, please share it.

peak flicker
#

Interested about this topic. I'm stuck in the same situation