Skip to content

zero parameter tools usage from langgraph agent #90

@gmann11

Description

@gmann11

We needed to override the tool args_schema for zero parameter tools use it with a langgraph agent:

    for tool in tools:
        if not 'properties' in tool.args_schema:
            tool.args_schema['properties'] = {}

if properties isn't defined as empty object in the tool, this error is returned:

openai.BadRequestError: Error code: 400 - {'error': {'message': "Invalid schema for function 'get-schema': In context=(), object schema missing properties.", 'type': 'invalid_request_error', 'param': 'tools[0].function.parameters', 'code': 'invalid_function_parameters'}},

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions