Class: ActiveAgent::Providers::MockProvider

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

Overview

Mock provider for testing purposes.

This provider doesn’t make real API calls. Instead, it returns the last message content converted to pig latin for prompts, and random data for embeddings. Useful for testing without incurring API costs or requiring network access.

Examples:

Basic usage

provider = ActiveAgent::Providers::MockProvider.new(...)
result = provider.prompt

See Also:

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseProvider

#embed, #initialize, namespace, options_klass, #preview, #prompt, prompt_request_type, service_name, 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

.embed_request_typeActiveModel::Type::Value

Returns the embedding request type for Mock.

Returns:

  • (ActiveModel::Type::Value)

    The Mock embedding request type



23
24
25
# File 'lib/active_agent/providers/mock_provider.rb', line 23

def self.embed_request_type
  Mock::EmbeddingRequestType.new
end

Instance Method Details

#clientMockProvider

Returns a mock client (just returns self since we don’t need a real client).

Returns:



30
31
32
# File 'lib/active_agent/providers/mock_provider.rb', line 30

def client
  self
end