Skip to main content

A package for interacting with the Dify Service-API

Project description

dify-client

A Dify App Service-API Client, using for build a webapp by request Service-API

Usage

First, install dify-client python sdk package:

pip install dify-client

Write your code with sdk:

api_key = "your_api_key"

# Initialize CompletionClient
completion_client = CompletionClient(api_key)

# Create Completion Message using CompletionClient
completion_response = completion_client.create_completion_message(inputs={}, query="Hello", response_mode="blocking", user="user_id")
print(completion_response)

# Initialize ChatClient
chat_client = ChatClient(api_key)

# Create Chat Message using ChatClient
chat_response = chat_client.create_chat_message(inputs={}, message="Hello", user="user_id", response_mode="streaming")
print(chat_response)

# Get Chat History using ChatClient
chat_history = chat_client.get_chat_history(user="user_id")
print(chat_history)

# Get Conversation List using ChatClient
conversations = chat_client.list_conversations(user="user_id")
print(conversations)

# Rename Conversation using ChatClient
rename_conversation_response = chat_client.rename_conversation(conversation_id="conversation_id", name="new_name", user="user_id")
print(rename_conversation_response)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dify-client-0.1.4.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

dify_client-0.1.4-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file dify-client-0.1.4.tar.gz.

File metadata

  • Download URL: dify-client-0.1.4.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for dify-client-0.1.4.tar.gz
Algorithm Hash digest
SHA256 4336f5d8e05a05589ffb30af5225c675824f53e8c850ff12afe55ca3cc328271
MD5 85d421e457ec8b1c02f4ec1abdbcdadb
BLAKE2b-256 0eade8be60e481cda15d647c237579313232e58390c0fa07b50f5196cf5681aa

See more details on using hashes here.

File details

Details for the file dify_client-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: dify_client-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for dify_client-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4ad98dc8edcefa57663aa52f9ea0608ad97247a732ba4db34f1ffe182cc418bc
MD5 1af4760bf284bdc44a84adb46efbd9a4
BLAKE2b-256 6d69a7599c070e1dd20481d9af330781d48b8b86a7fd3f09afac39a0efcd8676

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page