Class: RubyLLM::Conversation
- Inherits:
- 
      Object
      
        - Object
- RubyLLM::Conversation
 
- Defined in:
- lib/ruby_llm/conversation.rb
Overview
Represents a conversation with an LLM
Instance Attribute Summary collapse
- 
  
    
      #id  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute id. 
- 
  
    
      #messages  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute messages. 
- 
  
    
      #tools  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute tools. 
Instance Method Summary collapse
- #add_message(message) ⇒ Object
- 
  
    
      #initialize(tools: [])  ⇒ Conversation 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of Conversation. 
Constructor Details
#initialize(tools: []) ⇒ Conversation
Returns a new instance of Conversation.
| 8 9 10 11 12 | # File 'lib/ruby_llm/conversation.rb', line 8 def initialize(tools: []) @id = SecureRandom.uuid @messages = [] @tools = tools end | 
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
| 6 7 8 | # File 'lib/ruby_llm/conversation.rb', line 6 def id @id end | 
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
| 6 7 8 | # File 'lib/ruby_llm/conversation.rb', line 6 def @messages end | 
#tools ⇒ Object (readonly)
Returns the value of attribute tools.
| 6 7 8 | # File 'lib/ruby_llm/conversation.rb', line 6 def tools @tools end | 
Instance Method Details
#add_message(message) ⇒ Object
| 14 15 16 17 | # File 'lib/ruby_llm/conversation.rb', line 14 def () @messages << end |