Hello, I have a situation that I can’t figure out how to solve.
I have a function that gets the sales of a period, it does a fetch to an api and returns an array of data that will be shown to the user.
{
type: "function",
function: {
name: "get_sales",
description: "Get the sales",
strict: true,
parameters: {
type: "object",
properties: {
company: {
type: ["string"],
description: "The company name. Available: Fravega",
},
date_from: {
type: ["string"],
description: "The starting date of the period, always assuming the first day of the month in question.",
},
date_to: {
type: ["string"],
description: "The end date of the period, always assuming the last day of the month in question.",
},
},
additionalProperties: false,
required: ["company", "date_from", "date_to"],
},
},
},
This returns an array of sales when the function is executed, and is sent to the user as a table image. example [{category: “TV”, total: 500}]
I can not think of a way to make a query on the above data, or how is the best way or the common one.
Example case: How much is the total of the TVs category?
I need to identify that the user is referring to the previous dataset, but I can’t find the right way to do it.
Any help is appreciated!