Class: GroqRuby::Resources::Embeddings
- Defined in:
- lib/groq_ruby/resources/embeddings.rb
Overview
‘client.embeddings.create(…)` — turns text into vectors.
Constant Summary collapse
- PATH =
"/openai/v1/embeddings".freeze
- SCHEMA =
Dry::Schema.define do required(:model).filled(:string) required(:input) optional(:encoding_format).filled(:string, included_in?: %w[float base64]) optional(:user).maybe(:string) end
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from GroqRuby::Resources::Base
Instance Method Details
#create(**params) ⇒ GroqRuby::Models::CreateEmbeddingResponse
21 22 23 24 25 |
# File 'lib/groq_ruby/resources/embeddings.rb', line 21 def create(**params) body = validate!(SCHEMA, params) payload = perform(Request.new(method: :post, path: PATH, body: body)) GroqRuby::Models::CreateEmbeddingResponse.from_hash(payload) end |