cloudbase-agent-dify
Cloudbase Agent Python SDK - Dify framework integration
This package provides Dify-specific agent implementations for Cloudbase Agent, enabling seamless integration with Dify platform's chat API.
Installation
pip install -e .
Usage
See examples in python-sdk/examples/dify/ for usage examples.
Configuration
Set the following environment variables:
DIFY_API_KEY: Dify API key (required)DIFY_API_BASE: Dify API base URL (optional, defaults tohttps://api.dify.ai/v1)
Implementation Details
This adapter uses direct HTTP requests via httpx instead of relying on third-party SDKs:
- Why direct HTTP? The official
dify-clientpackage on PyPI hasn't been updated since 2023 and may be outdated - Benefits: Full control over API calls, easier to maintain, no dependency on potentially outdated SDKs
- API Reference: Implementation follows the official Dify API documentation: https://docs.dify.ai/api-reference/chat/send-chat-message
Features
- Strict mode: Only
userrole messages are accepted in a single request (prevents semantic inconsistencies) - Automatic conversation management: Uses
conversation_idfrom Dify responses asthread_id - Intelligent retry: Automatically retries once without
conversation_idif format error occurs - Streaming & Blocking: Support for both
streaming(SSE) andblockingresponse modes - Tool call mapping: Complete support for Dify Agent mode tool calls via
agent_thoughtevents
Metadata
Release files for cloudbase-agent-dify 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| cloudbase_agent_dify-0.1.1.tar.gz | 29.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cloudbase_agent_dify-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 48.8 kB
Release files / cloudbase_agent_dify-0.1.1.tar.gz
| Download URL | cloudbase_agent_dify-0.1.1.tar.gz |
|---|---|
| Size | 29.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
328370e489483a9a2c241f7d57c2b3849f5ea696d6fc61dab0dc54608a08c928
|
|
BLAKE2b-256 checksum How to use checksums |
3001603a2f59f151958401004ca6a3d5a106b6b0c7a87b939eacc0b0c3803aa5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / cloudbase_agent_dify-0.1.1-py3-none-any.whl
| Download URL | cloudbase_agent_dify-0.1.1-py3-none-any.whl |
|---|---|
| Size | 19.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
07251dfa99a81269a6e4c8c0d9344a0727f0bcfdb31c4456ce61d2956dc4e30a
|
|
BLAKE2b-256 checksum How to use checksums |
9d6262f5de3d2c575113cfc36315d9d557ae8655ce81e9aa36ef3b5641926fc1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Security for cloudbase-agent-dify 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.