Need help with defining a function

I’m trying to figure out what I need to put inside the tool definition for the Ai to return an array of objects.

As in:

[
{"key": "value", "key": "value"},
{"key": "value", "key": "value"},
{"key": "value", "key": "value"},
]

The cookbook is very unhelpful, as it only covers very basic scenarios with no nuance - so it’s hard to find any signal in there personally.

Can someone point me in the direction of where I can get a full explanation of the various options that need to be used when building the tool properties and all that jazz?

  • There’s got to be a master list somewhere, with every possible option defined… no?
  • I can’t find this, and trying to transform the info from some example to my complex scenario is… not working.
  • I can’t help but feel that if I could just see all the options, I’d be able to see the one that I need… but without that list of all the options, it’s pretty hard to find what I want.

Specifically:

I need to know what are all the options for all the things inside this:

{
        "name": "get_current_weather",
        "description": "Get the current weather",
        "parameters": {
            "type": "object",
            "properties": {
                "location": {
                    "type": "string",
                    "description": "The city and state, e.g. San Francisco, CA",
                },
                "format": {
                    "type": "string",
                    "enum": ["celsius", "fahrenheit"],
                    "description": "The temperature unit to use. Infer this from the users location.",
                },
            },
            "required": ["location", "format"],
        },
    },
    {
        "name": "get_n_day_weather_forecast",
        "description": "Get an N-day weather forecast",
        "parameters": {
            "type": "object",
            "properties": {
                "location": {
                    "type": "string",
                    "description": "The city and state, e.g. San Francisco, CA",
                },
                "format": {
                    "type": "string",
                    "enum": ["celsius", "fahrenheit"],
                    "description": "The temperature unit to use. Infer this from the users location.",
                },
                "num_days": {
                    "type": "integer",
                    "description": "The number of days to forecast",
                }
            },
            "required": ["location", "format", "num_days"]
        },
    }

I need a place where I can see something like:

  • For the “properties” for X you can have options, 1, 2, 3, 4.
  • For the “type” for X you can have options, a, b, c, d, e
  • etc.

A clear definition with every option clearly listed out. Surely this exists somewhere yes?

This is a good start, however it is not meant to totally be a beginner’s guide.

1 Like

Thank you; I’ve been reading a ton of your posts - they have been very helpful.

I think my difficulty is maybe tied to something you mentioned about sub-objects not being seen by the Ai or something.

  • I think I might be running into this maybe, because it’s like it’s not aware of those nested things.