From 936c6b2a49f926e074da75d36a5fd8f30849e1a6 Mon Sep 17 00:00:00 2001 From: Jael Gu Date: Tue, 24 Oct 2023 19:22:00 +0800 Subject: [PATCH] Fix http of default milvus uri (#86) Signed-off-by: Jael Gu --- config.py | 2 +- tests/requirements.txt | 2 +- tests/unit_tests/src_langchain/llm/test_ernie.py | 6 +++--- tests/unit_tests/src_towhee/pipelines/test_pipelines.py | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config.py b/config.py index 2cdb9f9..dcc7b90 100644 --- a/config.py +++ b/config.py @@ -72,7 +72,7 @@ # Vector db configs VECTORDB_CONFIG = { 'connection_args': { - 'uri': os.getenv('MILVUS_URI', 'https://localhost:19530'), + 'uri': os.getenv('MILVUS_URI', 'http://localhost:19530'), 'user': os.getenv('MILVUS_USER', ''), 'password': os.getenv('MILVUS_PASSWORD', ''), 'secure': True if os.getenv('MILVUS_SECURE', 'False').lower() == 'true' else False diff --git a/tests/requirements.txt b/tests/requirements.txt index 52ef6e6..f83fd56 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -7,4 +7,4 @@ transformers dashscope zhipuai sentence-transformers -erniebot \ No newline at end of file +erniebot==0.4.0 \ No newline at end of file diff --git a/tests/unit_tests/src_langchain/llm/test_ernie.py b/tests/unit_tests/src_langchain/llm/test_ernie.py index d3d8ab3..62e52aa 100644 --- a/tests/unit_tests/src_langchain/llm/test_ernie.py +++ b/tests/unit_tests/src_langchain/llm/test_ernie.py @@ -11,12 +11,12 @@ class TestERNIE(unittest.TestCase): def test_generate(self): from erniebot.response import EBResponse with patch('erniebot.ChatCompletion.create') as mock_post: - mock_res = EBResponse(code=200, - body={'id': 'as-0000000000', 'object': 'chat.completion', 'created': 11111111, + mock_res = EBResponse(rcode=200, + rbody={'id': 'as-0000000000', 'object': 'chat.completion', 'created': 11111111, 'result': 'OK, this is a mock answer.', 'usage': {'prompt_tokens': 1, 'completion_tokens': 13, 'total_tokens': 14}, 'need_clear_history': False, 'is_truncated': False}, - headers={'Connection': 'keep-alive', + rheaders={'Connection': 'keep-alive', 'Content-Security-Policy': 'frame-ancestors https://*.baidu.com/', 'Content-Type': 'application/json', 'Date': 'Mon, 23 Oct 2023 03:30:53 GMT', 'Server': 'nginx', 'Statement': 'AI-generated', diff --git a/tests/unit_tests/src_towhee/pipelines/test_pipelines.py b/tests/unit_tests/src_towhee/pipelines/test_pipelines.py index 004012f..fc013f7 100644 --- a/tests/unit_tests/src_towhee/pipelines/test_pipelines.py +++ b/tests/unit_tests/src_towhee/pipelines/test_pipelines.py @@ -142,12 +142,12 @@ def test_ernie(self): from erniebot.response import EBResponse with patch('erniebot.ChatCompletion.create') as mock_post: - mock_res = EBResponse(code=200, - body={'id': 'as-0000000000', 'object': 'chat.completion', 'created': 11111111, + mock_res = EBResponse(rcode=200, + rbody={'id': 'as-0000000000', 'object': 'chat.completion', 'created': 11111111, 'result': MOCK_ANSWER, 'usage': {'prompt_tokens': 1, 'completion_tokens': 13, 'total_tokens': 14}, 'need_clear_history': False, 'is_truncated': False}, - headers={'Connection': 'keep-alive', + rheaders={'Connection': 'keep-alive', 'Content-Security-Policy': 'frame-ancestors https://*.baidu.com/', 'Content-Type': 'application/json', 'Date': 'Mon, 23 Oct 2023 03:30:53 GMT', 'Server': 'nginx', 'Statement': 'AI-generated',