Class: RubyLLM::Chat
- Inherits:
-
Object
- Object
- RubyLLM::Chat
- Defined in:
- lib/ruby_llm/chat.rb
Instance Method Summary collapse
- #ask_prompt(prompt) ⇒ Object
- #with_prompt(prompt, arguments: {}) ⇒ Object
- #with_resource(resource) ⇒ Object
- #with_resource_template(resource_template, arguments: {}) ⇒ Object
- #with_resources(*resources, **args) ⇒ Object
Instance Method Details
#ask_prompt(prompt) ⇒ Object
30 31 32 |
# File 'lib/ruby_llm/chat.rb', line 30 def ask_prompt(prompt, ...) prompt.ask(self, ...) end |
#with_prompt(prompt, arguments: {}) ⇒ Object
25 26 27 28 |
# File 'lib/ruby_llm/chat.rb', line 25 def with_prompt(prompt, arguments: {}) prompt.include(self, arguments: arguments) self end |
#with_resource(resource) ⇒ Object
14 15 16 17 |
# File 'lib/ruby_llm/chat.rb', line 14 def with_resource(resource) resource.include(self) self end |
#with_resource_template(resource_template, arguments: {}) ⇒ Object
19 20 21 22 23 |
# File 'lib/ruby_llm/chat.rb', line 19 def with_resource_template(resource_template, arguments: {}) resource = resource_template.fetch_resource(arguments: arguments) resource.include(self) self end |
#with_resources(*resources, **args) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/ruby_llm/chat.rb', line 7 def with_resources(*resources, **args) resources.each do |resource| resource.include(self, **args) end self end |