Hi,
I have a function declaration where I have triple nested objects but the model is unable to the function call. It only works when I nest only two objects max. Has anyone else run into this issue?
Thanks
Hi,
I have a function declaration where I have triple nested objects but the model is unable to the function call. It only works when I nest only two objects max. Has anyone else run into this issue?
Thanks
Hey @blue1 , Welcome to the forum.
I tried the sample function declaration below, but I didn’t get any errors.
Can you share your sample function declaration??
[
{
"name": "find_movies",
"description": "find movie titles currently playing in theaters based on any description, genre, title words, etc.",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA or a zip code e.g. 95616"
},
"description": {
"type": "string",
"description": "Any kind of description including category or genre, title words, attributes, etc."
}
},
"required": [
"description"
]
}
},
{
"name": "find_theaters",
"description": "find theaters based on location and optionally movie title which are is currently playing in theaters",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA or a zip code e.g. 95616"
},
"movie": {
"type": "string",
"description": "Any movie title"
}
},
"required": [
"location"
]
}
},
{
"name": "get_showtimes",
"description": "Find the start times for movies playing in a specific theater",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA or a zip code e.g. 95616"
},
"movie": {
"type": "string",
"description": "Any movie title"
},
"theater": {
"type": "string",
"description": "Name of the theater"
},
"date": {
"type": "string",
"description": "Date for requested showtime"
}
},
"required": [
"location",
"movie",
"theater",
"date"
]
}
}
]
Sorry, I meant something like
{
"name": "find_movies",
"description": "Find movie titles based on provided filters.",
"parameters": {
"type": "object",
"properties": {
"filters": {
"type": "object",
"description": "Filters to refine the search.",
"properties": {
"search_terms": {
"type": "object",
"description": "Keywords and phrases to search for.",
"properties": {
"query": {
"type": "string",
"description": "Keywords to search for in title, description, etc.",
"example": "Action comedy"
},
"exact_phrase": {
"type": "string",
"description": "An exact phrase to search for.",
"example": "Mission: Impossible"
}
}
},
"genres": {
"type": "array",
"items": {
"type": "string",
"description": "A specific genre (e.g., 'Action', 'Comedy', 'Sci-Fi')."
},
"description": "Array of genres to include in the search."
},
"release_year": {
"type": "integer",
"description": "The release year of the movie.",
"example": 2023
}
},
"example": {
"search_terms": {
"query": "superhero",
"exact_phrase": "The Dark Knight"
},
"genres": ["Action"],
"release_year": 2023
}
}
},
"required": [
"filters"
]
}
}
Where we have an object inside of an object (search terms in filters). The issue comes from when the model generates code to print out this parameter to create the function call.
Yes, you are right. The function calling feature is not working as expected when the function_declaration
contains triple-nested objects.
Please note that the new SDK is still under development, so it is advisable to keep the function simple for now.
Let me also check with the team on this issue and get back to you.
Thanks