Class: Ollama::Providers::Base
- Inherits:
-
Object
- Object
- Ollama::Providers::Base
- Defined in:
- lib/ollama/providers/base.rb
Overview
Base class for API providers (Ollama, OpenAI, etc.)
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#transport ⇒ Object
readonly
Returns the value of attribute transport.
Instance Method Summary collapse
- #chat_endpoint ⇒ Object abstract
- #embeddings_endpoint ⇒ Object abstract
- #format_chat_request(params) ⇒ Object abstract
- #format_embeddings_request(params) ⇒ Object abstract
- #format_generate_request(params) ⇒ Object abstract
- #generate_endpoint ⇒ Object abstract
-
#initialize(config, transport) ⇒ Base
constructor
A new instance of Base.
- #models_endpoint ⇒ Object abstract
- #normalize_chat_response(response_data) ⇒ Object abstract
- #normalize_embeddings_response(response_data) ⇒ Object abstract
- #normalize_generate_response(response_data) ⇒ Object abstract
- #normalize_models_response(response_data) ⇒ Object abstract
Constructor Details
#initialize(config, transport) ⇒ Base
Returns a new instance of Base.
9 10 11 12 |
# File 'lib/ollama/providers/base.rb', line 9 def initialize(config, transport) @config = config @transport = transport end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
7 8 9 |
# File 'lib/ollama/providers/base.rb', line 7 def config @config end |
#transport ⇒ Object (readonly)
Returns the value of attribute transport.
7 8 9 |
# File 'lib/ollama/providers/base.rb', line 7 def transport @transport end |
Instance Method Details
#chat_endpoint ⇒ Object
This method is abstract.
15 16 17 |
# File 'lib/ollama/providers/base.rb', line 15 def chat_endpoint raise NotImplementedError end |
#embeddings_endpoint ⇒ Object
This method is abstract.
25 26 27 |
# File 'lib/ollama/providers/base.rb', line 25 def raise NotImplementedError end |
#format_chat_request(params) ⇒ Object
This method is abstract.
35 36 37 |
# File 'lib/ollama/providers/base.rb', line 35 def format_chat_request(params) raise NotImplementedError end |
#format_embeddings_request(params) ⇒ Object
This method is abstract.
45 46 47 |
# File 'lib/ollama/providers/base.rb', line 45 def (params) raise NotImplementedError end |
#format_generate_request(params) ⇒ Object
This method is abstract.
40 41 42 |
# File 'lib/ollama/providers/base.rb', line 40 def format_generate_request(params) raise NotImplementedError end |
#generate_endpoint ⇒ Object
This method is abstract.
20 21 22 |
# File 'lib/ollama/providers/base.rb', line 20 def generate_endpoint raise NotImplementedError end |
#models_endpoint ⇒ Object
This method is abstract.
30 31 32 |
# File 'lib/ollama/providers/base.rb', line 30 def models_endpoint raise NotImplementedError end |
#normalize_chat_response(response_data) ⇒ Object
This method is abstract.
50 51 52 |
# File 'lib/ollama/providers/base.rb', line 50 def normalize_chat_response(response_data) raise NotImplementedError end |
#normalize_embeddings_response(response_data) ⇒ Object
This method is abstract.
60 61 62 |
# File 'lib/ollama/providers/base.rb', line 60 def (response_data) raise NotImplementedError end |
#normalize_generate_response(response_data) ⇒ Object
This method is abstract.
55 56 57 |
# File 'lib/ollama/providers/base.rb', line 55 def normalize_generate_response(response_data) raise NotImplementedError end |
#normalize_models_response(response_data) ⇒ Object
This method is abstract.
65 66 67 |
# File 'lib/ollama/providers/base.rb', line 65 def normalize_models_response(response_data) raise NotImplementedError end |