Class: RubynCode::LLM::Response
- Inherits:
-
Data
- Object
- Data
- RubynCode::LLM::Response
- Defined in:
- lib/rubyn_code/llm/message_builder.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#stop_reason ⇒ Object
readonly
Returns the value of attribute stop_reason.
-
#usage ⇒ Object
readonly
Returns the value of attribute usage.
Instance Method Summary collapse
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content
27 28 29 |
# File 'lib/rubyn_code/llm/message_builder.rb', line 27 def content @content end |
#id ⇒ Object (readonly)
Returns the value of attribute id
27 28 29 |
# File 'lib/rubyn_code/llm/message_builder.rb', line 27 def id @id end |
#stop_reason ⇒ Object (readonly)
Returns the value of attribute stop_reason
27 28 29 |
# File 'lib/rubyn_code/llm/message_builder.rb', line 27 def stop_reason @stop_reason end |
#usage ⇒ Object (readonly)
Returns the value of attribute usage
27 28 29 |
# File 'lib/rubyn_code/llm/message_builder.rb', line 27 def usage @usage end |
Instance Method Details
#text ⇒ Object
28 29 30 |
# File 'lib/rubyn_code/llm/message_builder.rb', line 28 def text content.select { |b| b.type == 'text' }.map(&:text).join end |
#tool_calls ⇒ Object
32 33 34 |
# File 'lib/rubyn_code/llm/message_builder.rb', line 32 def tool_calls content.select { |b| b.type == 'tool_use' } end |
#tool_use? ⇒ Boolean
36 37 38 |
# File 'lib/rubyn_code/llm/message_builder.rb', line 36 def tool_use? stop_reason == 'tool_use' end |