Class: Roseflow::OpenAI::OperationHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/roseflow/openai/operation_handler.rb

Constant Summary collapse

OPERATION_CLASSES =
{
  chat: Operations::Chat,
  completion: Operations::Completion,
  embedding: Operations::Embedding,
  image: Operations::Image,
  image_edit: Operations::ImageEdit,
  image_variation: Operations::ImageVariation,
}

Instance Method Summary collapse

Constructor Details

#initialize(operation, options = {}) ⇒ OperationHandler

Returns a new instance of OperationHandler.



22
23
24
25
# File 'lib/roseflow/openai/operation_handler.rb', line 22

def initialize(operation, options = {})
  @operation = operation
  @options = options
end

Instance Method Details

#callObject



27
28
29
# File 'lib/roseflow/openai/operation_handler.rb', line 27

def call
  operation_class.new(@options)
end