Class: TurnKit::ModelRequest
- Inherits:
-
Object
- Object
- TurnKit::ModelRequest
- Defined in:
- lib/turnkit/model_request.rb
Instance Attribute Summary collapse
-
#instructions ⇒ Object
readonly
Returns the value of attribute instructions.
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#output_schema ⇒ Object
readonly
Returns the value of attribute output_schema.
-
#report ⇒ Object
readonly
Returns the value of attribute report.
-
#thinking ⇒ Object
readonly
Returns the value of attribute thinking.
-
#tools ⇒ Object
readonly
Returns the value of attribute tools.
Instance Method Summary collapse
-
#initialize(model:, messages:, tools:, instructions:, thinking: nil, output_schema: nil, metadata: {}, report: nil) ⇒ ModelRequest
constructor
A new instance of ModelRequest.
- #to_h ⇒ Object
- #tool_names ⇒ Object
Constructor Details
#initialize(model:, messages:, tools:, instructions:, thinking: nil, output_schema: nil, metadata: {}, report: nil) ⇒ ModelRequest
Returns a new instance of ModelRequest.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/turnkit/model_request.rb', line 7 def initialize(model:, messages:, tools:, instructions:, thinking: nil, output_schema: nil, metadata: {}, report: nil) @model = model @messages = Array() @tools = Array(tools) @instructions = instructions.to_s @thinking = thinking @output_schema = output_schema @metadata = || {} @report = report || {} end |
Instance Attribute Details
#instructions ⇒ Object (readonly)
Returns the value of attribute instructions.
5 6 7 |
# File 'lib/turnkit/model_request.rb', line 5 def instructions @instructions end |
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
5 6 7 |
# File 'lib/turnkit/model_request.rb', line 5 def @messages end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
5 6 7 |
# File 'lib/turnkit/model_request.rb', line 5 def @metadata end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
5 6 7 |
# File 'lib/turnkit/model_request.rb', line 5 def model @model end |
#output_schema ⇒ Object (readonly)
Returns the value of attribute output_schema.
5 6 7 |
# File 'lib/turnkit/model_request.rb', line 5 def output_schema @output_schema end |
#report ⇒ Object (readonly)
Returns the value of attribute report.
5 6 7 |
# File 'lib/turnkit/model_request.rb', line 5 def report @report end |
#thinking ⇒ Object (readonly)
Returns the value of attribute thinking.
5 6 7 |
# File 'lib/turnkit/model_request.rb', line 5 def thinking @thinking end |
#tools ⇒ Object (readonly)
Returns the value of attribute tools.
5 6 7 |
# File 'lib/turnkit/model_request.rb', line 5 def tools @tools end |
Instance Method Details
#to_h ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/turnkit/model_request.rb', line 22 def to_h { "model" => model, "messages" => , "tools" => tool_names, "instructions" => instructions, "thinking" => thinking, "output_schema" => output_schema, "metadata" => , "report" => report } end |
#tool_names ⇒ Object
18 19 20 |
# File 'lib/turnkit/model_request.rb', line 18 def tool_names tools.map(&:tool_name) end |