Yes, OpenAI's custom GPT models built on ChatGPT can be designed to call external APIs for fetching data sets that it deems necessary to answer a user's prompt. This is achieved through the use of function calling, which allows the model to interact with defined functions that can call external APIs.
Here's a basic sequence of steps for function calling:
- Call the model with the user query and a set of functions defined in the functions parameter.
- The model can choose to call one or more functions; if so, the content will be a stringified JSON object adhering to your custom schema.
- Parse the string into JSON in your code, and call your function with the provided arguments if they exist.
- Call the model again by appending the function response as a new message, and let the model summarize the results back to the user.
In your case, you can define a function like customDataFetch that can retrieve attributes like getCompanyName, getCeoName, and getYearCreated from an external API. The model can then convert a user's natural language prompt into a call to this function, fetch the required data, and use it to generate a response.
However, please note that the model may hallucinate parameters, and you need to handle such cases in your code.
For more details, you can refer to the OpenAI Function Calling Guide (https://platform.openai.com/docs/guides/function-calling).
Please note that the actual implementation of the function and the handling of the API calls would depend on the specific requirements of your application and the API you are interacting with.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: