Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FunctionDeclarationSchema type not allowing strings #279

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hapticdata
Copy link

If I use Google's AI Studio and edit my functions. It will give me an object like this:

[
  {
    "name": "getWeather",
    "description": "get the weather for a location",
    "parameters": {
      "type": "object",
      "properties": {
        "location": {
          "type": "string"
        }
      }
    }
  }
]

TypeScript will throw an error for this because I used "object" instead of SchemaType.OBJECT for "type". It will however work fine in Javascript.

This pull request simply allows FunctionDeclarationSchema to accept any value from the SchemaType enum or its string equivalent.

type: "string" | "number" | "boolean" | "object" | SchemaType | "integer" | "array"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant