#function calling with a list paramater

1 messages · Page 1 of 1 (latest)

wind pelican
#

i want to make a function call for creating new tasks in my ClickUp project management software. I want to be able to brain dump a bunch of unstructured thoughts and have the AI turn my thoughts into a list of actionable tasks with a task name and task description. i want one function call to be able to create multiple tasks all at once. what would be the right function declaration to have a parameter like new_tasks which contains a list of the new task names and their descriptions. also i'm using PHP and the openai-php/client

gloomy raptorBOT
#

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

#

Based on the information provided in the extracts, you can define a function for creating new tasks in your ClickUp project management software using OpenAI's function calling feature. The function could take a parameter new_tasks which is a list of tasks, where each task is an object with a name and description.

Here's a hypothetical example of how you might define such a function:

{
  "name": "create_tasks",
  "type": "function",
  "description": "Create new tasks in ClickUp",
  "args": [
    {
      "name": "new_tasks",
      "type": "array",
      "description": "List of new tasks to create",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the task"
          },
          "description": {
            "type": "string",
            "description": "The description of the task"
          }
        },
        "required": ["name", "description"]
      }
    }
  ]
}

This function definition specifies that create_tasks takes one argument new_tasks, which is an array of objects. Each object should have a name and description property, both of which are strings.

You would then call the OpenAI API with a message that includes a user instruction to create tasks, and include this function in the functions parameter of the API call.

As for implementing this in PHP using the openai-php/client, the extracts do not provide specific information on how to use this library. However, you can refer to the openai-php/client GitHub repository (https://github.com/openai-php/client) for detailed instructions and examples on how to use the library to make API calls to OpenAI.

#

Please note that the actual implementation of the create_tasks function (i.e., the code that interacts with the ClickUp API to create tasks) is not managed by OpenAI and would need to be implemented in your own code (source (https://help.openai.com/en/articles/8550641-assistants-api#h_bbc2d1eecb)).

Also, OpenAI's function calling feature does not currently support calling multiple functions from a single message, but it does support calling a single function multiple times from a single message (source (https://help.openai.com/en/articles/8555517-function-calling-updates)). This means you could potentially use a single function call to create_tasks to create multiple tasks at once, as long as the function is designed to accept a list of tasks as input.

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

wind pelican
#

i dont think that schema is correct, The object includes a name, type, description, and args field, which are not standard top-level fields in an OpenAPI document.
The args field seems to describe the parameters of the function, but in OpenAPI, parameters are described using the parameters.

but the rest of the information looks mostly except you can call multiple functions from a single message by refeeding the results multiple function calls can run serially starting from a single user message.

would be nice to see @gloomy raptor trained on all the different language libraries even community maintained ones like openai-php/client since openai doesn't provide their own official client libraries, and also retrained on conversations like this so hopefully can provide better answers in the future. cheers!

gloomy raptorBOT
#

Let me check the knowledge base for you. One moment! :books:

#

I apologize for the confusion earlier. You're correct that the schema I provided does not adhere to the OpenAPI specification. In OpenAPI, parameters are indeed described using the parameters field, not args.

As for calling multiple functions from a single message, you're correct that you can do this by refeeding the results. This means you can make a function call, use the result in the next message, and make another function call, and so on. This allows multiple function calls to run serially starting from a single user message.

Regarding the openai-php/client, the extracts provided do not contain specific information about this library. However, OpenAI's models are trained on a diverse range of internet text. But, they do not know specifics about which documents were in their training set or have access to any proprietary databases, classified information, confidential information, or any specifics about which languages or libraries they were trained on.

As for retraining models on conversations like this, OpenAI continuously works on improving and updating their models, and feedback like yours is invaluable in this process.

Thank you for your feedback and understanding!

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