Class: OmniAI::Google::Embed

Inherits:
Embed
  • Object
show all
Defined in:
lib/omniai/google/embed.rb

Overview

An Google embed implementation.

Usage:

input = "..."
response = OmniAI::Google::Embed.process!(input, client: client)
response.embedding [0.0, ...]

Defined Under Namespace

Modules: Model

Constant Summary collapse

DEFAULT_MODEL =
Model::EMBEDDING
EMBEDDINGS_DESERIALIZER =
proc do |data, *|
  data['embeddings'].map { |embedding| embedding['values'] }
end
CONTEXT =

Returns:

  • (Context)
Context.build do |context|
  context.deserializers[:embeddings] = EMBEDDINGS_DESERIALIZER
end