#GPT Assistant Function Calling in C#

1 messages · Page 1 of 1 (latest)

rigid crow
#

I have an assistant and I added a function to it via the OpenAI website (ttps://platform.openai.com/assistants).
In my C# code, I fetch the client and its tools like this:

_openAIClient = new(credentials, clientOptions);
_openAIThread = await _openAIClient.CreateThreadAsync();
_openAIAssistant = await _openAIClient.GetAssistantAsync(_config["OpenAI:AssistantId"]!);

var tools = _openAIAssistant.Tools;

The variable tools contains the FunctionDefinition of the function I created on the website. How on earth can I now use it to call a method in C#?

visual merlinBOT
#

Hi @rigid crow. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Hmm, I don't know enough to give you a confident answer yet. However, you can refer to the OpenAI documentation for more information on how to use function calling with the OpenAI API: Function Calling Guide (https://platform.openai.com/docs/guides/function-calling). This guide provides detailed instructions on how to set up and use function calling, which might help you integrate it with your C# application.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: