Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Provide springboot starter for dify to simplify development.

License

NotificationsYou must be signed in to change notification settings

guoshiqiufeng/dify-spring-boot-starter

cover-v5-optimized

Documentation ·Examples ·DeepWiki

Maven centralLicenseCodeQLcodecov

Read in other languages:简体中文

Introduction

Provide springboot starter for dify to simplify development.

Development Framework

  • Spring Boot 4/3/2

Running the minimum version

  • Spring Boot 2
  • Java 8

Recommended Running Versions

  • Spring Boot 4/3

Features

  • chat
  • server
  • workflow
  • dataset (Knowledge)

Use

Introduces a uniform version dependency, so you don't have to specify a version number when you use it.

<dependencyManagement>    <dependencies>        <dependency>            <groupId>io.github.guoshiqiufeng.dify</groupId>            <artifactId>dify-bom</artifactId>            <version>1.6.3</version>            <type>import</type>        </dependency>    </dependencies></dependencyManagement>

Introducing starter dependencies

  • springboot3.1 and above
<dependency>    <groupId>io.github.guoshiqiufeng.dify</groupId>    <artifactId>dify-spring-boot-starter</artifactId></dependency>
  • springboot4

dify-spring-boot-starter v1.6.0 or above is available.

<dependency>    <groupId>io.github.guoshiqiufeng.dify</groupId>    <artifactId>dify-spring-boot4-starter</artifactId></dependency>
  • springboot2、springboot3.0.x

dify-spring-boot-starter v0.9.0 or above is available.

<dependency>    <groupId>io.github.guoshiqiufeng.dify</groupId>    <artifactId>dify-spring-boot2-starter</artifactId></dependency>

autoloading

yml configuration
dify:url:http://192.168.1.10# Please replace with the actual Dify service addressserver:email:admin@admin.com# Please replace the actual Dify service mailbox, if you do not need to call the server-related interfaces can not be filled in!password:admin123456# Please replace the password with the actual Dify service password, if you don't need to call the server-related interfaces can not be filled in!dataset:api-key:dataset-aaabbbcccdddeeefffggghhh# Please replace with the actual Dify dataset API key, if you don't need to call the dataset-related interfaces can not be filled in!
Get message suggestions
@ServicepublicclassDifyChatService {@ResourceprivateDifyChatdifyChat;publicList<String>messagesSuggested(StringmessageId,StringapiKey,StringuserId) {returndifyChat.messagesSuggested(messageId,apiKey,userId);    }}

Builder

dify-spring-boot-starter v0.9.0 or above is available.

DifyServerdifyServer =DifyServerBuilder.create(DifyServerBuilder.DifyServerClientBuilder                .builder()                .baseUrl("https://your-dify-api.example.com")                .serverProperties(newDifyProperties.Server("admin@example.com","password"))                .serverToken(newDifyServerTokenDefault())                .clientConfig(newDifyProperties.ClientConfig())                .restClientBuilder(RestClient.builder())                .webClientBuilder(WebClient.builder())                .build());

For more usage references check the

Star History

Star History Chart

Alt


[8]ページ先頭

©2009-2025 Movatter.jp