Class: EmbeddingUtil::Provider
- Inherits:
-
Object
- Object
- EmbeddingUtil::Provider
show all
- Defined in:
- lib/embedding_util/provider.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(config: EmbeddingUtil.configuration) ⇒ Provider
Returns a new instance of Provider.
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
5
6
7
|
# File 'lib/embedding_util/provider.rb', line 5
def config
@config
end
|
Class Method Details
.provider_name ⇒ Object
11
12
13
|
# File 'lib/embedding_util/provider.rb', line 11
def self.provider_name
name.split("::").last.gsub(/([a-z\d])([A-Z])/, "\\1_\\2").downcase.to_sym
end
|
.supported?(config = EmbeddingUtil.configuration) ⇒ Boolean
15
16
17
|
# File 'lib/embedding_util/provider.rb', line 15
def self.supported?(config = EmbeddingUtil.configuration)
new(config: config).supported?
end
|
Instance Method Details
#provider_name ⇒ Object
19
20
21
|
# File 'lib/embedding_util/provider.rb', line 19
def provider_name
self.class.provider_name
end
|
#support ⇒ Object
27
28
29
|
# File 'lib/embedding_util/provider.rb', line 27
def support
{ provider: provider_name, supported: supported? }
end
|
#supported? ⇒ Boolean
23
24
25
|
# File 'lib/embedding_util/provider.rb', line 23
def supported?
false
end
|