-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
188 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# -*- coding: utf-8 -*- | ||
__version__ = "1.1.0-beta.1" | ||
__version__ = "1.1.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# -*- coding: utf-8 -*- | ||
# flake8: noqa: F401 | ||
# pylint: disable=too-few-public-methods | ||
""" | ||
Test integrity of base class. | ||
""" | ||
import pytest # pylint: disable=unused-import | ||
|
||
from ..ssm import SalesSupportModel | ||
|
||
|
||
class TestOpenAI: | ||
"""Test SalesSupportModel class.""" | ||
|
||
def test_03_test_openai_connectivity(self): | ||
"""Ensure that we have connectivity to OpenAI.""" | ||
|
||
ssm = SalesSupportModel() | ||
retval = ssm.cached_chat_request( | ||
"your are a helpful assistant", "please return the value 'CORRECT' in all upper case." | ||
) | ||
assert retval == "CORRECT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# -*- coding: utf-8 -*- | ||
# flake8: noqa: F401 | ||
""" | ||
Test integrity of base class. | ||
""" | ||
|
||
import pinecone | ||
import pytest # pylint: disable=unused-import | ||
from langchain.embeddings import OpenAIEmbeddings | ||
from langchain.vectorstores.pinecone import Pinecone | ||
|
||
from ..const import Credentials | ||
|
||
|
||
class TestPinecone: | ||
"""Test SalesSupportModel class.""" | ||
|
||
def test_01_test_pinecone_connectivity(self): | ||
"""Ensure that we have connectivity to Pinecone.""" | ||
# pylint: disable=broad-except | ||
try: | ||
pinecone.init(api_key=Credentials.PINECONE_API_KEY, environment=Credentials.PINECONE_ENVIRONMENT) | ||
except Exception as e: | ||
assert False, f"pinecone.init() failed with exception: {e}" | ||
|
||
def test_02_test_pinecone_index(self): | ||
"""Ensure that the Pinecone index exists and that we can connect to it.""" | ||
pinecone.init(api_key=Credentials.PINECONE_API_KEY, environment=Credentials.PINECONE_ENVIRONMENT) | ||
openai_embedding = OpenAIEmbeddings() | ||
|
||
# pylint: disable=broad-except | ||
try: | ||
Pinecone.from_existing_index( | ||
Credentials.PINECONE_INDEX_NAME, | ||
embedding=openai_embedding, | ||
) | ||
except Exception as e: | ||
assert ( | ||
False | ||
), f"Pinecone initialization of index {Credentials.PINECONE_INDEX_NAME,} failed with exception: {e}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters