This commit is contained in:
Timothy Jaeryang Baek
2025-02-04 21:20:03 -08:00
parent 8d520eeecd
commit c5a9cfacf1
2 changed files with 10 additions and 3 deletions

View File

@@ -61,6 +61,12 @@ def get_tools(
)
for spec in tools.specs:
# TODO: Fix hack for OpenAI API
# Some times breaks OpenAI but others don't. Leaving the comment
for val in spec.get("parameters", {}).get("properties", {}).values():
if val["type"] == "str":
val["type"] = "string"
# Remove internal parameters
spec["parameters"]["properties"] = {
key: val