Open remyma opened 1 month ago
We don't expose the full schema in types to not overwhelm people but entirety of it is supported it in the api. To unblock yourself, just use as any
ok, I'll do that. I understand your point about not overwhelming people, although I think it would be clearer to stick to the standard definition. It helps suggest to people that they may benefit from better validation of the parameters
Hello,
I think that JsonSchema interface is not complete.
https://github.com/VapiAI/web/blob/cb7f315e49889c84e1b03bfaa1664d14d6b62608/api.ts#L454
It's missing some properties useful for validation, for instance
minLength
,maxLength
andformat
for string type: https://json-schema.org/understanding-json-schema/reference/string#formatThat would help on the tool specification so that LLM is aware of expected format.
For instance, I have a tool function, with
startDate
andendDate
parameters. This parameters should be date-time (type: string
,format: date-time
)Most of the time LLM call this function with correct format (2018-11-13T20:20:39+00:00) for parameters. But it already happened that LLM called my function with a wrong format (2018-11-13) instead of expected one.
If I could specify the format, that would fix the issue I think.
For now, I will specify it in the parameter description. But I think that would be great if the
JsonSchema
definition in Vapi could be fully compliant with JsonSchema.Also in openAI doc there is an example with enums to enforce parameter validation: https://platform.openai.com/docs/guides/function-calling/use-enums-for-function-arguments-when-possible
I don't think we can have as much control on validation on Vapi.
What do you think?