mirror of
https://github.com/alibaba/open-code-review.git
synced 2026-08-25 08:32:59 +00:00
docs(examples): OCR_LLM_MODEL is required, not optional (#431)
This commit is contained in:
parent
c60e88650a
commit
83dacc2725
3 changed files with 16 additions and 11 deletions
|
|
@ -39,7 +39,7 @@ Go to **Settings → CI/CD → Variables** and add:
|
|||
| `OCR_LLM_URL` | Yes | LLM API endpoint URL |
|
||||
| `OCR_LLM_AUTH_TOKEN` | Yes | LLM API authentication token |
|
||||
| `GITFLIC_TOKEN` | Yes | GitFlic access token used to post discussions |
|
||||
| `OCR_LLM_MODEL` | No | Model name (e.g., `gpt-4o`) |
|
||||
| `OCR_LLM_MODEL` | Yes | Model name (e.g., `gpt-4o`) — OCR has no built-in default model and fails when this is unset |
|
||||
| `GITFLIC_API_URL` | No | REST API base URL for self-hosted GitFlic (default: `https://api.gitflic.ru`) |
|
||||
|
||||
> **Note:** GitFlic CI/CD does not accept variables with values shorter than 8 characters, so `use_anthropic` cannot be set as a CI variable. The pipeline sets it to `false`; to use Anthropic Claude models, edit `gitflic-ci.yaml` directly.
|
||||
|
|
|
|||
|
|
@ -7,9 +7,10 @@
|
|||
# Required CI/CD Variables (Settings → CI/CD → Variables):
|
||||
# OCR_LLM_URL - LLM API endpoint (e.g., https://api.openai.com/v1/chat/completions)
|
||||
# OCR_LLM_AUTH_TOKEN - Authentication token for the LLM API (mark as "Masked")
|
||||
# OCR_LLM_MODEL - Model name (e.g., gpt-4o). OCR has no built-in default model; the
|
||||
# pipeline fails fast if this is unset.
|
||||
#
|
||||
# Optional CI/CD Variables:
|
||||
# OCR_LLM_MODEL - Model name (default: gpt-4o)
|
||||
# GITLAB_API_TOKEN - GitLab Personal/Project Access Token with "api" scope
|
||||
# (falls back to CI_JOB_TOKEN if not set)
|
||||
#
|
||||
|
|
@ -48,12 +49,14 @@ code-review:
|
|||
- echo "OpenCodeReview installed with version:" && ocr version || true
|
||||
|
||||
# Configure OCR
|
||||
- mkdir -p ~/.open-code-review
|
||||
# Gitlab CI/CD does not support configuring variables with value length less than 8, so you can't set use_anthropic as a CI variable
|
||||
- |
|
||||
ocr config set llm.url $OCR_LLM_URL
|
||||
ocr config set llm.auth_token $OCR_LLM_AUTH_TOKEN
|
||||
ocr config set llm.model $OCR_LLM_MODEL
|
||||
: "${OCR_LLM_URL:?set OCR_LLM_URL in Settings -> CI/CD -> Variables}"
|
||||
: "${OCR_LLM_AUTH_TOKEN:?set OCR_LLM_AUTH_TOKEN in Settings -> CI/CD -> Variables}"
|
||||
: "${OCR_LLM_MODEL:?set OCR_LLM_MODEL in Settings -> CI/CD -> Variables}"
|
||||
ocr config set llm.url "$OCR_LLM_URL"
|
||||
ocr config set llm.auth_token "$OCR_LLM_AUTH_TOKEN"
|
||||
ocr config set llm.model "$OCR_LLM_MODEL"
|
||||
ocr config set llm.use_anthropic false
|
||||
ocr config set llm.extra_body '{"thinking": {"type": "disabled"}}'
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ Go to your project's **Settings → CI/CD → Variables** and add:
|
|||
|----------|----------|--------|-------------|
|
||||
| `OCR_LLM_URL` | Yes | No | LLM API endpoint URL (e.g., `https://api.openai.com/v1/chat/completions`) |
|
||||
| `OCR_LLM_AUTH_TOKEN` | Yes | Yes | API authentication token |
|
||||
| `OCR_LLM_MODEL` | No | No | Model name (defaults to `gpt-4o`) |
|
||||
| `OCR_LLM_MODEL` | Yes | No | Model name (e.g., `gpt-4o`) — OCR has no built-in default model and fails when this is unset |
|
||||
| `GITLAB_API_TOKEN` | No | Yes | GitLab access token with `api` scope (falls back to `CI_JOB_TOKEN` if not set) |
|
||||
|
||||
> **Note:** GitLab CI/CD does not support variables with values shorter than 8 characters, so `use_anthropic` cannot be set as a CI variable. The pipeline sets it to `false` by default. If you need to use Anthropic Claude models, you'll need to modify the `.gitlab-ci.yml` script directly.
|
||||
|
|
@ -145,11 +145,13 @@ script:
|
|||
- npm install -g @alibaba-group/open-code-review
|
||||
|
||||
# Configure OCR
|
||||
- mkdir -p ~/.open-code-review
|
||||
- |
|
||||
ocr config set llm.url $OCR_LLM_URL
|
||||
ocr config set llm.auth_token $OCR_LLM_AUTH_TOKEN
|
||||
ocr config set llm.model $OCR_LLM_MODEL
|
||||
: "${OCR_LLM_URL:?set OCR_LLM_URL in Settings -> CI/CD -> Variables}"
|
||||
: "${OCR_LLM_AUTH_TOKEN:?set OCR_LLM_AUTH_TOKEN in Settings -> CI/CD -> Variables}"
|
||||
: "${OCR_LLM_MODEL:?set OCR_LLM_MODEL in Settings -> CI/CD -> Variables}"
|
||||
ocr config set llm.url "$OCR_LLM_URL"
|
||||
ocr config set llm.auth_token "$OCR_LLM_AUTH_TOKEN"
|
||||
ocr config set llm.model "$OCR_LLM_MODEL"
|
||||
ocr config set llm.use_anthropic false
|
||||
ocr config set llm.extra_body '{"thinking": {"type": "disabled"}}'
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue