Skip to content

Commit

Permalink
fix: retrieve and generate test method
Browse files Browse the repository at this point in the history
  • Loading branch information
KevKibe committed Apr 30, 2024
1 parent 0f8469c commit aa826f3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 25 deletions.
12 changes: 0 additions & 12 deletions src/_openai/config.py

This file was deleted.

18 changes: 9 additions & 9 deletions src/tests/cohereindex_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ def test_03_initialize_vectorstore(self):
vectorstore = self.indexer.initialize_vectorstore(self.index_name)
self.assertIsInstance(vectorstore, PineconeVectorStore)

def test_04_retrieve_and_generate(self):
"""
Test initializing the vector store and assert its type.
"""
response = self.indexer.retrieve_and_generate(query = "what is the title of the document",
index_name= self.index_name
)
print(response)
self.assertIsNotNone(response, "The retriever response should not be None.")
# def test_04_retrieve_and_generate(self):
# """
# Test initializing the vector store and assert its type.
# """
# response = self.indexer.retrieve_and_generate(query = "what is the title of the document",
# index_name= self.index_name
# )
# print(response)
# self.assertIsNotNone(response, "The retriever response should not be None.")

@patch('sys.stdout', new_callable=StringIO)
def test_05_delete_index(self, mock_stdout):
Expand Down
3 changes: 2 additions & 1 deletion src/tests/googleindex_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ def test_04_retrieve_and_generate(self):
"""
Test initializing the vector store and assert its type.
"""
vectorstore = self.indexer.initialize_vectorstore(self.index_name)
response = self.indexer.retrieve_and_generate(query = "give a short summary of the introduction",
index_name= self.index_name
vectorstore= vectorstore
)
print(response)
self.assertIsNotNone(response, "The retriever response should not be None.")
Expand Down
5 changes: 2 additions & 3 deletions src/tests/openaiindex_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from dotenv import load_dotenv
load_dotenv()


class TestOpenaiPineconeIndexer(unittest.TestCase):
"""
Test case class for the OpenaiPineconeIndexer.
Expand Down Expand Up @@ -63,10 +62,10 @@ def test_04_retrieve_and_generate(self):
"""
Test initializing the vector store and assert its type.
"""
vectorstore = self.indexer.initialize_vectorstore(self.index_name)
response = self.indexer.retrieve_and_generate(query = "give a short summary of the introduction",
index_name= self.index_name
vector_store = vectorstore
)
print(response)
self.assertIsNotNone(response, "The retriever response should not be None.")

@patch('sys.stdout', new_callable=StringIO)
Expand Down

0 comments on commit aa826f3

Please sign in to comment.