From ee85f5a2150b98372581f010f072249abf6e839f Mon Sep 17 00:00:00 2001 From: lpm0073 Date: Fri, 1 Dec 2023 13:36:09 -0600 Subject: [PATCH] style: rename main class to HybridSearchRetriever --- models/examples/load.py | 4 ++-- models/examples/prompt.py | 4 ++-- models/examples/rag.py | 4 ++-- models/examples/training_services.py | 4 ++-- models/examples/training_services_oracle.py | 4 ++-- models/ssm.py | 2 +- models/tests/test_openai.py | 6 +++--- models/tests/test_pinecone.py | 2 +- models/tests/test_prompt_templates.py | 2 +- models/tests/test_prompts.py | 6 +++--- models/tests/test_ssm.py | 10 +++++----- 11 files changed, 24 insertions(+), 24 deletions(-) diff --git a/models/examples/load.py b/models/examples/load.py index 74552cd..465c840 100644 --- a/models/examples/load.py +++ b/models/examples/load.py @@ -2,10 +2,10 @@ """Sales Support Model (SSM) Retrieval Augmented Generation (RAG)""" import argparse -from ..ssm import SalesSupportModel +from ..ssm import HybridSearchRetriever -ssm = SalesSupportModel() +ssm = HybridSearchRetriever() if __name__ == "__main__": parser = argparse.ArgumentParser(description="RAG example") diff --git a/models/examples/prompt.py b/models/examples/prompt.py index b25636c..a1a1d9a 100644 --- a/models/examples/prompt.py +++ b/models/examples/prompt.py @@ -2,10 +2,10 @@ """Sales Support Model (SSM)""" import argparse -from ..ssm import SalesSupportModel +from ..ssm import HybridSearchRetriever -ssm = SalesSupportModel() +ssm = HybridSearchRetriever() if __name__ == "__main__": diff --git a/models/examples/rag.py b/models/examples/rag.py index 1171df2..67143be 100644 --- a/models/examples/rag.py +++ b/models/examples/rag.py @@ -2,10 +2,10 @@ """Sales Support Model (SSM) Retrieval Augmented Generation (RAG)""" import argparse -from ..ssm import SalesSupportModel +from ..ssm import HybridSearchRetriever -ssm = SalesSupportModel() +ssm = HybridSearchRetriever() if __name__ == "__main__": parser = argparse.ArgumentParser(description="RAG example") diff --git a/models/examples/training_services.py b/models/examples/training_services.py index 17f9aba..1cdcd31 100644 --- a/models/examples/training_services.py +++ b/models/examples/training_services.py @@ -3,10 +3,10 @@ import argparse from ..prompt_templates import NetecPromptTemplates -from ..ssm import SalesSupportModel +from ..ssm import HybridSearchRetriever -ssm = SalesSupportModel() +ssm = HybridSearchRetriever() templates = NetecPromptTemplates() if __name__ == "__main__": diff --git a/models/examples/training_services_oracle.py b/models/examples/training_services_oracle.py index 44ff9f8..4c477c3 100644 --- a/models/examples/training_services_oracle.py +++ b/models/examples/training_services_oracle.py @@ -3,10 +3,10 @@ import argparse from ..prompt_templates import NetecPromptTemplates -from ..ssm import SalesSupportModel +from ..ssm import HybridSearchRetriever -ssm = SalesSupportModel() +ssm = HybridSearchRetriever() templates = NetecPromptTemplates() if __name__ == "__main__": diff --git a/models/ssm.py b/models/ssm.py index 145a8fb..2ce181d 100644 --- a/models/ssm.py +++ b/models/ssm.py @@ -64,7 +64,7 @@ def create_documents(self, texts): return documents -class SalesSupportModel: +class HybridSearchRetriever: """Sales Support Model (SSM).""" # prompting wrapper diff --git a/models/tests/test_openai.py b/models/tests/test_openai.py index c9110a6..8b9beae 100644 --- a/models/tests/test_openai.py +++ b/models/tests/test_openai.py @@ -6,16 +6,16 @@ """ import pytest # pylint: disable=unused-import -from ..ssm import SalesSupportModel +from ..ssm import HybridSearchRetriever class TestOpenAI: - """Test SalesSupportModel class.""" + """Test HybridSearchRetriever class.""" def test_03_test_openai_connectivity(self): """Ensure that we have connectivity to OpenAI.""" - ssm = SalesSupportModel() + ssm = HybridSearchRetriever() retval = ssm.cached_chat_request( "your are a helpful assistant", "please return the value 'CORRECT' in all upper case." ) diff --git a/models/tests/test_pinecone.py b/models/tests/test_pinecone.py index 8b5fc44..ac33a04 100644 --- a/models/tests/test_pinecone.py +++ b/models/tests/test_pinecone.py @@ -13,7 +13,7 @@ class TestPinecone: - """Test SalesSupportModel class.""" + """Test HybridSearchRetriever class.""" def test_01_test_pinecone_connectivity(self): """Ensure that we have connectivity to Pinecone.""" diff --git a/models/tests/test_prompt_templates.py b/models/tests/test_prompt_templates.py index 953236c..480531f 100644 --- a/models/tests/test_prompt_templates.py +++ b/models/tests/test_prompt_templates.py @@ -11,7 +11,7 @@ class TestPromptTemplates: - """Test SalesSupportModel class.""" + """Test HybridSearchRetriever class.""" def test_01_prompt_with_template(self): """Ensure that all properties of the template class are PromptTemplate instances.""" diff --git a/models/tests/test_prompts.py b/models/tests/test_prompts.py index 6220b5f..832f56f 100644 --- a/models/tests/test_prompts.py +++ b/models/tests/test_prompts.py @@ -6,13 +6,13 @@ import pytest # pylint: disable=unused-import from ..prompt_templates import NetecPromptTemplates -from ..ssm import SalesSupportModel +from ..ssm import HybridSearchRetriever class TestPrompts: - """Test SalesSupportModel class.""" + """Test HybridSearchRetriever class.""" - ssm = SalesSupportModel() + ssm = HybridSearchRetriever() templates = NetecPromptTemplates() def test_oracle_training_services(self): diff --git a/models/tests/test_ssm.py b/models/tests/test_ssm.py index ebb8576..bb251e2 100644 --- a/models/tests/test_ssm.py +++ b/models/tests/test_ssm.py @@ -8,25 +8,25 @@ from langchain.embeddings import OpenAIEmbeddings from pinecone import Index -from models.ssm import SalesSupportModel, TextSplitter +from models.ssm import HybridSearchRetriever, TextSplitter class TestSalesSupportModel: - """Test SalesSupportModel class.""" + """Test HybridSearchRetriever class.""" def test_01_basic(self): """Ensure that we can instantiate the class.""" # pylint: disable=broad-except try: - SalesSupportModel() + HybridSearchRetriever() except Exception as e: - assert False, f"initialization of SalesSupportModel() failed with exception: {e}" + assert False, f"initialization of HybridSearchRetriever() failed with exception: {e}" def test_02_class_aatribute_types(self): """ensure that class attributes are of the correct type""" - ssm = SalesSupportModel() + ssm = HybridSearchRetriever() assert isinstance(ssm.chat, ChatOpenAI) assert isinstance(ssm.pinecone_index, Index) assert isinstance(ssm.text_splitter, TextSplitter)