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:
@@ -119,7 +119,7 @@ With this setup, DeepSeek code review will not run automatically upon PR creatio
|
||||
| Name | Type | Description |
|
||||
| -------------- | ------ | ----------------------------------------------------------------------- |
|
||||
| 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` |
|
||||
| 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 |
|
||||
@@ -133,7 +133,7 @@ With this setup, DeepSeek code review will not run automatically upon PR creatio
|
||||
|
||||
```js
|
||||
{
|
||||
// `$model` default value: deepseek-chat
|
||||
// `$model` default value: deepseek-v4-flash
|
||||
model: $model,
|
||||
stream: false,
|
||||
temperature: $temperature,
|
||||
@@ -181,7 +181,7 @@ Flags:
|
||||
-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
|
||||
-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
|
||||
-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,
|
||||
|
||||
@@ -117,7 +117,7 @@ jobs:
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------------- | ------ | -------------------------------------------------------------- |
|
||||
| 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` |
|
||||
| max-length | Int | 可选,待审查内容的最大 Unicode 长度, 默认 `0` 表示没有限制,超过非零值则跳过审查 |
|
||||
| sys-prompt | String | 可选,系统提示词对应入参中的 `$sys_prompt`, 默认值见后文注释 |
|
||||
@@ -131,7 +131,7 @@ DeepSeek 接口调用入参:
|
||||
|
||||
```js
|
||||
{
|
||||
// `$model` default value: deepseek-chat
|
||||
// `$model` default value: deepseek-v4-flash
|
||||
model: $model,
|
||||
stream: false,
|
||||
temperature: $temperature,
|
||||
@@ -178,7 +178,7 @@ Flags:
|
||||
-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
|
||||
-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
|
||||
-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,
|
||||
|
||||
@@ -24,7 +24,7 @@ inputs:
|
||||
description: 'The maximum length of the content for review, 0 means no limit.'
|
||||
model:
|
||||
required: false
|
||||
default: 'deepseek-chat'
|
||||
default: 'deepseek-v4-flash'
|
||||
description: 'The DeepSeek model to choose for code review.'
|
||||
temperature:
|
||||
required: false
|
||||
|
||||
@@ -50,7 +50,7 @@ providers:
|
||||
token: 'YOUR_DEEPSEEK_TOKEN' # Required, The API token for the provider
|
||||
base-url: 'https://api.deepseek.com'
|
||||
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
|
||||
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
|
||||
|
||||
2
cr
2
cr
@@ -18,7 +18,7 @@ def main [
|
||||
--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
|
||||
--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
|
||||
--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,
|
||||
|
||||
@@ -43,7 +43,7 @@ const IGNORED_MESSAGES = {
|
||||
const HTTP_HEADERS = [User-Agent curl/8.9]
|
||||
|
||||
const DEFAULT_OPTIONS = {
|
||||
MODEL: 'deepseek-chat',
|
||||
MODEL: 'deepseek-v4-flash',
|
||||
TEMPERATURE: 0.3,
|
||||
BASE_URL: 'https://api.deepseek.com',
|
||||
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
|
||||
--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.
|
||||
--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
|
||||
--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,
|
||||
@@ -135,7 +135,8 @@ export def --env deepseek-review [
|
||||
messages: [
|
||||
{ role: 'system', content: $sys_prompt },
|
||||
{ role: 'user', content: $"($user_prompt):\n($content)" }
|
||||
]
|
||||
],
|
||||
thinking: { type: 'disabled' }
|
||||
}
|
||||
if $debug { print $'(char nl)Code Changes:'; hr-line; print $content }
|
||||
print $'(char nl)Waiting for response from (ansi g)($url)(ansi reset) ...'
|
||||
|
||||
Reference in New Issue
Block a user