Class: ActiveAgent::Providers::Common::Responses::Embed

Inherits:
Base
  • Object
show all
Defined in:
lib/active_agent/providers/common/responses/embed.rb

Overview

Response model for embedding responses

This class represents responses from embedding endpoints. It includes the embedding data, the original context, raw API data, and usage statistics.

Example

response = EmbedResponse.new(
  context: context_hash,
  data: [embedding_array],
  raw_response: { "usage" => { "prompt_tokens" => 10 } }
)

response.data           #=> [[0.1, 0.2, ...]]
response.prompt_tokens  #=> 10
response.usage          #=> { "prompt_tokens" => 10, ... }

Instance Attribute Summary

Attributes inherited from Base

#context, #raw_request, #raw_response, #usages

Method Summary

Methods inherited from Base

#finish_reason, #id, #initialize, #instructions, #model, #success?, #usage

Methods inherited from BaseModel

#<=>, #==, attribute, #deep_compact, #deep_dup, delegate_attributes, drop_attributes, inherited, #initialize, #inspect, keys, #merge!, required_attributes, #serialize, #to_h, #to_hash

Constructor Details

This class inherits a constructor from ActiveAgent::Providers::Common::Responses::Base