Class: RerankerRuby::Base
- Inherits:
-
Object
- Object
- RerankerRuby::Base
- Defined in:
- lib/reranker_ruby/base.rb
Instance Method Summary collapse
-
#initialize(api_key: nil, cache: nil, timeout: nil, max_retries: nil) ⇒ Base
constructor
A new instance of Base.
- #rerank(query, documents, top_k: 10) ⇒ Object
Constructor Details
#initialize(api_key: nil, cache: nil, timeout: nil, max_retries: nil) ⇒ Base
Returns a new instance of Base.
16 17 18 19 20 21 22 23 |
# File 'lib/reranker_ruby/base.rb', line 16 def initialize(api_key: nil, cache: nil, timeout: nil, max_retries: nil) @api_key = api_key @cache = cache @timeout = timeout || 30 @max_retries = max_retries || 3 @connections = {} @conn_mutex = Mutex.new end |
Instance Method Details
#rerank(query, documents, top_k: 10) ⇒ Object
25 26 27 |
# File 'lib/reranker_ruby/base.rb', line 25 def rerank(query, documents, top_k: 10) raise NotImplementedError, "#{self.class}#rerank must be implemented" end |