Class: ActiveAgent::Providers::RequestyProvider

Inherits:
OpenAI::ChatProvider show all
Defined in:
lib/active_agent/providers/requesty_provider.rb

Overview

Provides access to Requesty's OpenAI-compatible LLM gateway.

Extends the OpenAI provider to work with Requesty's OpenAI-compatible API, enabling access to multiple AI models through a single interface using the provider/model naming convention (e.g. openai/gpt-4o-mini).

Requesty is a plain OpenAI-compatible gateway: requests, responses and transforms are identical to the OpenAI Chat API, so this provider reuses OpenAI::Chat::RequestType and OpenAI::Chat::Transforms directly. The only Requesty-specific configuration is the base URL and API key, which live in Requesty::Options.

Examples:

Configuration in active_agent.yml

requesty:
  service: "Requesty"
  api_key: <%= ENV["REQUESTY_API_KEY"] %>
  model: "openai/gpt-4o-mini"

See Also:

Class Method Summary collapse

Methods included from ToolChoiceClearing

#prepare_prompt_request_tools

Methods inherited from OpenAI::Base

#client

Methods inherited from BaseProvider

#embed, #initialize, namespace, #preview, #prompt, tag_name

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

.embed_request_typeActiveModel::Type::Value

Returns:

  • (ActiveModel::Type::Value)


47
48
49
# File 'lib/active_agent/providers/requesty_provider.rb', line 47

def self.embed_request_type
  OpenAI::Embedding::RequestType.new
end

.options_klassClass

Returns:

  • (Class)


37
38
39
# File 'lib/active_agent/providers/requesty_provider.rb', line 37

def self.options_klass
  Requesty::Options
end

.prompt_request_typeActiveModel::Type::Value

Returns:

  • (ActiveModel::Type::Value)


42
43
44
# File 'lib/active_agent/providers/requesty_provider.rb', line 42

def self.prompt_request_type
  OpenAI::Chat::RequestType.new
end

.service_nameString

Returns:

  • (String)


32
33
34
# File 'lib/active_agent/providers/requesty_provider.rb', line 32

def self.service_name
  "Requesty"
end