forest/forest-examples/example-deepseek
dependabot[bot] 0a6e952356 build(deps): bump io.springfox:springfox-swagger-ui
Bumps [io.springfox:springfox-swagger-ui](https://github.com/springfox/springfox) from 2.9.2 to 2.10.0.
- [Release notes](https://github.com/springfox/springfox/releases)
- [Changelog](https://github.com/springfox/springfox/blob/master/docs/release-notes.md)
- [Commits](https://github.com/springfox/springfox/compare/2.9.2...2.10.0)

---
updated-dependencies:
- dependency-name: io.springfox:springfox-swagger-ui
  dependency-version: 2.10.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-03 15:10:29 +08:00
..
src/main update: DeepSeek对接案例项目 2025-03-06 22:25:56 +08:00
README.md update: DeepSeek对接案例项目README文件 2025-03-06 21:47:29 +08:00
pom.xml build(deps): bump io.springfox:springfox-swagger-ui 2025-07-03 15:10:29 +08:00

README.md

Spring Boot 环境下接入 DeepSeek 的示例

本案例使用forest-spring-boot-starter包发送HTTP请求来调用 DeepSeek 的接口

使用 Fastjson2 进行JSON序列化/反序列化

项目结构介绍

本案例包含以下几个类:

  • DeepSeekExampleApplication: 项目启动类
  • DeepSeek: 接入 DeepSeek 的 Forest 声明式接口
  • DeepSeekResult: 用于接受 DeepSeek 响应结果的数据类
  • DeepSeekResultChoice: 用于接受 DeepSeek 响应结果中文本内容的数据类
  • DeepSeekResultDelta: 用于接受 DeepSeek 增量更新内容的类
  • DeepSeekContent: 用于返回 DeepSeek 消息内容

配置

forest:
  connect-timeout: 10000      # HTTP请求连接超时时间
  read-timeout: 3600000       # HTTP请求读取超时时间
  variables:                  # 自定义变量:
    baseUrl: https://api.deepseek.com
    apiKey: YOUR_API_KEY      # 你的 DeepSeek 的 API KEY
    model: deepseek-reasoner  # DeepSeek 模型: deepseek-chat 或 deepseek-reasoner