Nested arrays and objects in function definition object

#4
by ohshutit - opened

Is it possible to make a function definition like this? Its currently in the chatgpt format. I know its beefy, and I've been training my own adapters here and would be happy to create my own training data to see if I can expand the capabilities, but I'm just wondering if its currently possible to run nested arrays and objects like this already.
<FUNCTIONS>

{
    "name": "createMeta",
    "description": "Create a meta with the given information",
    "parameters": {
        "type": "object",
        "properties": {

            "title": {
                "type":
                    "string"
            },

            "description": {
                "type": "string"
            },

            "notes": {
                "type": "array",
                "description": "notes about the meta",
                "items": {
                    "type": "object",
                    "properties": {
                        "title": { "type": "string" },
                        "description": { "type": "string" }
                    }
                }
            },
            "images": {
                "type": "array",
                "description": "images for the metadata",
                "items": {
                    "type": "object",
                    "properties": {
                        "url": { "type": "string" },
                        "width": { "type": "number" },
                        "height": { "type": "number" }
                    }
                }
            }
        },
        "required": ["title", "description", "notes", "images"]
    }
}

</FUNCTIONS>

Yes, that should work if you follow the format in the model card for this function calling model (i.e. using arguments instead of parameters, etc...).

A strong model like codellama 34b (although deepseek is probably stronger) should do well. perhaps even the free llama 7b model has a chance (although mistral would be better).

RonanMcGovern changed discussion status to closed

Sign up or log in to comment