mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-24 23:46:52 +08:00
Feat: message manage (#12083)
### What problem does this PR solve? Message CRUD. Issue #4213 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -32,8 +32,8 @@ def add_memory_func(request, WebApiAuth):
|
||||
payload = {
|
||||
"name": f"test_memory_{i}",
|
||||
"memory_type": ["raw"] + random.choices(["semantic", "episodic", "procedural"], k=random.randint(0, 3)),
|
||||
"embd_id": "SILICONFLOW@BAAI/bge-large-zh-v1.5",
|
||||
"llm_id": "ZHIPU-AI@glm-4-flash"
|
||||
"embd_id": "BAAI/bge-large-zh-v1.5@SILICONFLOW",
|
||||
"llm_id": "glm-4-flash@ZHIPU-AI"
|
||||
}
|
||||
res = create_memory(WebApiAuth, payload)
|
||||
memory_ids.append(res["data"]["id"])
|
||||
|
||||
@ -49,8 +49,8 @@ class TestMemoryCreate:
|
||||
payload = {
|
||||
"name": name,
|
||||
"memory_type": ["raw"] + random.choices(["semantic", "episodic", "procedural"], k=random.randint(0, 3)),
|
||||
"embd_id": "SILICONFLOW@BAAI/bge-large-zh-v1.5",
|
||||
"llm_id": "ZHIPU-AI@glm-4-flash"
|
||||
"embd_id": "BAAI/bge-large-zh-v1.5@SILICONFLOW",
|
||||
"llm_id": "glm-4-flash@ZHIPU-AI"
|
||||
}
|
||||
res = create_memory(WebApiAuth, payload)
|
||||
assert res["code"] == 0, res
|
||||
@ -72,8 +72,8 @@ class TestMemoryCreate:
|
||||
payload = {
|
||||
"name": name,
|
||||
"memory_type": ["raw"] + random.choices(["semantic", "episodic", "procedural"], k=random.randint(0, 3)),
|
||||
"embd_id": "SILICONFLOW@BAAI/bge-large-zh-v1.5",
|
||||
"llm_id": "ZHIPU-AI@glm-4-flash"
|
||||
"embd_id": "BAAI/bge-large-zh-v1.5@SILICONFLOW",
|
||||
"llm_id": "glm-4-flash@ZHIPU-AI"
|
||||
}
|
||||
res = create_memory(WebApiAuth, payload)
|
||||
assert res["message"] == expected_message, res
|
||||
@ -84,8 +84,8 @@ class TestMemoryCreate:
|
||||
payload = {
|
||||
"name": name,
|
||||
"memory_type": ["something"],
|
||||
"embd_id": "SILICONFLOW@BAAI/bge-large-zh-v1.5",
|
||||
"llm_id": "ZHIPU-AI@glm-4-flash"
|
||||
"embd_id": "BAAI/bge-large-zh-v1.5@SILICONFLOW",
|
||||
"llm_id": "glm-4-flash@ZHIPU-AI"
|
||||
}
|
||||
res = create_memory(WebApiAuth, payload)
|
||||
assert res["message"] == f"Memory type '{ {'something'} }' is not supported.", res
|
||||
@ -96,8 +96,8 @@ class TestMemoryCreate:
|
||||
payload = {
|
||||
"name": name,
|
||||
"memory_type": ["raw"] + random.choices(["semantic", "episodic", "procedural"], k=random.randint(0, 3)),
|
||||
"embd_id": "SILICONFLOW@BAAI/bge-large-zh-v1.5",
|
||||
"llm_id": "ZHIPU-AI@glm-4-flash"
|
||||
"embd_id": "BAAI/bge-large-zh-v1.5@SILICONFLOW",
|
||||
"llm_id": "glm-4-flash@ZHIPU-AI"
|
||||
}
|
||||
res1 = create_memory(WebApiAuth, payload)
|
||||
assert res1["code"] == 0, res1
|
||||
|
||||
@ -101,7 +101,7 @@ class TestMemoryUpdate:
|
||||
@pytest.mark.p1
|
||||
def test_llm(self, WebApiAuth, add_memory_func):
|
||||
memory_ids = add_memory_func
|
||||
llm_id = "ZHIPU-AI@glm-4"
|
||||
llm_id = "glm-4@ZHIPU-AI"
|
||||
payload = {"llm_id": llm_id}
|
||||
res = update_memory(WebApiAuth, memory_ids[0], payload)
|
||||
assert res["code"] == 0, res
|
||||
|
||||
Reference in New Issue
Block a user