Hi community:) I am looking for help from someone mastering the ‘function calling’ api.
I am trying to implement a simple task, but what I see is that it's not so simple for AI or I do something wrong.
In my scenario I have text which describes a car.
I want chat to populate all required fields for model
role = "user",
content = "Please extract data from this text: SOMETEXT…"
var functions = new List<object>
{
new
{
name = "get_сar_details",
description = "Extract possible properties from text.",
parameters = new
{
type = "object",
properties = new
{
brand = new
{
type = "string",
description = "Brand name, eg. Audi, BMW, keep empty if no corresponding text"
},
model = new
{
type = "string",
description = "Model name, eg. A4, A5, G63, keep empty if no corresponding text"
},
//.... more properties ProductionYear, Transmittion...
},
required = new { "brand", "model" }
}
}
};
Everything is simple and the response is correct, until I send bigger text, with a bigger properties model.
After I have added 20 properties, the required attribute becomes redundant, because chat populates randomly only a few of them, each time different.
Is it possible to explain chat that those properties are required to populate or keep empty, but finish this task with all properties?
This code was done in c# but I will be thankful with any help on any language.