Goofle Generative AI: Fix string format (#122348)

* Ignore format for string tool args

* Add tests
This commit is contained in:
Denis Shulyaka 2024-07-22 07:54:31 +03:00 committed by GitHub
parent 4eb096cb0a
commit ac1ad9680b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View file

@ -81,6 +81,8 @@ def _format_schema(schema: dict[str, Any]) -> dict[str, Any]:
key = "type_"
val = val.upper()
elif key == "format":
if schema.get("type") == "string" and val != "enum":
continue
key = "format_"
elif key == "items":
val = _format_schema(val)

View file

@ -449,7 +449,6 @@
description: "Test parameters"
items {
type_: STRING
format_: "lower"
}
}
}