Class: ActiveAgent::Providers::OpenAI::Base

Inherits:
BaseProvider show all
Defined in:
lib/active_agent/providers/open_ai/_base.rb

Overview

Base provider class for OpenAI API implementations.

Provides common functionality for OpenAI-based providers including client configuration, service identification, and tool call processing.

See Also:

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseProvider

#embed, embed_request_type, #initialize, namespace, options_klass, #preview, #prompt, prompt_request_type, tag_name

Methods included from ToolChoiceClearing

#prepare_prompt_request_tools

Methods included from Previewable

#preview_prompt

Methods included from Instrumentation

#instrumentation_prompt_payload

Methods included from ExceptionHandler

#configure_exception_handler, #rescue_with_handler, #with_exception_handling

Constructor Details

This class inherits a constructor from ActiveAgent::Providers::BaseProvider

Class Method Details

.service_nameString

Returns the service name for OpenAI providers.

Returns:

  • (String)

    Always returns “OpenAI”



20
21
22
# File 'lib/active_agent/providers/open_ai/_base.rb', line 20

def self.service_name
  "OpenAI"
end

Instance Method Details

#clientOpenAI::Client

Returns a configured OpenAI client instance.

Returns:

  • (OpenAI::Client)

    The configured OpenAI client



27
28
29
# File 'lib/active_agent/providers/open_ai/_base.rb', line 27

def client
  ::OpenAI::Client.new(**options.serialize)
end