Class: LLM::Function::Return
- Inherits:
-
Struct
- Object
- Struct
- LLM::Function::Return
- Defined in:
- lib/llm/function.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#error? ⇒ Boolean
Returns true when the return value represents an error.
-
#to_h ⇒ Hash
Returns a Hash representation of Return.
- #to_json ⇒ String
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id
45 46 47 |
# File 'lib/llm/function.rb', line 45 def id @id end |
#name ⇒ Object
Returns the value of attribute name
45 46 47 |
# File 'lib/llm/function.rb', line 45 def name @name end |
#value ⇒ Object
Returns the value of attribute value
45 46 47 |
# File 'lib/llm/function.rb', line 45 def value @value end |
Instance Method Details
#error? ⇒ Boolean
Returns true when the return value represents an error.
49 50 51 |
# File 'lib/llm/function.rb', line 49 def error? Hash === value && value[:error] == true end |
#to_h ⇒ Hash
Returns a Hash representation of LLM::Function::Return
56 57 58 |
# File 'lib/llm/function.rb', line 56 def to_h {id:, name:, value:} end |