Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
userpj committed Jul 19, 2024
1 parent 5af8f9f commit 07a67f8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions appbuilder/tests/test_knowledge_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 07a67f8

Please sign in to comment.