Skip to content

feat(core): add official search-to-chat workflow and release 1.6.1 - #100

Merged
lltx merged 2 commits into
mainfrom
feat/search-chat-1.6.1
Oct 25, 2026
Merged

lltx merged 2 commits into
mainfrom
feat/search-chat-1.6.1

Conversation

@lltx

@lltx lltx commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

1.6.0 的官方 Search 只返回结构化结果,调用方仍需自行拼接上下文并调用模型。1.6.1 新增三个 chatSearchCompletion(...) 重载,自动先搜索再流式回答,支持简单问题、独立搜索参数和完整对话请求。

  • 复用客户端的模型、思考配置、API Key、基础地址、代理、超时和 headers;保留历史消息及请求参数,缺少 system 消息时补充客户端系统提示。
  • 将有长度限制的标题、URL、摘要或正文作为参考资料插入原问题之前,不修改调用方请求。长问题可通过独立的短 query 发起搜索。
  • 使用冷 Flux 和异步 HTTP;空结果继续正常聊天,搜索和模型错误向下游传递,取消订阅立即取消当前 HTTP 请求。
  • 父 POM、core、starter、示例依赖和 README 更新到 1.6.1。保留独立 search(...),不恢复 Bocha 配置。
  • 发布工作流使用 GitHub 内置令牌及 contents: write,修复此前自定义 GH_TOKEN 失效导致的 Release 创建失败。

验证:Java 8 下 mvn -B -ntp -Prelease -Dgpg.skip=true spring-javaformat:apply clean verify spring-javaformat:validate 通过;38 个测试全部通过,其中 19 个新增组合调用测试覆盖配置继承、覆盖参数、历史消息、Unicode 查询限制、上下文上限、错误、总超时传递、冷订阅和两个阶段的 HTTP 取消。README XML 示例、代码围栏与 git diff --check 通过。发布后另外验证 Maven Central 实际工件及独立消费者。

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T12:07:24.276130Z 6f14e42 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 32ab9aba-72b6-406a-9617-0e784fb4ed48
Commits

Reviewing files that changed from the base of the PR and between 324f041 and 6f14e42.

Files selected for processing: 11
  • .github/workflows/release.yaml
  • README.md
  • deepseek-spring-boot-starter/pom.xml
  • deepseek4j-core/pom.xml
  • deepseek4j-core/src/main/java/io/github/pigmesh/ai/deepseek/core/DeepSeekClient.java
  • deepseek4j-core/src/main/java/io/github/pigmesh/ai/deepseek/core/ResponseHandle.java
  • deepseek4j-core/src/main/java/io/github/pigmesh/ai/deepseek/core/SearchChatContext.java
  • deepseek4j-core/src/main/java/io/github/pigmesh/ai/deepseek/core/StreamingRequestExecutor.java
  • deepseek4j-core/src/test/java/io/github/pigmesh/ai/deepseek/core/DeepSeekSearchChatTest.java
  • deepseek4j-example/pom.xml
  • pom.xml

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Walkthrough

The release adds chatSearchCompletion(...), which performs a search and streams a chat response with search references. It also connects request cancellation to active calls, updates documentation and Maven versions to 1.6.1, and changes the release workflow token permissions.

Changes: Search-backed chat completion

Layer / File(s) Summary
Validate and prepare search context
deepseek4j-core/src/main/java/io/github/pigmesh/ai/deepseek/core/SearchChatContext.java, deepseek4j-core/src/test/java/io/github/pigmesh/ai/deepseek/core/DeepSeekSearchChatTest.java
SearchChatContext validates queries and chat requests, copies the request, and adds bounded search references. Tests cover context selection, validation, and size limits.
Run search, stream chat, and propagate cancellation
deepseek4j-core/src/main/java/io/github/pigmesh/ai/deepseek/core/DeepSeekClient.java, deepseek4j-core/src/main/java/io/github/pigmesh/ai/deepseek/core/ResponseHandle.java, deepseek4j-core/src/main/java/io/github/pigmesh/ai/deepseek/core/StreamingRequestExecutor.java, deepseek4j-core/src/test/java/io/github/pigmesh/ai/deepseek/core/DeepSeekSearchChatTest.java
DeepSeekClient adds three chatSearchCompletion(...) overloads. Each subscription searches, adds results to a chat request, and streams the response. Cancellation reaches the active search or chat request. Tests cover request behavior, errors, and cancellation.
Document the API and update release versions
README.md, pom.xml, deepseek4j-core/pom.xml, deepseek-spring-boot-starter/pom.xml, deepseek4j-example/pom.xml
README guidance distinguishes standalone search from search-backed chat completion and documents the new API. Project and dependency versions change to 1.6.1.

Release workflow token permissions

Layer / File(s) Summary
Set release action permissions and token
.github/workflows/release.yaml
The workflow grants contents: write and passes secrets.GITHUB_TOKEN to the release action.

Priority: Pending latest changes

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Subscriber
  participant DeepSeekClient
  participant SearchEndpoint
  participant StreamingRequestExecutor
  Subscriber->>DeepSeekClient: Subscribe to chatSearchCompletion
  DeepSeekClient->>SearchEndpoint: Execute search call
  SearchEndpoint-->>DeepSeekClient: Return search results
  DeepSeekClient->>StreamingRequestExecutor: Stream chat request with search context
  StreamingRequestExecutor-->>Subscriber: Emit chat response events
Loading

Possibly related PRs

  • pig-mesh/deepseek4j#98: This PR adds chatSearchCompletion(...) using DeepSeek Search, following a similar workflow name after PR #98 removed its former Bocha-based version.
  • pig-mesh/deepseek4j#97: This PR uses the official Search API, request and response types, and endpoint infrastructure added in PR #97.
Merge Risk: Minimal · up to 6f14e

No actionable issue is established for this release update; it is ready to merge after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 40 functions across 5 files. (6 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main changes: the official search-to-chat workflow and the 1.6.1 release.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 40 functions across 5 files. (6 skipped: 6 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6f14e421f5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lltx
lltx merged commit e8ff46b into main Oct 25, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant