Skip to content

Commit

Permalink
Add additional None type check (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
TilmanGriesel authored Jan 18, 2025
1 parent 66a6305 commit e0e554d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions services/api/src/core/component_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,13 @@ def create_retriever(self) -> ElasticsearchEmbeddingRetriever:
document_store=self.document_store,
top_k=(
self.config.es_top_k
if self.config.es_top_k and self.config.es_top_k > 0
if self.config.es_top_k is not None and self.config.es_top_k > 0
else None
),
num_candidates=(
self.config.es_num_candidates
if self.config.es_num_candidates and self.config.es_num_candidates > 0
if self.config.es_num_candidates is not None
and self.config.es_num_candidates > 0
else None
),
)
Expand Down

0 comments on commit e0e554d

Please sign in to comment.