Skip to content

Commit

Permalink
Fix Python SDK example error. (#4263)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

#4253
### Type of change

- [x] Documentation Update
  • Loading branch information
KevinHuSh authored Dec 27, 2024
1 parent 6f6303d commit c781877
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 32 deletions.
17 changes: 6 additions & 11 deletions docs/references/python_api_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -894,17 +894,12 @@ dataset = rag_object.list_datasets(name="ragflow")
dataset = dataset[0]
name = 'ragflow_test.txt'
path = './test_data/ragflow_test.txt'
rag_object.create_document(dataset, name=name, blob=open(path, "rb").read())
doc = dataset.list_documents(name=name)
doc = doc[0]
dataset.async_parse_documents([doc.id])
for c in rag_object.retrieve(question="What's ragflow?",
dataset_ids=[dataset.id], document_ids=[doc.id],
page=1, page_size=30, similarity_threshold=0.2,
vector_similarity_weight=0.3,
top_k=1024
):
print(c)
documents =[{"displayed_name":"test_retrieve_chunks.txt","blob":open(path, "rb").read()}]
docs = dataset.upload_documents(documents)
doc = docs[0]
doc.add_chunk(content="This is a chunk addition test")
for c in rag_object.retrieve(dataset_ids=[dataset.id],document_ids=[doc.id]):
print(c)
```

---
Expand Down
21 changes: 0 additions & 21 deletions sdk/python/ragflow_sdk/dataset.py

This file was deleted.

0 comments on commit c781877

Please sign in to comment.