Class: OmniAI::Embed
- Inherits:
-
Object
- Object
- OmniAI::Embed
- Defined in:
- lib/omniai/embed.rb,
lib/omniai/embed/usage.rb,
lib/omniai/embed/response.rb
Overview
An abstract class that provides a consistent interface for processing embedding requests.
Usage:
class OmniAI::OpenAI::Embed < OmniAI::Embed
module Model
SMALL = "text-embedding-3-small"
LARGE = "text-embedding-3-large"
ADA = "text-embedding-3-002"
end
protected
# @return [Hash]
def payload
{ ... }
end
# @return [String]
def path
"..."
end
end
client.embed(input, model: "...")
Defined Under Namespace
Class Method Summary collapse
Instance Method Summary collapse
Constructor Details
#initialize(input, client:, model:) ⇒ Response
39 40 41 42 43 |
# File 'lib/omniai/embed.rb', line 39 def initialize(input, client:, model:) @input = input @client = client @model = model end |
Class Method Details
.process! ⇒ Object
30 31 32 |
# File 'lib/omniai/embed.rb', line 30 def self.process!(...) new(...).process! end |