From a0b1cbe47297ed8ad5eeadcd5288a345f89d4f74 Mon Sep 17 00:00:00 2001 From: KevKibe Date: Wed, 5 Jun 2024 11:12:20 +0300 Subject: [PATCH] fix: remove api_provider parameter from retrieve_and_generate method --- src/_cohere/doc_index.py | 7 ++----- src/_google/doc_index.py | 7 ++----- src/_openai/doc_index.py | 7 ++----- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/_cohere/doc_index.py b/src/_cohere/doc_index.py index 343ed9a..b201b6b 100644 --- a/src/_cohere/doc_index.py +++ b/src/_cohere/doc_index.py @@ -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. @@ -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. @@ -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( diff --git a/src/_google/doc_index.py b/src/_google/doc_index.py index c8d07f9..eb32129 100644 --- a/src/_google/doc_index.py +++ b/src/_google/doc_index.py @@ -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. @@ -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. @@ -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( diff --git a/src/_openai/doc_index.py b/src/_openai/doc_index.py index f20d056..ef572d5 100644 --- a/src/_openai/doc_index.py +++ b/src/_openai/doc_index.py @@ -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. @@ -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. @@ -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(