Class: LlmHub::Common::ClientBase
- Inherits:
-
Object
- Object
- LlmHub::Common::ClientBase
- Includes:
- HttpHelper
- Defined in:
- lib/llm_hub/common/client_base.rb
Overview
Base client class for LLM providers Provides common functionality for API clients including HTTP requests, retry logic, and provider initialization
Direct Known Subclasses
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#open_time_out ⇒ Object
readonly
Returns the value of attribute open_time_out.
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
-
#read_time_out ⇒ Object
readonly
Returns the value of attribute read_time_out.
-
#retry_count ⇒ Object
readonly
Returns the value of attribute retry_count.
Instance Method Summary collapse
-
#initialize(api_key:, provider:, open_time_out: nil, read_time_out: nil, retry_count: nil) ⇒ ClientBase
constructor
Initialize a new client.
Methods included from HttpHelper
Constructor Details
#initialize(api_key:, provider:, open_time_out: nil, read_time_out: nil, retry_count: nil) ⇒ ClientBase
Initialize a new client
19 20 21 22 23 24 25 |
# File 'lib/llm_hub/common/client_base.rb', line 19 def initialize(api_key:, provider:, open_time_out: nil, read_time_out: nil, retry_count: nil) @api_key = api_key @provider = provider @open_time_out = open_time_out || LlmHub::Config::DEFAULT_OPEN_TIME_OUT @read_time_out = read_time_out || LlmHub::Config::DEFAULT_READ_TIME_OUT @retry_count = retry_count || LlmHub::Config::DEFAULT_RETRY_COUNT end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
11 12 13 |
# File 'lib/llm_hub/common/client_base.rb', line 11 def api_key @api_key end |
#open_time_out ⇒ Object (readonly)
Returns the value of attribute open_time_out.
11 12 13 |
# File 'lib/llm_hub/common/client_base.rb', line 11 def open_time_out @open_time_out end |
#provider ⇒ Object (readonly)
Returns the value of attribute provider.
11 12 13 |
# File 'lib/llm_hub/common/client_base.rb', line 11 def provider @provider end |
#read_time_out ⇒ Object (readonly)
Returns the value of attribute read_time_out.
11 12 13 |
# File 'lib/llm_hub/common/client_base.rb', line 11 def read_time_out @read_time_out end |
#retry_count ⇒ Object (readonly)
Returns the value of attribute retry_count.
11 12 13 |
# File 'lib/llm_hub/common/client_base.rb', line 11 def retry_count @retry_count end |