dify-java-client  by imfangs

Java SDK for Dify generative AI integration

Created 1 year ago
678 stars

Top 49.1% on SourcePulse

GitHubView on GitHub
Project Summary

This Java client library provides a robust interface for Java developers to integrate Dify's generative AI capabilities into their applications. It offers comprehensive support for Dify's application APIs (Chat, Completion, Chatflow, Workflow) and knowledge base management, enabling seamless integration of advanced AI features.

How It Works

The client library employs a modular design, offering specific client instances for different Dify functionalities: DifyChatClient, DifyCompletionClient, DifyChatflowClient, DifyWorkflowClient, and DifyDatasetsClient. It supports both synchronous (blocking) API calls and asynchronous (streaming) interactions via callbacks, allowing for real-time responses and dynamic UI updates. The library handles complex operations like session management, knowledge base indexing, document retrieval, and workflow execution.

Quick Start & Requirements

  • Installation: Add the dependency via Maven or Gradle:
    • Maven:
      <dependency>
          <groupId>io.github.imfangs</groupId>
          <artifactId>dify-java-client</artifactId>
          <version>1.6.0</version>
      </dependency>
      
    • Gradle:
      implementation 'io.github.imfangs:dify-java-client:1.6.0'
      
  • Prerequisites: Java 8 or higher, Maven 3.x or Gradle 4.x.
  • Links: Further documentation is referenced but not directly provided in the README snippet.

Highlighted Details

  • Supports multiple Dify application types: Chat, Completion, Chatflow, Workflow, and Datasets.
  • Offers flexible interaction modes: Blocking for synchronous responses and Streaming with callbacks for real-time updates.
  • Provides full lifecycle management for conversations, including history, renaming, and feedback.
  • Enables end-to-end knowledge base operations: creation, document upload, segmentation, and semantic retrieval.
  • Includes multimedia processing capabilities: audio-to-text and text-to-audio.
  • Supports advanced features like Human Input Flows (Dify 1.14.2+) and reasoning chunk streaming for LLM nodes.

Maintenance & Community

The project welcomes contributions via GitHub Issues and Pull Requests. Specific community channels (e.g., Discord, Slack) or notable maintainers are not detailed in the provided README.

Licensing & Compatibility

  • License: Apache License 2.0.
  • Compatibility: The Apache 2.0 license is permissive, generally allowing for commercial use and integration into closed-source projects.

Limitations & Caveats

The Human Input Flow feature requires Dify version 1.14.2 or higher. The README does not explicitly mention other limitations, alpha status, or known bugs. Direct links to extended documentation are referenced but not included in the provided text.

Health Check
Last Commit

2 days ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
1
Star History
11 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.