Skip to content

docs: add API examples for chat, document, and retrieval - #13284

Closed
Br1an67 wants to merge 1 commit into
infiniflow:mainfrom
Br1an67:feat/api-examples
Closed

Br1an67 wants to merge 1 commit into
infiniflow:mainfrom
Br1an67:feat/api-examples

Conversation

@Br1an67

@Br1an67 Br1an67 commented Feb 28, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

This PR addresses #4310 by adding API usage examples for the RAGFlow SDK and HTTP API.

Although RAGFlow already has API documentation, concrete examples make it much easier for developers to get started. Currently, only dataset examples exist (example/sdk/dataset_example.py and example/http/dataset_example.sh). This PR adds examples covering the other core API resources:

Python SDK examples (example/sdk/):

  • chat_example.py — Chat assistant CRUD, session management, and chat completions (streaming and non-streaming)
  • document_example.py — Document upload, listing, parsing, and chunk management
  • retrieval_example.py — Cross-dataset semantic search

HTTP API (cURL) examples (example/http/):

  • chat_example.sh — Chat CRUD, sessions, and completions via cURL
  • document_example.sh — Document upload, parsing, and chunk operations via cURL
  • retrieval_example.sh — Retrieval endpoint usage via cURL

Type of change

  • Documentation Update

Add Python SDK examples:
- chat_example.py: chat assistant CRUD, sessions, and completions
- document_example.py: document upload, parsing, and chunk management
- retrieval_example.py: cross-dataset semantic search

Add HTTP API (cURL) examples:
- chat_example.sh: chat CRUD, sessions, and completions
- document_example.sh: document upload, parsing, and chunk operations
- retrieval_example.sh: retrieval endpoint usage

Closes infiniflow#4310
@dosubot dosubot Bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Feb 28, 2026
@dosubot dosubot Bot added the 📖 documentation Improvements or additions to documentation label Feb 28, 2026
JinHai-CN pushed a commit that referenced this pull request May 22, 2026
… and retrieval (#4310) (#14208)

Closes #4310

### What problem does this PR solve?

Issue #4310 requests practical examples for the RAGFlow SDK and HTTP API
to help developers get started faster. The existing `example/sdk/`
folder only contains `dataset_example.py`. This PR fills the remaining
gaps by adding examples for three key API areas not yet covered in
`main` or by other open PRs (#13904, #13284):

- **Chunk management** — add, list, update, delete, and retrieve chunks
within a dataset
- **Chat assistant** — create a chat assistant, open a session, send
messages (streaming and non-streaming), and clean up
- **Retrieval** — perform semantic retrieval across one or multiple
datasets

### Type of change

- [x] Documentation Update
- [x] New Feature (non-breaking change which adds functionality)
@JinHai-CN
JinHai-CN requested a review from Yannnnnnny September 2, 2026 06:16
@JinHai-CN
JinHai-CN requested review from 6ba3i and removed request for Yannnnnnny September 2, 2026 06:21
@JinHai-CN JinHai-CN assigned 6ba3i and unassigned Yannnnnnny Sep 2, 2026
@6ba3i 6ba3i closed this Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📖 documentation Improvements or additions to documentation size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants