Skip to content

Tools without parameters are resulting in unsupported function_declarations schema for Gemini #61

@redox

Description

@redox

A tool without param like:

class MyTool < RubyLLM::Tool
  description 'Whatever'

  def name
    "my_tool_name"
  end

  def execute
     {}
  end
end

will result in:

* GenerateContentRequest.tools[0].function_declarations[0].parameters.properties: should be non-empty for OBJECT type (RubyLLM::BadRequestError)

because it will generate:

 tools:
  [{functionDeclarations:
     [{name: "my_tool_name",
       description:"Whatever",
       parameters:
        {type: "OBJECT",
         properties: {},
         required: []}},

If I have some time tonight I'll open a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions