Class: LLM::Function::Return

Inherits:
Struct
  • Object
show all
Defined in:
lib/llm/function.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#id ⇒ Object

Returns the value of attribute id

Returns:

  • (Object) —

    the current value of id



35
36
37
# File 'lib/llm/function.rb', line 35

def id
  @id
end

#name ⇒ Object

Returns the value of attribute name

Returns:

  • (Object) —

    the current value of name



35
36
37
# File 'lib/llm/function.rb', line 35

def name
  @name
end

#value ⇒ Object

Returns the value of attribute value

Returns:

  • (Object) —

    the current value of value



35
36
37
# File 'lib/llm/function.rb', line 35

def value
  @value
end

Instance Method Details

#to_h ⇒ Hash

Returns a Hash representation of LLM::Function::Return

Returns:

  • (Hash)


39
40
41
# File 'lib/llm/function.rb', line 39

def to_h
  {id:, name:, value:}
end

#to_json ⇒ String

Returns:

  • (String)


45
46
47
# File 'lib/llm/function.rb', line 45

def to_json(...)
  LLM.json.dump(to_h, ...)
end