generative-ai-js icon indicating copy to clipboard operation
generative-ai-js copied to clipboard

FunctionDeclarationSchema is too terse and needs to support valid additional JSONSchema definitions

Open mattgi opened this issue 1 year ago • 2 comments

Description of the bug:

additionalProperties is not an allowed field to include for a parameter, nor is oneOf (or an array) of Types. It is also not possible to omit the type. All of these variations are valid JSONSchema property definitions.

This limits the values to being known and makes it difficult to utilize function calling for something like an object of React Props or something that is quite dynamic.

Actual vs expected behavior:

Add additionalProperties: true as a valid field for function params. This should be treated equivalent to { [key:string]: any; }

Any other information you'd like to share?

No response

mattgi avatar Dec 27 '24 15:12 mattgi

hey, I would like to work on this issue, can u assign me this issue.

krishnaagrawal7508 avatar Mar 06 '25 16:03 krishnaagrawal7508

I’ve been digging into the Python SDK and reviewing both the codebase and the documentation (e.g. API Docs). I noticed something that stood out: there’s no mention of additionalProperties anywhere. From what I can see, only the existing types are referenced across the board, with no discussion of additionalProperties or similar schema features like oneOf.

mewanDimalsha avatar Mar 29 '25 03:03 mewanDimalsha