Client
- class ragflow_async_sdk.client.AsyncRAGFlowClient(server_url: str, api_key: str, timeout: float = 5.0, api_version: str = 'v1', _http_client: AsyncHTTPClient | None = None, _raw_http_client: AsyncHTTPClient | None = None, **kwargs)[source]
Bases:
objectThe RAGFlow asynchronous SDK top-level client. This client provides access to all RAGFlow resources in an async manner.
- Parameters:
server_url (str) – The base URL of the RAGFlow server.
api_key (str) – API key for authentication.
timeout (float, optional) – HTTP request timeout in seconds. Defaults to 5.0.
api_version (str, optional) – API version to use. Currently only “v1” is supported. Defaults to “v1”.
**kwargs – Additional keyword arguments passed to HTTP client constructors.
- datasets
Interface for dataset operations.
- Type:
- documents
Interface for document operations.
- Type:
- sessions
Interface for session operations.
- Type:
- Raises:
RAGFlowConfigError – If the server_url is invalid or api_version is unsupported.
Examples
import asyncio from ragflow_async_sdk import AsyncRAGFlowClient async def main(): async with AsyncRAGFlowClient( server_url="http://your-ragflow-address", api_key="YOUR_API_KEY", ) as client: # Example: Health check system_health = await client.systems.healthz() print(system_health.status) # Run the async main function asyncio.run(main())