Class: LangGraphRB::ToolDefinition::FunctionSchemaBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/langgraph_rb/tool_definition.rb

Instance Method Summary collapse

Constructor Details

#initialize(parameters) ⇒ FunctionSchemaBuilder

Returns a new instance of FunctionSchemaBuilder.



46
47
48
# File 'lib/langgraph_rb/tool_definition.rb', line 46

def initialize(parameters)
  @parameters = parameters
end

Instance Method Details

#property(name, type:, description: "", required: false) ⇒ Object



50
51
52
53
54
55
56
# File 'lib/langgraph_rb/tool_definition.rb', line 50

def property(name, type:, description: "", required: false)
  @parameters[:properties][name.to_sym] = { type: type, description: description }
  if required
    @parameters[:required] ||= []
    @parameters[:required] << name.to_sym
  end
end