Class: InstLLM::Parameter::ClaudeParameters
- Inherits:
-
Object
- Object
- InstLLM::Parameter::ClaudeParameters
- Defined in:
- lib/inst_llm/parameter/claude_parameters.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ anthropic_version: "bedrock-2023-05-31", max_tokens: 2000, stop_sequences: nil, temperature: nil, top_k: nil, top_p: nil, system: nil, }.freeze
Instance Method Summary collapse
-
#initialize(model:, messages: [], **options) ⇒ ClaudeParameters
constructor
A new instance of ClaudeParameters.
- #to_hash ⇒ Object
Constructor Details
#initialize(model:, messages: [], **options) ⇒ ClaudeParameters
Returns a new instance of ClaudeParameters.
16 17 18 19 20 |
# File 'lib/inst_llm/parameter/claude_parameters.rb', line 16 def initialize(model:, messages: [], **) @messages = @model = model @options = DEFAULT_OPTIONS.merge(.slice(*DEFAULT_OPTIONS.keys)).compact end |
Instance Method Details
#to_hash ⇒ Object
22 23 24 |
# File 'lib/inst_llm/parameter/claude_parameters.rb', line 22 def to_hash { model_id: @model, body: { messages: @messages }.merge(@options).to_json } end |