Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions .github/workflows/ai-review-kimi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,15 @@ on:
type: number
default: 4096
temperature:
description: 'AI temperature setting'
description: >-
Sampling temperature as a string, or '' (the default) to omit the
field and let the model apply its own. Kimi pins this per model:
kimi-k3 and kimi-k2.7-code are fixed at 1.0, and kimi-k2.6 requires
1.0 with thinking enabled but 0.6 with it disabled. Any other value
is a 400, so omitting it is the only value correct for every model.
required: false
type: number
default: 1
type: string
default: ''
secrets:
KIMI_API_KEY:
description: 'Moonshot AI API key'
Expand Down Expand Up @@ -143,7 +148,7 @@ jobs:
--arg system "$SYSTEM_PROMPT" \
--arg user "$USER_PROMPT" \
--argjson max_tokens "$MAX_TOKENS" \
--argjson temperature "$TEMPERATURE" \
--arg temperature "$TEMPERATURE" \
--arg thinking "$THINKING" \
--rawfile diff /tmp/pr_diff_truncated.txt \
'{
Expand All @@ -152,10 +157,10 @@ jobs:
{ role: "system", content: $system },
{ role: "user", content: ($user + "\n\nDiff:\n" + $diff) }
],
temperature: $temperature,
max_tokens: $max_tokens
}
+ (if $thinking == "" then {} else { thinking: { type: $thinking } } end)' > /tmp/payload.json
+ (if $thinking == "" then {} else { thinking: { type: $thinking } } end)
+ (if $temperature == "" then {} else { temperature: ($temperature | tonumber) } end)' > /tmp/payload.json

RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "https://api.moonshot.ai/v1/chat/completions" \
-H "Content-Type: application/json" \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
thinking: 'disabled' # 'disabled', 'enabled', or '' to omit
max_diff_lines: 10000 # Max lines of diff to review
max_tokens: 4096 # Max response tokens
temperature: 1 # AI temperature (1 required for reasoning models)
temperature: '' # '' omits it; Kimi pins temperature per model
prompt: '' # Custom prompt (overrides prompt file)
```

Expand Down