reportType: {
type: 'string' as const,
enum: ['full_report', 'financial_report', 'hours_report'],
description: 'Report type that invoked with "report" keyword',
},
...
required: [], // not required
The goal is to get this argument but only if the assistant gets “report” keyword. But when I do “Hours on job 12345” the assistant still returns me hours_report as a reportType argument but that’s wrong. How to make assistant to call the function with an argument only if receives some given keyword?
I was thinking of a “weight” that indicates how confident the assistant is. For example if weight of reportType is less then some value then I can say that AI “isn’t that sure about that” and I can ignore that value at all. Is there some hidden feature that allows to do that? If not I’d be happy to make it my feature request.
reportType: {
type: 'string' as const,
enum: ['full_report', 'financial_report', 'hours_report'],
description: 'Report type that invoked with "report" keyword',
},
...
required: [], // not required
Writing functions is a bit like prompting - you want the structure and values to allow intuition of the purpose. Here, description is in order, because of the obscure purpose.
Also, we can give it another enum to choose, so it doesn’t have to make decisions about omitting the property, only choosing the most appropriate value.
See if my modifications, where you handle a “not_found” yourself, improve the situation.
{
"type": "object",
"properties": {
"report_type": {
"type": "string",
"enum": ["full_report", "financial_report", "hours_report", "not_found"],
"description": "For the key 'report' found in conversation, for the particular report you are extracting, repeat back its report value",
},
"required": ["report_type"],
},