mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-09-08 10:14:35 +08:00
Fix : Ci fail for infinity on level p3 (#15757)
### What problem does this PR solve? fix failing p3 tests ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
+4
-1
@@ -15,6 +15,7 @@
|
||||
#
|
||||
|
||||
import pytest
|
||||
from common import valid_chat_llm_id
|
||||
from configs import CHAT_ASSISTANT_NAME_LIMIT
|
||||
from utils import encode_avatar
|
||||
from utils.file_utils import create_image_file
|
||||
@@ -127,12 +128,14 @@ class TestChatAssistantCreate:
|
||||
@pytest.mark.parametrize(
|
||||
"llm_id, expected_message",
|
||||
[
|
||||
("glm-4", ""),
|
||||
(valid_chat_llm_id, ""),
|
||||
("unknown", "`llm_id` unknown doesn't exist"),
|
||||
],
|
||||
)
|
||||
def test_llm_id(self, client, add_chunks, llm_id, expected_message):
|
||||
dataset, _, _ = add_chunks
|
||||
if callable(llm_id):
|
||||
llm_id = llm_id(client)
|
||||
|
||||
if expected_message:
|
||||
with pytest.raises(Exception) as exception_info:
|
||||
|
||||
+5
-1
@@ -15,6 +15,7 @@
|
||||
#
|
||||
|
||||
import pytest
|
||||
from common import valid_chat_llm_id
|
||||
from configs import CHAT_ASSISTANT_NAME_LIMIT
|
||||
from utils import encode_avatar
|
||||
from utils.file_utils import create_image_file
|
||||
@@ -109,7 +110,7 @@ class TestChatAssistantUpdate:
|
||||
@pytest.mark.parametrize(
|
||||
"llm_setting, expected_message",
|
||||
[
|
||||
({"model_name": "glm-4"}, ""),
|
||||
({"model_name": valid_chat_llm_id}, ""),
|
||||
({"model_name": "unknown"}, "`llm_id` unknown doesn't exist"),
|
||||
({"temperature": 0}, ""),
|
||||
({"temperature": 1}, ""),
|
||||
@@ -142,7 +143,10 @@ class TestChatAssistantUpdate:
|
||||
def test_llm_setting(self, client, add_chat_assistants_func, llm_setting, expected_message):
|
||||
dataset, _, chat_assistants = add_chat_assistants_func
|
||||
chat_assistant = chat_assistants[0]
|
||||
llm_setting = dict(llm_setting)
|
||||
llm_id = llm_setting.pop("model_name", None)
|
||||
if callable(llm_id):
|
||||
llm_id = llm_id(client)
|
||||
payload = {"name": "llm_test", "dataset_ids": [dataset.id], "llm_setting": llm_setting}
|
||||
if llm_id is not None:
|
||||
payload["llm_id"] = llm_id
|
||||
|
||||
Reference in New Issue
Block a user