Class: Boxcars::Cerebras
- Inherits:
-
IntelligenceBase
- Object
- Engine
- IntelligenceBase
- Boxcars::Cerebras
- Defined in:
- lib/boxcars/engine/cerebras.rb
Overview
A engine that uses Cerebras’s API
Constant Summary collapse
- DEFAULT_PARAMS =
The default parameters to use when asking the engine
{ model: "llama-3.3-70b", temperature: 0.1 }.freeze
- DEFAULT_NAME =
the default name of the engine
"Cerebras engine"- DEFAULT_DESCRIPTION =
the default description of the engine
"useful for when you need to use Cerebras to process complex content. " \ "Supports text, images, and other content types"
Instance Attribute Summary
Attributes inherited from IntelligenceBase
Attributes inherited from Engine
#batch_size, #prompts, #user_id
Instance Method Summary collapse
- #default_model_params ⇒ Object
-
#initialize(name: DEFAULT_NAME, description: DEFAULT_DESCRIPTION, prompts: [], batch_size: 20) ⇒ Cerebras
constructor
A Cerebras Engine is used by Boxcars to generate output from prompts.
- #lookup_provider_api_key(params:) ⇒ Object
Methods inherited from IntelligenceBase
#adapter, #client, #process_content, #run, #validate_content
Methods inherited from Engine
#extract_answer, #generate, #generation_info, #get_num_tokens, #run, #validate_response!
Constructor Details
#initialize(name: DEFAULT_NAME, description: DEFAULT_DESCRIPTION, prompts: [], batch_size: 20) ⇒ Cerebras
A Cerebras Engine is used by Boxcars to generate output from prompts
24 25 26 |
# File 'lib/boxcars/engine/cerebras.rb', line 24 def initialize(name: DEFAULT_NAME, description: DEFAULT_DESCRIPTION, prompts: [], batch_size: 20, **) super(provider: :cerebras, description:, name:, prompts:, batch_size:, **) end |
Instance Method Details
#default_model_params ⇒ Object
28 29 30 |
# File 'lib/boxcars/engine/cerebras.rb', line 28 def default_model_params DEFAULT_PARAMS end |
#lookup_provider_api_key(params:) ⇒ Object
32 33 34 |
# File 'lib/boxcars/engine/cerebras.rb', line 32 def lookup_provider_api_key(params:) Boxcars.configuration.cerebras_api_key(**params) end |