-
Notifications
You must be signed in to change notification settings - Fork 140
Open
Description
I am creating a custom graph with ChatOpenAI llm bind_tools in strict mode.
manage_memory_tool = tools.create_manage_memory_tool(namespace=("memories", "{user_id}"))
tools = [manage_memory_tool]
llm_with_tools = llm.bind_tools(tools, strict=True)When the llm are called, 400 error occured:
openai.BadRequestError: Error code: 400 - {'error': {'message': "Invalid schema for function 'manage_memory': In context=(), 'required' is required to be supplied and to be an array including every key in properties. Missing 'content'.", 'type': 'invalid_request_error', 'param': 'tools[4].function.parameters', 'code': 'invalid_function_parameters'}}
I check the tool definiation, 'required' is an empty list ('required': []), which violates https://platform.openai.com/docs/guides/structured-outputs/supported-schemas?api-mode=responses#all-fields-must-be-required.
Can we have a parameter when creating the tool to be compatible with the strict mode?
Metadata
Metadata
Assignees
Labels
No labels