Skip to main content

DifyPy

Python SDK for Dify API - 简单易用的 Dify API 客户端

安装

pip install difypy

快速开始

from difypy import Dify, ResponseMode

# 初始化客户端,url填写你们公司自己部署的
client = Dify(api_key="your_api_key", base_url="https://api.dify.ai/v1")

# 运行工作流
response = client.run_workflow(
    inputs={"query": "你好,请介绍一下自己"},
    user="user_123",
    response_mode=ResponseMode.BLOCKING
)

print(response.data)

# 上传文件
file_response = client.upload_file(
    file_path="path/to/file.pdf",
    user="user_123"
)

print(f"文件ID: {file_response.id}")

功能特性

  • 工作流执行(支持流式和阻塞模式)
  • 文件上传和管理
  • 工作流状态查询
  • 应用信息获取
  • 错误处理

许可证

MIT

Metadata

Release files for difypy 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for difypy 0.1.0
File Size Uploaded
difypy-0.1.0.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for difypy 0.1.0
File Interpreter ABI Platform
difypy-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.8 kB

Release files / difypy-0.1.0.tar.gz

Download URL difypy-0.1.0.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ad079f9b08b772f9258b2844a2a20e2ceae1317c18836fe93a9fc4b024adebde
BLAKE2b-256 checksum
How to use checksums
591472a1e1c9e4d39c2b15092cbbf5124a076d029fe45db8b1475f6a0f56745b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.6

Release files / difypy-0.1.0-py3-none-any.whl

Download URL difypy-0.1.0-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fe86c7aae8c9238393a9347c6dc63fd0c11e60e2258aeaafdbec3b6d4b713d42
BLAKE2b-256 checksum
How to use checksums
4484557e73456c736910f58271b0806bd48c65382567068cc18ffa6ec054082d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.6

Release history Release notifications | RSS feed

0.1.2

2 release files

0.1.1

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page