Class: Omakase::Request
- Inherits:
-
Data
- Object
- Data
- Omakase::Request
- Defined in:
- lib/omakase/request.rb
Overview
One invocation of a generation method: all a strategy may depend on.
Instance Attribute Summary collapse
-
#agent ⇒ Object
readonly
Returns the value of attribute agent.
-
#generation ⇒ Object
readonly
Returns the value of attribute generation.
-
#inputs ⇒ Object
readonly
Returns the value of attribute inputs.
Instance Method Summary collapse
Instance Attribute Details
#agent ⇒ Object (readonly)
Returns the value of attribute agent
5 6 7 |
# File 'lib/omakase/request.rb', line 5 def agent @agent end |
#generation ⇒ Object (readonly)
Returns the value of attribute generation
5 6 7 |
# File 'lib/omakase/request.rb', line 5 def generation @generation end |
#inputs ⇒ Object (readonly)
Returns the value of attribute inputs
5 6 7 |
# File 'lib/omakase/request.rb', line 5 def inputs @inputs end |
Instance Method Details
#chat ⇒ Object
6 |
# File 'lib/omakase/request.rb', line 6 def chat = agent.chat |
#instructions ⇒ Object
10 |
# File 'lib/omakase/request.rb', line 10 def instructions = agent.class.instructions |
#schema ⇒ Object
8 |
# File 'lib/omakase/request.rb', line 8 def schema = generation.schema |
#task ⇒ Object
12 13 14 15 16 17 |
# File 'lib/omakase/request.rb', line 12 def task return generation.prompt if inputs.empty? arguments = inputs.map { |name, value| "- #{name}: #{value.inspect}" } "#{generation.prompt}\n\nInputs:\n#{arguments.join("\n")}" end |