Skip to content

Commit

Permalink
fix: remove api_provider parameter from retrieve_and_generate method
Browse files Browse the repository at this point in the history
  • Loading branch information
KevKibe committed Jun 5, 2024
1 parent 6fdecf2 commit a0b1cbe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
7 changes: 2 additions & 5 deletions src/_cohere/doc_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,7 @@ def retrieve_and_generate(
rerank_model: str = 'flashrank',
model_type: Optional[str] = None,
lang: Optional[str] = None,
api_key: Optional[str] = None,
api_provider: Optional[str] = None,
api_key: Optional[str] = None
) -> QueryResult:
"""
Retrieve documents from the Pinecone index and generate a response.
Expand All @@ -256,7 +255,6 @@ def retrieve_and_generate(
model_type (str, optional): The type of the model (e.g., 'cross-encoder', 'flashrank', 't5', etc.).
lang (str, optional): The language for multilingual models.
api_key (str, optional): The API key for models accessed through an API.
api_provider (str, optional): The provider of the API.
Returns:
QueryResult: A Pydantic model representing the generated response.
Expand All @@ -274,8 +272,7 @@ def retrieve_and_generate(
rerank_model,
model_type,
lang,
api_key,
api_provider
api_key
)
compressor = ranker.as_langchain_compressor(k=top_k)
compression_retriever = ContextualCompressionRetriever(
Expand Down
7 changes: 2 additions & 5 deletions src/_google/doc_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,7 @@ def retrieve_and_generate(
rerank_model: str = 'flashrank',
model_type: Optional[str] = None,
lang: Optional[str] = None,
api_key: Optional[str] = None,
api_provider: Optional[str] = None,
api_key: Optional[str] = None
) -> QueryResult:
"""
Retrieve documents from the Pinecone index and generate a response.
Expand All @@ -269,7 +268,6 @@ def retrieve_and_generate(
model_type (str, optional): The type of the model (e.g., 'cross-encoder', 'flashrank', 't5', etc.).
lang (str, optional): The language for multilingual models.
api_key (str, optional): The API key for models accessed through an API.
api_provider (str, optional): The provider of the API.
Returns:
QueryResult: A Pydantic model representing the generated response.
Expand All @@ -287,8 +285,7 @@ def retrieve_and_generate(
rerank_model,
model_type,
lang,
api_key,
api_provider
api_key
)
compressor = ranker.as_langchain_compressor(k=top_k)
compression_retriever = ContextualCompressionRetriever(
Expand Down
7 changes: 2 additions & 5 deletions src/_openai/doc_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ def retrieve_and_generate(
model_type: Optional[str] = None,
lang: Optional[str] = None,
api_key: Optional[str] = None,
api_provider: Optional[str] = None,
) -> QueryResult:
"""
Retrieve documents from the Pinecone index and generate a response.
Expand All @@ -268,7 +267,6 @@ def retrieve_and_generate(
model_type (str, optional): The type of the model (e.g., 'cross-encoder', 'flashrank', 't5', etc.).
lang (str, optional): The language for multilingual models.
api_key (str, optional): The API key for models accessed through an API.
api_provider (str, optional): The provider of the API.
Returns:
QueryResult: A Pydantic model representing the generated response.
Expand All @@ -284,10 +282,9 @@ def retrieve_and_generate(
retriever = vector_store.as_retriever()
ranker = RerankerConfig.get_ranker(
rerank_model,
model_type,
lang,
api_key,
api_provider
api_key,
model_type,
)
compressor = ranker.as_langchain_compressor(k=top_k)
compression_retriever = ContextualCompressionRetriever(
Expand Down

0 comments on commit a0b1cbe

Please sign in to comment.