Class: LLM::Bot::Prompt::Completion
- Inherits:
-
Struct
- Object
- Struct
- LLM::Bot::Prompt::Completion
- Defined in:
- lib/llm/bot/prompt/completion.rb
Instance Attribute Summary collapse
-
#bot ⇒ Object
Returns the value of attribute bot.
-
#defaults ⇒ Object
Returns the value of attribute defaults.
Instance Method Summary collapse
-
#initialize(bot, defaults) ⇒ LLM::Bot::Prompt::Completion
constructor
-
#system(prompt, params = {}) ⇒ LLM::Bot
-
#user(prompt, params = {}) ⇒ LLM::Bot
Constructor Details
#initialize(bot, defaults) ⇒ LLM::Bot::Prompt::Completion
9 10 11 |
# File 'lib/llm/bot/prompt/completion.rb', line 9 def initialize(bot, defaults) super(bot, defaults || {}) end |
Instance Attribute Details
#bot ⇒ Object
Returns the value of attribute bot
4 5 6 |
# File 'lib/llm/bot/prompt/completion.rb', line 4 def bot @bot end |
#defaults ⇒ Object
Returns the value of attribute defaults
4 5 6 |
# File 'lib/llm/bot/prompt/completion.rb', line 4 def defaults @defaults end |
Instance Method Details
#system(prompt, params = {}) ⇒ LLM::Bot
17 18 19 20 |
# File 'lib/llm/bot/prompt/completion.rb', line 17 def system(prompt, params = {}) params = defaults.merge(params) bot.chat prompt, params.merge(role: :system) end |
#user(prompt, params = {}) ⇒ LLM::Bot
26 27 28 29 |
# File 'lib/llm/bot/prompt/completion.rb', line 26 def user(prompt, params = {}) params = defaults.merge(params) bot.chat prompt, params.merge(role: :user) end |