1
0
mirror of https://github.com/hustcer/deepseek-review.git synced 2026-05-13 05:16:05 +08:00

Review models Integration (#200)

* Update review.nu

Update model to preavoid depreciation

* Update refs

* Update payload in review

* Update the cr help
This commit is contained in:
Xinnil
2026-05-07 20:57:52 +08:00
committed by GitHub
parent 6cbc5ef631
commit d1dcf1311d
6 changed files with 13 additions and 12 deletions

View File

@@ -119,7 +119,7 @@ With this setup, DeepSeek code review will not run automatically upon PR creatio
| Name | Type | Description | | Name | Type | Description |
| -------------- | ------ | ----------------------------------------------------------------------- | | -------------- | ------ | ----------------------------------------------------------------------- |
| chat-token | String | Required, DeepSeek API Token | | chat-token | String | Required, DeepSeek API Token |
| model | String | Optional, The model used for code review, defaults to `deepseek-chat` | | model | String | Optional, The model used for code review, defaults to `deepseek-v4-flash` |
| base-url | String | Optional, DeepSeek API Base URL, defaults to `https://api.deepseek.com` | | base-url | String | Optional, DeepSeek API Base URL, defaults to `https://api.deepseek.com` |
| max-length | Int | Optional, Maximum length (Unicode width) of the content for review. If the content length exceeds this value, the review will be skipped. Default `0` means no limit. | | max-length | Int | Optional, Maximum length (Unicode width) of the content for review. If the content length exceeds this value, the review will be skipped. Default `0` means no limit. |
| sys-prompt | String | Optional, System prompt corresponding to `$sys_prompt` in the payload, default value see note below | | sys-prompt | String | Optional, System prompt corresponding to `$sys_prompt` in the payload, default value see note below |
@@ -133,7 +133,7 @@ With this setup, DeepSeek code review will not run automatically upon PR creatio
```js ```js
{ {
// `$model` default value: deepseek-chat // `$model` default value: deepseek-v4-flash
model: $model, model: $model,
stream: false, stream: false,
temperature: $temperature, temperature: $temperature,
@@ -181,7 +181,7 @@ Flags:
-t, --diff-to <string>: Git diff ending commit SHA -t, --diff-to <string>: Git diff ending commit SHA
-c, --patch-cmd <string>: The `git show` or `git diff` command to get the diff content, for local CR only -c, --patch-cmd <string>: The `git show` or `git diff` command to get the diff content, for local CR only
-l, --max-length <int>: Maximum length of the content for review, 0 means no limit. -l, --max-length <int>: Maximum length of the content for review, 0 means no limit.
-m, --model <string>: Model name, or read from CHAT_MODEL env var, `deepseek-chat` by default -m, --model <string>: Model name, or read from CHAT_MODEL env var, `deepseek-v4-flash` by default
-b, --base-url <string>: DeepSeek API base URL, fallback to BASE_URL env var -b, --base-url <string>: DeepSeek API base URL, fallback to BASE_URL env var
-U, --chat-url <string>: DeepSeek Model chat full API URL, e.g. http://localhost:11535/api/chat -U, --chat-url <string>: DeepSeek Model chat full API URL, e.g. http://localhost:11535/api/chat
-s, --sys-prompt <string>: Default to $DEFAULT_OPTIONS.SYS_PROMPT, -s, --sys-prompt <string>: Default to $DEFAULT_OPTIONS.SYS_PROMPT,

View File

@@ -117,7 +117,7 @@ jobs:
| 名称 | 类型 | 描述 | | 名称 | 类型 | 描述 |
| -------------- | ------ | -------------------------------------------------------------- | | -------------- | ------ | -------------------------------------------------------------- |
| chat-token | String | 必填DeepSeek API Token | | chat-token | String | 必填DeepSeek API Token |
| model | String | 可选,配置代码审查选用的模型,默认为 `deepseek-chat` | | model | String | 可选,配置代码审查选用的模型,默认为 `deepseek-v4-flash` |
| base-url | String | 可选DeepSeek API Base URL, 默认为 `https://api.deepseek.com` | | base-url | String | 可选DeepSeek API Base URL, 默认为 `https://api.deepseek.com` |
| max-length | Int | 可选,待审查内容的最大 Unicode 长度, 默认 `0` 表示没有限制,超过非零值则跳过审查 | | max-length | Int | 可选,待审查内容的最大 Unicode 长度, 默认 `0` 表示没有限制,超过非零值则跳过审查 |
| sys-prompt | String | 可选,系统提示词对应入参中的 `$sys_prompt`, 默认值见后文注释 | | sys-prompt | String | 可选,系统提示词对应入参中的 `$sys_prompt`, 默认值见后文注释 |
@@ -131,7 +131,7 @@ DeepSeek 接口调用入参:
```js ```js
{ {
// `$model` default value: deepseek-chat // `$model` default value: deepseek-v4-flash
model: $model, model: $model,
stream: false, stream: false,
temperature: $temperature, temperature: $temperature,
@@ -178,7 +178,7 @@ Flags:
-t, --diff-to <string>: Git diff ending commit SHA -t, --diff-to <string>: Git diff ending commit SHA
-c, --patch-cmd <string>: The `git show` or `git diff` command to get the diff content, for local CR only -c, --patch-cmd <string>: The `git show` or `git diff` command to get the diff content, for local CR only
-l, --max-length <int>: Maximum length of the content for review, 0 means no limit. -l, --max-length <int>: Maximum length of the content for review, 0 means no limit.
-m, --model <string>: Model name, or read from CHAT_MODEL env var, `deepseek-chat` by default -m, --model <string>: Model name, or read from CHAT_MODEL env var, `deepseek-v4-flash` by default
-b, --base-url <string>: DeepSeek API base URL, fallback to BASE_URL env var -b, --base-url <string>: DeepSeek API base URL, fallback to BASE_URL env var
-U, --chat-url <string>: DeepSeek Model chat full API URL, e.g. http://localhost:11535/api/chat -U, --chat-url <string>: DeepSeek Model chat full API URL, e.g. http://localhost:11535/api/chat
-s, --sys-prompt <string>: Default to $DEFAULT_OPTIONS.SYS_PROMPT, -s, --sys-prompt <string>: Default to $DEFAULT_OPTIONS.SYS_PROMPT,

View File

@@ -24,7 +24,7 @@ inputs:
description: 'The maximum length of the content for review, 0 means no limit.' description: 'The maximum length of the content for review, 0 means no limit.'
model: model:
required: false required: false
default: 'deepseek-chat' default: 'deepseek-v4-flash'
description: 'The DeepSeek model to choose for code review.' description: 'The DeepSeek model to choose for code review.'
temperature: temperature:
required: false required: false

View File

@@ -50,7 +50,7 @@ providers:
token: 'YOUR_DEEPSEEK_TOKEN' # Required, The API token for the provider token: 'YOUR_DEEPSEEK_TOKEN' # Required, The API token for the provider
base-url: 'https://api.deepseek.com' base-url: 'https://api.deepseek.com'
models: models:
- name: 'deepseek-chat' # Required, Pass the model name to --model flag to use it - name: 'deepseek-v4-flash' # Required, Pass the model name to --model flag to use it
alias: v3 # Optional, Alias name could also be passed to --model flag alias: v3 # Optional, Alias name could also be passed to --model flag
enabled: true # One and Only one model could be enabled in one model group enabled: true # One and Only one model could be enabled in one model group
description: 'DeepSeek V3' # Optional, Description of the model, won't be used actually description: 'DeepSeek V3' # Optional, Description of the model, won't be used actually

2
cr
View File

@@ -18,7 +18,7 @@ def main [
--diff-to(-t): string, # Git diff ending commit SHA --diff-to(-t): string, # Git diff ending commit SHA
--patch-cmd(-c): string, # The `git show` or `git diff` command to get the diff content, for local CR only --patch-cmd(-c): string, # The `git show` or `git diff` command to get the diff content, for local CR only
--max-length(-l): int, # Maximum length of the content for review, 0 means no limit. --max-length(-l): int, # Maximum length of the content for review, 0 means no limit.
--model(-m): string, # Model name, or read from CHAT_MODEL env var, `deepseek-chat` by default --model(-m): string, # Model name, or read from CHAT_MODEL env var, `deepseek-v4-flash` by default
--base-url(-b): string, # DeepSeek API base URL, fallback to BASE_URL env var --base-url(-b): string, # DeepSeek API base URL, fallback to BASE_URL env var
--chat-url(-U): string, # DeepSeek Model chat full API URL, e.g. http://localhost:11535/api/chat --chat-url(-U): string, # DeepSeek Model chat full API URL, e.g. http://localhost:11535/api/chat
--sys-prompt(-s): string # Default to $DEFAULT_OPTIONS.SYS_PROMPT, --sys-prompt(-s): string # Default to $DEFAULT_OPTIONS.SYS_PROMPT,

View File

@@ -43,7 +43,7 @@ const IGNORED_MESSAGES = {
const HTTP_HEADERS = [User-Agent curl/8.9] const HTTP_HEADERS = [User-Agent curl/8.9]
const DEFAULT_OPTIONS = { const DEFAULT_OPTIONS = {
MODEL: 'deepseek-chat', MODEL: 'deepseek-v4-flash',
TEMPERATURE: 0.3, TEMPERATURE: 0.3,
BASE_URL: 'https://api.deepseek.com', BASE_URL: 'https://api.deepseek.com',
USER_PROMPT: 'Please review the following code changes:', USER_PROMPT: 'Please review the following code changes:',
@@ -62,7 +62,7 @@ export def --env deepseek-review [
--diff-from(-f): string, # Git diff starting commit SHA --diff-from(-f): string, # Git diff starting commit SHA
--patch-cmd(-c): string, # The `git show` or `git diff` command to get the diff content, for local CR only --patch-cmd(-c): string, # The `git show` or `git diff` command to get the diff content, for local CR only
--max-length(-l): int, # Maximum length of the content for review, 0 means no limit. --max-length(-l): int, # Maximum length of the content for review, 0 means no limit.
--model(-m): string, # Model name, or read from CHAT_MODEL env var, `deepseek-chat` by default --model(-m): string, # Model name, or read from CHAT_MODEL env var, `deepseek-v4-flash` by default
--base-url(-b): string, # DeepSeek API base URL, fallback to BASE_URL env var --base-url(-b): string, # DeepSeek API base URL, fallback to BASE_URL env var
--chat-url(-U): string, # DeepSeek Model chat full API URL, e.g. http://localhost:11535/api/chat --chat-url(-U): string, # DeepSeek Model chat full API URL, e.g. http://localhost:11535/api/chat
--sys-prompt(-s): string # Default to $DEFAULT_OPTIONS.SYS_PROMPT, --sys-prompt(-s): string # Default to $DEFAULT_OPTIONS.SYS_PROMPT,
@@ -135,7 +135,8 @@ export def --env deepseek-review [
messages: [ messages: [
{ role: 'system', content: $sys_prompt }, { role: 'system', content: $sys_prompt },
{ role: 'user', content: $"($user_prompt):\n($content)" } { role: 'user', content: $"($user_prompt):\n($content)" }
] ],
thinking: { type: 'disabled' }
} }
if $debug { print $'(char nl)Code Changes:'; hr-line; print $content } if $debug { print $'(char nl)Code Changes:'; hr-line; print $content }
print $'(char nl)Waiting for response from (ansi g)($url)(ansi reset) ...' print $'(char nl)Waiting for response from (ansi g)($url)(ansi reset) ...'