Class: SavvyOpenrouter::Resources::Embeddings

Inherits:
Base
  • Object
show all
Defined in:
lib/savvy_openrouter/resources/embeddings.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from SavvyOpenrouter::Resources::Base

Instance Method Details

#create(**params) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/savvy_openrouter/resources/embeddings.rb', line 8

def create(**params)
  body = config.merge_chat_body(params)
  lm = logical_model_from_body(body)
  conn.with_call_context(endpoint: "embeddings", logical_model: lm) do
    conn.post("/embeddings", body: body)
  end
end

#modelsObject



16
17
18
19
20
# File 'lib/savvy_openrouter/resources/embeddings.rb', line 16

def models
  conn.with_call_context(endpoint: "embeddings_models", logical_model: nil) do
    conn.get("/embeddings/models")
  end
end