Do assistant functions calls work?

Hi,
here’s a simplified version of my assistant:


Why doesn’t it ask for the task duration? I’ve tried to include instructions like “You must ask the user for the task duration” in the function description and parameters, but it doesn’t work. Obviously, I can’t use this direct “guidelines” in my full-version assistant’s instruction because task_duration isn’t always required or means something different across its various functions.

Thanks!

Thats interesting that it’s pencil’ing in 1440 minutes, which is 24 hours. I wonder if some scheduling or calendar software it trained on, had default tasks take up the whole day

1440

Unfortunately, this number is random. I understand that Assistants are in beta, but the “function call” is practically unusable.

OpenAI Assistants aren’t as smart as you think they would be. :grinning: In some cases, you have to provide the Assistant more information on what it has to do, and how it has to do it. Although Functions can sometimes be a good place for that information, in other situations, the Instructions can be a more effective place to put them.

For example, with the following Instructions, you can get the Assistant to behave more like you would expect it to, as you can see in the screenshot below.

Instructions
You are an assistant that creates tasks. Every task requires a duration, measured in minutes, and a description of the task. If the user hasn't given you this information, you should ask the user until you have the necessary information to create a task. Once you have all the necessary task information, create a task using available functions.

You are probably right. Alas, as I mentioned earlier, I need the assistant to be able to call a variety of functions. Real businesses want something more applicable, and I’m specifically trying to prove a concept of a basic account assistant which should be able to send bills, check schedules, and do other things. So, when I implement 3-4 functions with detailed instructions, the outcome isn’t reliable, to say the least. Every other request to create a task in the prototype application ends with the same instability: calling functions with random parameters:

This is helpful to understand where you’re coming from. I’m working on something similar, so have hit some of the challenges you are experiencing. I want to develop an AI powered executive assistant, using the OpenAI Assistant framework, that can read and respond to emails, check calendars, and autonomously schedule meetings based on request from other people. If you want to see how it’s built, you can find it in the AdminGPT Github repo below, and an example in the following example Python Notebook.

From what I’ve understood of the OpenAI Assistant API, the goal of the Assistant is to be agent that decides which function to call based on the user’s input. And from what I understand in your architecture, you want the create_task to decide which function to call instead. So, I’m not sure if the create_task framework is the best solution long term.

Now, having worked with the Assistant API for a while, a big part of the challenge of developing these applications is what you’re experiencing: getting the Assistant to call the right function. As an example, the OpenAI model is really bad at determining open calendar slots when you send it all the meetings in your calendar. In response to this issue, for AdminGPT I created a function called o365find_free_time_slots (you can see it as part of the Office365 Toolkit for the Assistant API). However, the Assistant API would stubbornly continue to try to determine open slots incorrectly by itself without calling the function. So, I added the following text in the function’s description:

ALWAYS use this tool to determine when the user is free, open, or available by analyzing the calendar events for the day.

The performance got better, but the Assistant would still try to do it himself. So I added the following to the Assistant’s instructions, and got things to work well.

ALWAYS use functions for determining free times.

This is an example of how I’m approaching the development of an Assistants, and hopefully helps you as well.

1 Like

Thank you very much for such a great response and sharing your practical experience! My example with create_task is just an oversimplification which could confuse the reader, but I hope I understand the concept of function calls. In my situation, mostly, I have to deal with accounting which places deterministic behavior as a priority. For example, I can’t put the current date in the assistant instructions; in my case, it should be a function get_current_date_and_time, because the current time matters for some requests, and I don’t want to have to recreate the assistant daily for each user, although it does not work all the time. Even though it has specific instructions, sometimes the assistant forgets to call my function and uses a “past” time from the perspective of the current user’s request. Anyway, thank you for your help, I will keep trying.

1 Like