fix: composio tools with array args (#2762)
This commit is contained in:
@@ -547,8 +547,11 @@ def generate_tool_schema_for_composio(
|
||||
property_schema["enum"] = field_props["enum"]
|
||||
|
||||
# Handle array item types
|
||||
if field_props["type"] == "array" and "items" in field_props:
|
||||
property_schema["items"] = field_props["items"]
|
||||
if field_props["type"] == "array":
|
||||
if "items" in field_props:
|
||||
property_schema["items"] = field_props["items"]
|
||||
elif "anyOf" in field_props:
|
||||
property_schema["items"] = [t for t in field_props["anyOf"] if "items" in t][0]["items"]
|
||||
|
||||
# Add the property to the schema
|
||||
properties_json[field_name] = property_schema
|
||||
|
||||
@@ -289,8 +289,8 @@ def test_composio_tool_schema_generation(openai_model: str, structured_output: b
|
||||
action_names = [
|
||||
"GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER", # Simple
|
||||
"CAL_GET_AVAILABLE_SLOTS_INFO", # has an array arg, needs to be converted properly
|
||||
"SALESFORCE_RETRIEVE_LEAD_BY_ID",
|
||||
# has an array arg, needs to be converted properly
|
||||
"SALESFORCE_RETRIEVE_LEAD_BY_ID", # has an array arg, needs to be converted properly
|
||||
"FIRECRAWL_SEARCH", # has an optional array arg, needs to be converted properly
|
||||
]
|
||||
|
||||
# Create a pool of processes
|
||||
|
||||
Reference in New Issue
Block a user