From 07a67f8423a898f252e14d9c3c7c1f838b1b5962 Mon Sep 17 00:00:00 2001 From: userpj Date: Fri, 19 Jul 2024 09:17:45 +0800 Subject: [PATCH] update --- appbuilder/tests/test_knowledge_base.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/appbuilder/tests/test_knowledge_base.py b/appbuilder/tests/test_knowledge_base.py index 6d4ba2d1c..4b999844e 100644 --- a/appbuilder/tests/test_knowledge_base.py +++ b/appbuilder/tests/test_knowledge_base.py @@ -110,6 +110,18 @@ def test_create_knowledge_base(self): knowledge.delete_knowledge_base(knowledge_base_id) self.assertIsNotNone(knowledge_base_id) + def test_create_chunk(self): + dataset_id = os.getenv("DATASET_ID", "UNKNOWN") + knowledge = appbuilder.KnowledgeBase(knowledge_id=dataset_id) + list_res = knowledge.get_documents_list() + document_id = list_res.data[0].id + resp = self.knowledge.create_chunk(document_id, content="test") + chunk_id = resp.id + knowledge.modify_chunk(chunk_id, content="new test", enable=True) + knowledge.describe_chunk(chunk_id) + knowledge.describe_chunks(document_id) + knowledge.delete_chunk(chunk_id) + if __name__ == "__main__": unittest.main()