Class: EmbeddingUtil::Providers::SelfHosted
Instance Attribute Summary
#config
Instance Method Summary
collapse
#initialize, provider_name, #provider_name, supported?
Instance Method Details
#embed(texts, profile: config.resolved_profile) ⇒ Object
24
25
26
27
|
# File 'lib/embedding_util/providers/self_hosted.rb', line 24
def embed(texts, profile: config.resolved_profile)
endpoint = ServerManager.new(config: config).ensure_server(:embedding, profile: profile)
endpoint_provider(embedding_endpoint: endpoint).embed(texts, profile: profile)
end
|
#rerank(query, documents, profile: config.resolved_profile) ⇒ Object
29
30
31
32
|
# File 'lib/embedding_util/providers/self_hosted.rb', line 29
def rerank(query, documents, profile: config.resolved_profile)
endpoint = ServerManager.new(config: config).ensure_server(:reranker, profile: profile)
endpoint_provider(reranker_endpoint: endpoint).rerank(query, documents, profile: profile)
end
|
#support ⇒ Object
14
15
16
17
18
19
20
21
22
|
# File 'lib/embedding_util/providers/self_hosted.rb', line 14
def support
{
provider: provider_name,
supported: supported?,
runtime: RuntimeCommand.resolve(config.runtime),
shutdown_idle: config.shutdown_idle,
state_dir: config.state_dir
}
end
|
#supported? ⇒ Boolean
10
11
12
|
# File 'lib/embedding_util/providers/self_hosted.rb', line 10
def supported?
ServerManager.supported?(config)
end
|