Skip to content

Commit

Permalink
style: rename main class to HybridSearchRetriever
Browse files Browse the repository at this point in the history
  • Loading branch information
lpm0073 committed Dec 1, 2023
1 parent 9e4555a commit ee85f5a
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions models/examples/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions models/examples/prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__":
Expand Down
4 changes: 2 additions & 2 deletions models/examples/rag.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions models/examples/training_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__":
Expand Down
4 changes: 2 additions & 2 deletions models/examples/training_services_oracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__":
Expand Down
2 changes: 1 addition & 1 deletion models/ssm.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def create_documents(self, texts):
return documents


class SalesSupportModel:
class HybridSearchRetriever:
"""Sales Support Model (SSM)."""

# prompting wrapper
Expand Down
6 changes: 3 additions & 3 deletions models/tests/test_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
)
Expand Down
2 changes: 1 addition & 1 deletion models/tests/test_pinecone.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
2 changes: 1 addition & 1 deletion models/tests/test_prompt_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
6 changes: 3 additions & 3 deletions models/tests/test_prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
10 changes: 5 additions & 5 deletions models/tests/test_ssm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ee85f5a

Please sign in to comment.