Class: Boxcars::Together

Inherits:
IntelligenceBase show all
Defined in:
lib/boxcars/engine/together.rb

Overview

A engine that uses Google’s API

Constant Summary collapse

DEFAULT_PARAMS =

The default parameters to use when asking the engine

{
  model: "deepseek-ai/DeepSeek-R1-Distill-Llama-70B",
  temperature: 0.1
}.freeze
DEFAULT_NAME =

the default name of the engine

"DeepSeek R1 Distill Llama 70B AI engine"
DEFAULT_DESCRIPTION =

the default description of the engine

"useful for when you need to use DeepSeek AI to process complex content. " \
"Supports text, images, and other content types"

Instance Attribute Summary

Attributes inherited from IntelligenceBase

#all_params, #provider

Attributes inherited from Engine

#batch_size, #prompts, #user_id

Instance Method Summary collapse

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) ⇒ Together

A DeepSeek Engine is used by Boxcars to generate output from prompts

Parameters:

  • name (String) (defaults to: DEFAULT_NAME)

    The name of the Engine. Defaults to classname.

  • description (String) (defaults to: DEFAULT_DESCRIPTION)

    A description of the Engine.

  • prompts (Array<Prompt>) (defaults to: [])

    The prompts to use for the Engine.

  • batch_size (Integer) (defaults to: 20)

    The number of prompts to send to the Engine at a time.

  • kwargs (Hash)

    Additional parameters to pass to the Engine.



24
25
26
# File 'lib/boxcars/engine/together.rb', line 24

def initialize(name: DEFAULT_NAME, description: DEFAULT_DESCRIPTION, prompts: [], batch_size: 20, **)
  super(provider: :together_ai, description:, name:, prompts:, batch_size:, **)
end

Instance Method Details

#default_model_paramsObject



28
29
30
# File 'lib/boxcars/engine/together.rb', line 28

def default_model_params
  DEFAULT_PARAMS
end

#lookup_provider_api_key(params:) ⇒ Object



32
33
34
# File 'lib/boxcars/engine/together.rb', line 32

def lookup_provider_api_key(params:)
  Boxcars.configuration.together_api_key(**params)
end