Assistant connection to external APIs

Hello everyone,

I have been working hours on this and I don’t know if there is a solution. Is there any way to connect a wizard to an external API. The idea is to have the user query, pass it to an endpoint /search/ of the API and perform a search in a database and with the answer obtained, that the agent itself translates it to natural language and gives this answer to the user.

Hi @pablolegeren

You should use function calling tool. Your function can do anything that you want to, even call any external API.

Here you have a demo code in Java, but you could extrapolate to your favorite language.

1 Like

I have tried it in the Playground and it is not working.

@pablolegeren Maybe I’m wrong, per my understanding, the Playground could help you to generate the function schema required by the Assistant (the function’s signature), but you need the developer-defined code to execute the actual function and Playground cannot host that code, as far as I know.

This image could clarify concepts:

(Taken from https://platform.openai.com/docs/guides/function-calling#overview)

1 Like