> ## Documentation Index
> Fetch the complete documentation index at: https://javaai.pig4cloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 配置说明

<Card title="写在最前：问题咨询请直接点击此处提交 ISSUE" icon="star" href="https://github.com/pig-mesh/deepseek4j/issues">
  * ⭐️ **请先 Star 本项目后再提问，作者精力有限，未 Star 直接 Close**
  * 🐞 [GitHub ISSUE](https://github.com/pig-mesh/deepseek4j/issues) 需包含：问题截图 + SDK版本 + 配置代码
</Card>

DeepSeek 提供了丰富的配置选项，可以通过 Spring Boot 的配置文件进行设置。所有配置项都以 `deepseek` 为前缀。

## 基础配置

| 配置项                              | 默认值                                                        | 说明                   |
| -------------------------------- | ---------------------------------------------------------- | -------------------- |
| `deepseek.base-url`              | [https://api.deepseek.com/v1](https://api.deepseek.com/v1) | DeepSeek API 的基础 URL |
| `deepseek.api-key`               | -                                                          | API 密钥，必填项           |
| `deepseek.model`                 | -                                                          | 使用的模型名称              |
| `deepseek.default-system-prompt` | true                                                       | 是否使用默认的系统提示词，默认开启    |

<Warning>default-system-prompt 默认开启，一些非标R1模型，如果不加系统提示词则不进行深度推理比如 ollama /gitee 不输出思维链</Warning>

## 日志配置

| 配置项                      | 默认值   | 说明       |
| ------------------------ | ----- | -------- |
| `deepseek.log-requests`  | false | 是否记录请求日志 |
| `deepseek.log-responses` | false | 是否记录响应日志 |
| `deepseek.log-level`     | DEBUG | 日志级别     |

## 网络配置

| 配置项                        | 默认值 | 说明        |
| -------------------------- | --- | --------- |
| `deepseek.proxy`           | -   | 代理设置      |
| `deepseek.connect-timeout` | -   | 连接超时时间（秒） |
| `deepseek.read-timeout`    | -   | 读取超时时间（秒） |
| `deepseek.call-timeout`    | -   | 调用超时时间（秒） |

## 配置示例

```yaml theme={"system"}
deepseek:
  base-url: https://api.deepseek.com/v1
  api-key: your-api-key-here
  model: deepseek-chat
  default-system-prompt: true
  log-requests: true
  log-responses: true
  log-level: DEBUG
  connect-timeout: 30
  read-timeout: 30
  call-timeout: 60
```

注意：

1. `api-key` 是必需的配置项，需要从 DeepSeek 官方获取
2. 超时时间单位为秒
3. 代理配置可以帮助在特定网络环境下访问 API
4. 建议在开发环境下开启日志配置，方便调试

<Card title="PIG AI应用开发平台 | 适合中大型企业构建自主可控的AI中台" icon="link" href="https://ai.pig4cloud.com">
  **为Java开发者提供全栈式AI工程化解决方案**，强类型/高可维护性架构，内置30+主流大模型支持。

  * **🔍 知识引擎体系**：RAG 知识引擎全自动化多模态解决方案
  * **📝 AI-OCR 中枢**：复杂非标场景高精度识别
  * **⚙️ 业务智能融合**：函数编排 + Chat2SQL，无缝对接现有业务系统
  * **🛡️ N维风控体系**：敏感词/IP/Token/User 规则控制引擎
</Card>

<Card title="文档有误？请协助编辑" icon="pencil" href="https://github.com/javaai-pig4cloud-com/javaai-docs/edit/main/deepseek/configuration.mdx">
  发现文档问题？点击此处直接在 GitHub 上编辑并提交 PR，帮助我们改进文档！
</Card>
