Class: RubyCanUseLLM::Providers::Voyage
- Inherits:
-
Base
- Object
- Base
- RubyCanUseLLM::Providers::Voyage
show all
- Defined in:
- lib/rubycanusellm/providers/voyage.rb
Constant Summary
collapse
- API_URL =
"https://api.voyageai.com/v1/embeddings"
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#chat(_messages, **_options) ⇒ Object
11
12
13
|
# File 'lib/rubycanusellm/providers/voyage.rb', line 11
def chat(_messages, **_options)
raise Error, "Voyage AI only supports embeddings, not chat completions"
end
|
#embed(text, **options) ⇒ Object
15
16
17
18
19
20
21
22
|
# File 'lib/rubycanusellm/providers/voyage.rb', line 15
def embed(text, **options)
body = {
model: options[:model] || "voyage-3.5",
input: text
}
response = embedding_request(body)
parse_embedding(response)
end
|