From de437b82792ff7e0206d009b992e1e8e590fedde Mon Sep 17 00:00:00 2001 From: Minura Punchihewa Date: Fri, 29 Nov 2024 17:37:37 +0530 Subject: [PATCH 1/3] pinned new version of openai --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d44ac3b..481f7e7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ pydantic==2.8.2 requests -openai == 1.24.0 +openai == 1.55.3 From cb35849514a41d733fbfca0e8280feed04eb2e90 Mon Sep 17 00:00:00 2001 From: Minura Punchihewa Date: Fri, 29 Nov 2024 19:14:09 +0530 Subject: [PATCH 2/3] fixed a few broken unit tests --- tests/unit/test_unit.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/unit/test_unit.py b/tests/unit/test_unit.py index daeac79..2d754dc 100644 --- a/tests/unit/test_unit.py +++ b/tests/unit/test_unit.py @@ -53,7 +53,7 @@ def check_ds_created(ds, mock_post, url): self._compare_ds(ds, example_ds) args, kwargs = mock_post.call_args - assert kwargs['headers'] == {'Authorization': 'Bearer ' + API_KEY} + assert kwargs['headers'] == {'Authorization': 'Bearer ' + API_KEY, 'Content-Type': 'application/json'} assert kwargs['json'] == example_ds.model_dump() assert args[0] == url @@ -142,14 +142,15 @@ def test_create_knowledge_bases(self, mock_post, mock_get): args, kwargs = mock_post.call_args - assert kwargs['headers'] == {'Authorization': 'Bearer ' + API_KEY} + assert kwargs['headers'] == {'Authorization': 'Bearer ' + API_KEY, 'Content-Type': 'application/json'} expected_create_request = { 'name': test_knowledge_base_config.name, 'description': test_knowledge_base_config.description, 'vector_store': { 'engine': test_vector_store_config.engine, - 'connection_data': test_vector_store_config.connection_data + 'connection_data': test_vector_store_config.connection_data, + 'table': test_vector_store_config.table }, 'embedding_model': { 'provider': test_embedding_config.provider, @@ -443,3 +444,8 @@ def openai_completion_f(messages, *args, **kwargs): if question == chunk.content.lower(): success = True assert success is True + + +if __name__ == '__main__': + import pytest + pytest.main() \ No newline at end of file From 7da0f90e055084128992fc5e7dd0adbc0ba30829 Mon Sep 17 00:00:00 2001 From: Minura Punchihewa Date: Fri, 29 Nov 2024 20:09:59 +0530 Subject: [PATCH 3/3] removed if __name__ == '__main__': block --- tests/unit/test_unit.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/unit/test_unit.py b/tests/unit/test_unit.py index 2d754dc..b7b2c87 100644 --- a/tests/unit/test_unit.py +++ b/tests/unit/test_unit.py @@ -444,8 +444,3 @@ def openai_completion_f(messages, *args, **kwargs): if question == chunk.content.lower(): success = True assert success is True - - -if __name__ == '__main__': - import pytest - pytest.main() \ No newline at end of file