docs: fix broken translated pages (#58278)

This commit is contained in:
DS 2026-10-22 21:16:39 -04:00 • committed by GitHub
parent 8c5b202815
commit 1e4661adfc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 304 additions and 1338 deletions

View file

@ -57,13 +57,13 @@ opencode github install
permissions:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Run OpenCode
- name: Run OpenCode
uses: anomalyco/opencode/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

View file

@ -37,36 +37,36 @@ Ili ga možete postaviti ručno.
Dodajte sljedeći fajl toka posla u `.github/workflows/opencode.yml` u svoj repo. Obavezno postavite odgovarajuće `model` i potrebne API ključeve u `env`.
```yml title=".github/workflows/opencode.yml" {24,26}
name: opencode
name: opencode
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
jobs:
opencode:
if: |
contains(github.event.comment.body, '/oc') ||
contains(github.event.comment.body, '/opencode')
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
jobs:
opencode:
if: |
contains(github.event.comment.body, '/oc') ||
contains(github.event.comment.body, '/opencode')
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Run OpenCode
uses: anomalyco/opencode/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
with:
model: anthropic/claude-sonnet-4-20250514
# github_token: xxxx
- name: Run OpenCode
uses: anomalyco/opencode/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
with:
model: anthropic/claude-sonnet-4-20250514
# github_token: xxxx
```
3. **Sačuvaj API ključeve u tajne**

View file

@ -57,13 +57,13 @@ Eller du kan indstille det manuelt.
permissions:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Run OpenCode
- name: Run OpenCode
uses: anomalyco/opencode/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

View file

@ -57,13 +57,13 @@ Oder Sie können es manuell einrichten.
permissions:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Run OpenCode
- name: Run OpenCode
uses: anomalyco/opencode/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

View file

@ -57,13 +57,13 @@ O puede configurarlo manualmente.
permissions:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Run OpenCode
- name: Run OpenCode
uses: anomalyco/opencode/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

View file

@ -40,36 +40,36 @@ Rendez-vous sur [**github.com/apps/opencode-agent**](https://github.com/apps/ope
Ajoutez le fichier de workflow suivant à `.github/workflows/opencode.yml` dans votre dépôt. Assurez-vous de définir les clés `model` appropriées et les clés API requises dans `env`.
```yml title=".github/workflows/opencode.yml" {24,26}
name: opencode
name: opencode
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
jobs:
opencode:
if: |
contains(github.event.comment.body, '/oc') ||
contains(github.event.comment.body, '/opencode')
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
jobs:
opencode:
if: |
contains(github.event.comment.body, '/oc') ||
contains(github.event.comment.body, '/opencode')
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Run OpenCode
uses: anomalyco/opencode/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
with:
model: anthropic/claude-sonnet-4-20250514
# github_token: xxxx
- name: Run OpenCode
uses: anomalyco/opencode/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
with:
model: anthropic/claude-sonnet-4-20250514
# github_token: xxxx
```
3. **Stockez les clés API dans les secrets**

View file

@ -746,8 +746,6 @@ Sélectionnez **OAuth** et votre navigateur s'ouvrira pour autorisation.
/models
```
````
Trois modèles basés sur Claude sont disponibles :
- **duo-chat-haiku-4-5** (Par défaut) - Réponses rapides pour des tâches rapides
@ -769,10 +767,10 @@ Fichier `opencode.json`.
```json
{
"$schema": "https://opencode.ai/config.json",
"small_model": "gitlab/duo-chat-haiku-4-5"
"$schema": "https://opencode.ai/config.json",
"small_model": "gitlab/duo-chat-haiku-4-5"
}
````
```
:::

View file

@ -57,13 +57,13 @@ In alternativa, puoi configurarlo manualmente.
permissions:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Run OpenCode
- name: Run OpenCode
uses: anomalyco/opencode/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

View file

@ -40,36 +40,36 @@ opencode github install
次のワークフローファイルをリポジトリの `.github/workflows/opencode.yml` に追加します。適切な `model` と必要な API キーを `env` に設定してください。
```yml title=".github/workflows/opencode.yml" {24,26}
name: opencode
name: opencode
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
jobs:
opencode:
if: |
contains(github.event.comment.body, '/oc') ||
contains(github.event.comment.body, '/opencode')
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
jobs:
opencode:
if: |
contains(github.event.comment.body, '/oc') ||
contains(github.event.comment.body, '/opencode')
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Run OpenCode
uses: anomalyco/opencode/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
with:
model: anthropic/claude-sonnet-4-20250514
# github_token: xxxx
- name: Run OpenCode
uses: anomalyco/opencode/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
with:
model: anthropic/claude-sonnet-4-20250514
# github_token: xxxx
```
3. **API キーをシークレットに保存する**

View file

@ -230,6 +230,76 @@ export const NotificationPlugin = async ({ project, client, $, directory, worktr
macOS 上で AppleScript を実行するために `osascript` を使用しています。ここでは通知を送信するために使用しています。
---
### .env の保護
OpenCode が `.env` ファイルを読み取らないようにします。
```javascript title=".opencode/plugins/env-protection.js"
export const EnvProtection = async ({ project, client, $, directory, worktree }) => {
return {
"tool.execute.before": async (input, output) => {
if (input.tool === "read" && output.args.filePath.includes(".env")) {
throw new Error("Do not read .env files")
}
},
}
}
```
---
### 環境変数を挿入する
すべてのシェル実行 (AI ツールとユーザーターミナル) に環境変数を挿入します。
```javascript title=".opencode/plugins/inject-env.js"
export const InjectEnvPlugin = async () => {
return {
"shell.env": async (input, output) => {
output.env.MY_API_KEY = "secret"
output.env.PROJECT_ROOT = input.cwd
},
}
}
```
---
### カスタムツール
プラグインは OpenCode にカスタムツールを追加することもできます。
```ts title=".opencode/plugins/custom-tools.ts"
import { type Plugin, tool } from "@opencode-ai/plugin"
export const CustomToolsPlugin: Plugin = async (ctx) => {
return {
tool: {
mytool: tool({
description: "This is a custom tool",
args: {
foo: tool.schema.string(),
},
async execute(args, context) {
const { directory, worktree } = context
return `Hello ${args.foo} from ${directory} (worktree: ${worktree})`
},
}),
},
}
}
```
`tool` ヘルパーは、OpenCode が呼び出すことができるカスタムツールを作成します。 Zod スキーマ関数を受け取り、次のようなツール定義を返します。
- `description`: ツールの機能
- `args`: ツールの引数の Zod スキーマ
- `execute`: ツールが呼び出されたときに実行される関数
カスタムツールは、組み込みツールと並行して OpenCode で使用できます。
:::note
組み込みツールと同じ名前のプラグインツールを使用すると、プラグインツールが優先されます。
:::
@ -309,149 +379,3 @@ Format as a structured prompt that a new agent can use to resume work.
```
`output.prompt` を設定すると、デフォルトの圧縮プロンプトが完全に置き換えられます。この場合、`output.context` 配列は無視されます。
---
### .env の保護
OpenCode が `.env` ファイルを読み取らないようにします。
```javascript title=".opencode/plugins/env-protection.js"
export const EnvProtection = async ({ project, client, $, directory, worktree }) => {
return {
"tool.execute.before": async (input, output) => {
if (input.tool === "read" && output.args.filePath.includes(".env")) {
throw new Error("Do not read .env files")
}
},
}
}
```
---
### 環境変数を挿入する
すべてのシェル実行 (AI ツールとユーザーターミナル) に環境変数を挿入します。
```javascript title=".opencode/plugins/inject-env.js"
export const InjectEnvPlugin = async () => {
return {
"shell.env": async (input, output) => {
output.env.MY_API_KEY = "secret"
output.env.PROJECT_ROOT = input.cwd
},
}
}
```
---
### カスタムツール
プラグインは OpenCode にカスタムツールを追加することもできます。
```ts title=".opencode/plugins/custom-tools.ts"
import { type Plugin, tool } from "@opencode-ai/plugin"
export const CustomToolsPlugin: Plugin = async (ctx) => {
return {
tool: {
mytool: tool({
description: "This is a custom tool",
args: {
foo: tool.schema.string(),
},
async execute(args, context) {
const { directory, worktree } = context
return `Hello ${args.foo} from ${directory} (worktree: ${worktree})`
},
}),
},
}
}
```
`tool` ヘルパーは、OpenCode が呼び出すことができるカスタムツールを作成します。 Zod スキーマ関数を受け取り、次のようなツール定義を返します。
- `description`: ツールの機能
- `args`: ツールの引数の Zod スキーマ
- `execute`: ツールが呼び出されたときに実行される関数
カスタムツールは、組み込みツールと並行して OpenCode で使用できます。
---
### ロギング
構造化ログには `client.app.log()` の代わりに `console.log` を使用します。
```ts title=".opencode/plugins/my-plugin.ts"
export const MyPlugin = async ({ client }) => {
await client.app.log({
body: {
service: "my-plugin",
level: "info",
message: "Plugin initialized",
extra: { foo: "bar" },
},
})
}
```
レベル: `debug`、`info`、`warn`、`error`。詳細については、[SDK ドキュメント](https://opencode.ai/docs/sdk) を参照してください。
---
### 圧縮フック
セッションが圧縮されたときに含まれるコンテキストをカスタマイズします。
```ts title=".opencode/plugins/compaction.ts"
import type { Plugin } from "@opencode-ai/plugin"
export const CompactionPlugin: Plugin = async (ctx) => {
return {
"experimental.session.compacting": async (input, output) => {
// Inject additional context into the compaction prompt
output.context.push(`
## Custom Context
Include any state that should persist across compaction:
- Current task status
- Important decisions made
- Files being actively worked on
`)
},
}
}
```
`experimental.session.compacting` フックは、LLM が継続概要を生成する前に起動します。これを使用して、デフォルトの圧縮プロンプトでは見逃されるドメイン固有のコンテキストを挿入します。
`output.prompt` を設定することで、圧縮プロンプトを完全に置き換えることもできます。
```ts title=".opencode/plugins/custom-compaction.ts"
import type { Plugin } from "@opencode-ai/plugin"
export const CustomCompactionPlugin: Plugin = async (ctx) => {
return {
"experimental.session.compacting": async (input, output) => {
// Replace the entire compaction prompt
output.prompt = `
You are generating a continuation prompt for a multi-agent swarm session.
Summarize:
1. The current task and its status
2. Which files are being modified and by whom
3. Any blockers or dependencies between agents
4. The next steps to complete the work
Format as a structured prompt that a new agent can use to resume work.
`
},
}
}
```
`output.prompt` を設定すると、デフォルトの圧縮プロンプトが完全に置き換えられます。この場合、`output.context` 配列は無視されます。

View file

@ -750,39 +750,6 @@ GitLab Duo は、GitLab の Anthropic プロキシを介したネイティブツ
/models
```
---
### STACKIT
STACKIT AI Model Serving は、Llama、Mistral、Qwen などの LLM に焦点を当て、ヨーロッパのインフラストラクチャでの最大限のデータ主権を備えた、AI モデル用の完全に管理された主権ホスティング環境を提供します。
1. [STACKIT Portal](https://portal.stackit.cloud) に移動し、**AI Model Serving** に移動して、プロジェクトの認証トークンを作成します。
:::tip
認証トークンを作成する前に、STACKIT 顧客アカウント、ユーザーアカウント、およびプロジェクトが必要です。
:::
2. `/connect` コマンドを実行し、**STACKIT** を検索します。
```txt
/connect
```
3. STACKIT AI Model Serving 認証トークンを入力します。
```txt
┌ API key
│
│
└ enter
```
4. `/models` コマンドを実行して、_Qwen3-VL 235B_ や _Llama 3.3 70B_ などの利用可能なモデルから選択します。
```txt
/models
```
3 つの Claude ベースのモデルが利用可能です。
- **duo-chat-haiku-4-5** (デフォルト) - 素早いタスクに対する素早い応答
@ -895,8 +862,7 @@ GitLab ツール (マージリクエスト、問題、パイプライン、CI/CD
GitHub Copilot サブスクリプションを OpenCode で使用するには:
:::note
一部のモデルでは [Pro+] が必要になる場合があります。
subscription](https://github.com/features/copilot/plans) を使用します。
一部のモデルでは [Pro+ subscription](https://github.com/features/copilot/plans) が必要になる場合があります。
一部のモデルは、[GitHub Copilot settings](https://docs.github.com/en/copilot/how-tos/use-ai-models/configure-access-to-ai-models#setup-for-individual-use) で構成する必要があります。
:::
@ -1587,6 +1553,39 @@ SAP AI コアは、統合プラットフォームを通じて、OpenAI、Anthrop
---
### STACKIT
STACKIT AI Model Serving は、Llama、Mistral、Qwen などの LLM に焦点を当て、ヨーロッパのインフラストラクチャでの最大限のデータ主権を備えた、AI モデル用の完全に管理された主権ホスティング環境を提供します。
1. [STACKIT Portal](https://portal.stackit.cloud) に移動し、**AI Model Serving** に移動して、プロジェクトの認証トークンを作成します。
:::tip
認証トークンを作成する前に、STACKIT 顧客アカウント、ユーザーアカウント、およびプロジェクトが必要です。
:::
2. `/connect` コマンドを実行し、**STACKIT** を検索します。
```txt
/connect
```
3. STACKIT AI Model Serving 認証トークンを入力します。
```txt
┌ API key
│
│
└ enter
```
4. `/models` コマンドを実行して、_Qwen3-VL 235B_ や _Llama 3.3 70B_ などの利用可能なモデルから選択します。
```txt
/models
```
---
### OVHcloud AI Endpoints
1. [OVHcloud パネル](https://ovh.com/manager) に移動します。 `Public Cloud` セクション、`AI & Machine Learning` > `AI Endpoints` に移動し、`API Keys` タブで **新しい API キーの作成** をクリックします。

View file

@ -367,301 +367,3 @@ vim .opencode/themes/my-theme.json
}
}
```
---
## カスタムテーマ
OpenCode は、ユーザーがテーマを簡単に作成およびカスタマイズできる柔軟な JSON ベースのテーマ システムをサポートしています。
---
### 階層
テーマは複数のディレクトリから次の順序でロードされ、後のディレクトリが前のディレクトリをオーバーライドします。
1. **組み込みテーマ** - これらはバイナリに埋め込まれています
2. **ユーザー設定ディレクトリ** - `~/.config/opencode/themes/*.json` または `$XDG_CONFIG_HOME/opencode/themes/*.json` で定義されます
3. **プロジェクトのルート ディレクトリ** - `<project-root>/.opencode/themes/*.json` で定義されます。
4. **現在の作業ディレクトリ** - `./.opencode/themes/*.json` で定義
複数のディレクトリに同じ名前のテーマが含まれている場合は、優先度の高いディレクトリのテーマが使用されます。
---
### テーマの作成
カスタム テーマを作成するには、テーマ ディレクトリの 1 つに JSON ファイルを作成します。
ユーザー全体のテーマの場合:
```bash no-frame
mkdir -p ~/.config/opencode/themes
vim ~/.config/opencode/themes/my-theme.json
```
そしてプロジェクト固有のテーマについても。
```bash no-frame
mkdir -p .opencode/themes
vim .opencode/themes/my-theme.json
```
---
### JSON形式
テーマは、以下をサポートする柔軟な JSON 形式を使用します。
- **16 進数の色**: `"#ffffff"`
- **ANSI カラー**: `3` (0-255)
- **色の参照**: `"primary"` またはカスタム定義
- **ダーク/ライトのバリエーション**: `{"dark": "#000", "light": "#fff"}`
- **色なし**: `"none"` - terminal のデフォルトの色または透明を使用します。
---
### 色の定義
`defs` セクションはオプションであり、テーマ内で参照できる再利用可能な色を定義できます。
---
### ターミナルのデフォルト
特別な値 `"none"` を任意の色に使用して、terminal のデフォルトの色を継承できます。これは、terminal の配色とシームレスに融合するテーマを作成する場合に特に便利です。
- `"text": "none"` - terminal のデフォルトの前景色を使用します
- `"background": "none"` - terminal のデフォルトの背景色を使用します
---
### 例
カスタム テーマの例を次に示します。
```json title="my-theme.json"
{
"$schema": "https://opencode.ai/theme.json",
"defs": {
"nord0": "#2E3440",
"nord1": "#3B4252",
"nord2": "#434C5E",
"nord3": "#4C566A",
"nord4": "#D8DEE9",
"nord5": "#E5E9F0",
"nord6": "#ECEFF4",
"nord7": "#8FBCBB",
"nord8": "#88C0D0",
"nord9": "#81A1C1",
"nord10": "#5E81AC",
"nord11": "#BF616A",
"nord12": "#D08770",
"nord13": "#EBCB8B",
"nord14": "#A3BE8C",
"nord15": "#B48EAD"
},
"theme": {
"primary": {
"dark": "nord8",
"light": "nord10"
},
"secondary": {
"dark": "nord9",
"light": "nord9"
},
"accent": {
"dark": "nord7",
"light": "nord7"
},
"error": {
"dark": "nord11",
"light": "nord11"
},
"warning": {
"dark": "nord12",
"light": "nord12"
},
"success": {
"dark": "nord14",
"light": "nord14"
},
"info": {
"dark": "nord8",
"light": "nord10"
},
"text": {
"dark": "nord4",
"light": "nord0"
},
"textMuted": {
"dark": "nord3",
"light": "nord1"
},
"background": {
"dark": "nord0",
"light": "nord6"
},
"backgroundPanel": {
"dark": "nord1",
"light": "nord5"
},
"backgroundElement": {
"dark": "nord1",
"light": "nord4"
},
"border": {
"dark": "nord2",
"light": "nord3"
},
"borderActive": {
"dark": "nord3",
"light": "nord2"
},
"borderSubtle": {
"dark": "nord2",
"light": "nord3"
},
"diffAdded": {
"dark": "nord14",
"light": "nord14"
},
"diffRemoved": {
"dark": "nord11",
"light": "nord11"
},
"diffContext": {
"dark": "nord3",
"light": "nord3"
},
"diffHunkHeader": {
"dark": "nord3",
"light": "nord3"
},
"diffHighlightAdded": {
"dark": "nord14",
"light": "nord14"
},
"diffHighlightRemoved": {
"dark": "nord11",
"light": "nord11"
},
"diffAddedBg": {
"dark": "#3B4252",
"light": "#E5E9F0"
},
"diffRemovedBg": {
"dark": "#3B4252",
"light": "#E5E9F0"
},
"diffContextBg": {
"dark": "nord1",
"light": "nord5"
},
"diffLineNumber": {
"dark": "nord2",
"light": "nord4"
},
"diffAddedLineNumberBg": {
"dark": "#3B4252",
"light": "#E5E9F0"
},
"diffRemovedLineNumberBg": {
"dark": "#3B4252",
"light": "#E5E9F0"
},
"markdownText": {
"dark": "nord4",
"light": "nord0"
},
"markdownHeading": {
"dark": "nord8",
"light": "nord10"
},
"markdownLink": {
"dark": "nord9",
"light": "nord9"
},
"markdownLinkText": {
"dark": "nord7",
"light": "nord7"
},
"markdownCode": {
"dark": "nord14",
"light": "nord14"
},
"markdownBlockQuote": {
"dark": "nord3",
"light": "nord3"
},
"markdownEmph": {
"dark": "nord12",
"light": "nord12"
},
"markdownStrong": {
"dark": "nord13",
"light": "nord13"
},
"markdownHorizontalRule": {
"dark": "nord3",
"light": "nord3"
},
"markdownListItem": {
"dark": "nord8",
"light": "nord10"
},
"markdownListEnumeration": {
"dark": "nord7",
"light": "nord7"
},
"markdownImage": {
"dark": "nord9",
"light": "nord9"
},
"markdownImageText": {
"dark": "nord7",
"light": "nord7"
},
"markdownCodeBlock": {
"dark": "nord4",
"light": "nord0"
},
"syntaxComment": {
"dark": "nord3",
"light": "nord3"
},
"syntaxKeyword": {
"dark": "nord9",
"light": "nord9"
},
"syntaxFunction": {
"dark": "nord8",
"light": "nord8"
},
"syntaxVariable": {
"dark": "nord7",
"light": "nord7"
},
"syntaxString": {
"dark": "nord14",
"light": "nord14"
},
"syntaxNumber": {
"dark": "nord15",
"light": "nord15"
},
"syntaxType": {
"dark": "nord7",
"light": "nord7"
},
"syntaxOperator": {
"dark": "nord9",
"light": "nord9"
},
"syntaxPunctuation": {
"dark": "nord4",
"light": "nord0"
}
}
}
```

View file

@ -57,13 +57,13 @@ opencode github install
permissions:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Run OpenCode
- name: Run OpenCode
uses: anomalyco/opencode/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

View file

@ -57,13 +57,13 @@ Eller du kan sette den opp manuelt.
permissions:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Run OpenCode
- name: Run OpenCode
uses: anomalyco/opencode/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

View file

@ -509,116 +509,3 @@ Alternativt kan du legge til noe slikt til din [AGENTS.md](/docs/rules/).
```md title="AGENTS.md"
If you are unsure how to do something, use `gh_grep` to search code examples from GitHub.
```
---
### Helicone
[Helicone](https://helicone.ai) er en LLM observerbarhetsplattform som gir logging, overvåking og analyser for AI-applikasjonene dine. Helicone AI Gateway ruter forespørslene dine til riktig leverandør automatisk basert på modellen.
1. Gå over til [Helicone](https://helicone.ai), opprett en konto og generer en API nøkkel fra dashbordet.
2. Kjør kommandoen `/connect` og søk etter **Helicone**.
```txt
/connect
```
3. Skriv inn Helicone API-nøkkelen.
```txt
┌ API key
│
│
└ enter
```
4. Kjør kommandoen `/models` for å velge en modell.
```txt
/models
```
For flere leverandører og avanserte funksjoner som bufring og hastighetsbegrensning, sjekk [Helicone-dokumentasjonen](https://docs.helicone.ai).
#### Valgfrie konfigurasjoner
I tilfelle du ser en funksjon eller modell fra Helicone som ikke konfigureres automatisk gjennom OpenCode, kan du alltid konfigurere den selv.
Her er [Helicone's Model Directory](https://helicone.ai/models), du trenger denne for å hente ID-ene til modellene du vil legge til.
```jsonc title="~/.config/opencode/opencode.jsonc"
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"helicone": {
"npm": "@ai-sdk/openai-compatible",
"name": "Helicone",
"options": {
"baseURL": "https://ai-gateway.helicone.ai",
},
"models": {
"gpt-4o": {
// Model ID (from Helicone's model directory page)
"name": "GPT-4o", // Your own custom name for the model
},
"claude-sonnet-4-20250514": {
"name": "Claude Sonnet 4",
},
},
},
},
}
```
#### Egendefinerte headere
Helicone støtter tilpassede headere for funksjoner som bufring, brukersporing og øktadministrasjon. Legg dem til leverandørkonfigurasjonen din ved å bruke `options.headers`:
```jsonc title="~/.config/opencode/opencode.jsonc"
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"helicone": {
"npm": "@ai-sdk/openai-compatible",
"name": "Helicone",
"options": {
"baseURL": "https://ai-gateway.helicone.ai",
"headers": {
"Helicone-Cache-Enabled": "true",
"Helicone-User-Id": "opencode",
},
},
},
},
}
```
##### Sesjonssporing
Helicones [Sessions](https://docs.helicone.ai/features/sessions) funksjon lar deg gruppere relaterte LLM forespørsler sammen. Bruk [opencode-helicone-session](https://github.com/H2Shami/opencode-helicone-session) plugin for automatisk å logge hver OpenCode-samtale som en økt i Helicone.
```bash
npm install -g opencode-helicone-session
```
Legg den til i konfigurasjonen din.
```json title="opencode.json"
{
"plugin": ["opencode-helicone-session"]
}
```
Programtillegget injiserer `Helicone-Session-Id` og `Helicone-Session-Name` overskrifter i forespørslene dine. På Helicones Sessions-side vil du se hver OpenCode-samtale oppført som en separat økt.
##### Vanlige Helicone-headere
| Overskrift | Beskrivelse |
| -------------------------- | -------------------------------------------------------------------------- |
| `Helicone-Cache-Enabled` | Aktiver responsbufring (`true`/`false`) |
| `Helicone-User-Id` | Spor beregninger etter bruker |
| `Helicone-Property-[Name]` | Legg til egendefinerte egenskaper (f.eks. `Helicone-Property-Environment`) |
| `Helicone-Prompt-Id` | Knytt forespørsler til spørsmålsversjoner |
Se [Helicone Header Directory](https://docs.helicone.ai/helicone-headers/header-directory) for alle tilgjengelige overskrifter.

View file

@ -57,13 +57,13 @@ Można też uszkodzić to rozwiązanie.
permissions:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Run OpenCode
- name: Run OpenCode
uses: anomalyco/opencode/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

View file

@ -57,13 +57,13 @@ Ou você pode configurá-lo manualmente.
permissions:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Run OpenCode
- name: Run OpenCode
uses: anomalyco/opencode/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
@ -137,15 +137,15 @@ jobs:
with:
persist-credentials: false
- name: Run OpenCode
uses: anomalyco/opencode/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
with:
model: anthropic/claude-sonnet-4-20250514
prompt: |
Revise a base de código para quaisquer comentários TODO e crie um resumo.
Se encontrar problemas que valham a pena resolver, abra um issue para rastreá-los.
- name: Run OpenCode
uses: anomalyco/opencode/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
with:
model: anthropic/claude-sonnet-4-20250514
prompt: |
Revise a base de código para quaisquer comentários TODO e crie um resumo.
Se encontrar problemas que valham a pena resolver, abra um issue para rastreá-los.
```
Para eventos agendados, a entrada `prompt` é **obrigatória** uma vez que não há comentário para extrair instruções. Fluxos de trabalho agendados são executados sem um contexto de usuário para verificação de permissões, então o fluxo de trabalho deve conceder `contents: write` e `pull-requests: write` se você espera que o opencode crie branches ou PRs.
@ -175,18 +175,18 @@ jobs:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: anomalyco/opencode/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
model: anthropic/claude-sonnet-4-20250514
use_github_token: true
prompt: |
Revise este pull request:
- Verifique problemas de qualidade de código
- Procure por potenciais bugs
- Sugira melhorias
- uses: anomalyco/opencode/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
model: anthropic/claude-sonnet-4-20250514
use_github_token: true
prompt: |
Revise este pull request:
- Verifique problemas de qualidade de código
- Procure por potenciais bugs
- Sugira melhorias
```
Para eventos de `pull_request`, se nenhum `prompt` for fornecido, o opencode padrão será revisar o pull request.
@ -231,17 +231,17 @@ jobs:
with:
persist-credentials: false
- uses: anomalyco/opencode/github@latest
if: steps.check.outputs.result == 'true'
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
with:
model: anthropic/claude-sonnet-4-20250514
prompt: |
Revise este issue. Se houver uma correção clara ou docs relevantes:
- Forneça links de documentação
- Adicione orientação sobre tratamento de erros para exemplos de código
Caso contrário, não comente.
- uses: anomalyco/opencode/github@latest
if: steps.check.outputs.result == 'true'
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
with:
model: anthropic/claude-sonnet-4-20250514
prompt: |
Revise este issue. Se houver uma correção clara ou docs relevantes:
- Forneça links de documentação
- Adicione orientação sobre tratamento de erros para exemplos de código
Caso contrário, não comente.
```
Para eventos de `issues`, a entrada `prompt` é **obrigatória** uma vez que não há comentário para extrair instruções.

View file

@ -57,13 +57,13 @@ opencode github install
permissions:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Run OpenCode
- name: Run OpenCode
uses: anomalyco/opencode/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

View file

@ -57,13 +57,13 @@ opencode github install
permissions:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Run OpenCode
- name: Run OpenCode
uses: anomalyco/opencode/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

View file

@ -1985,547 +1985,3 @@ Vercel AI Gateway ช่วยให้คุณเข้าถึงโมเ
- ตรวจสอบให้แน่ใจว่า ID ผู้ให้บริการที่ใช้ในคำสั่ง `/connect` ตรงกับ ID ในการกำหนดค่า opencode ของคุณ
- ใช้แพ็คเกจ npm ที่ถูกต้องสำหรับผู้ให้บริการ ตัวอย่างเช่น ใช้ `@ai-sdk/cerebras` สำหรับ Cerebras และสำหรับผู้ให้บริการอื่นๆ ที่เข้ากันได้กับ OpenAI ให้ใช้ `@ai-sdk/openai-compatible`
- ตรวจสอบว่าใช้จุดสิ้นสุด API ที่ถูกต้องในฟิลด์ `options.baseURL`
3. ป้อนคีย์ OpenCode API ของคุณ
```txt
┌ API key
│
│
└ enter
```
4. รันคำสั่ง `/models` เพื่อเลือกรุ่นเช่น _Qwen 3 Coder 480B_
```txt
/models
```
---
### เปิดเราเตอร์
1. ไปที่ [แดชบอร์ด OpenRouter](https://openrouter.ai/settings/keys) คลิก **สร้าง API คีย์** และคัดลอกคีย์
2. เรียกใช้คำสั่ง `/connect` และค้นหา OpenRouter
```txt
/connect
```
3. ป้อนคีย์ API สำหรับผู้ให้บริการ
```txt
┌ API key
│
│
└ enter
```
4. OpenRouter หลายรุ่นถูกโหลดไว้ล่วงหน้าตามค่าเริ่มต้น ให้รันคำสั่ง `/models` เพื่อเลือกรุ่นที่คุณต้องการ
```txt
/models
```
คุณยังสามารถเพิ่มโมเดลเพิ่มเติมผ่านการกำหนดค่า opencode ของคุณ
```json title="opencode.json" {6}
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"openrouter": {
"models": {
"somecoolnewmodel": {}
}
}
}
}
```
5. คุณยังสามารถปรับแต่งได้ผ่านการกำหนดค่า opencode ของคุณ นี่คือตัวอย่างการระบุผู้ให้บริการ
```json title="opencode.json"
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"openrouter": {
"models": {
"moonshotai/kimi-k2": {
"options": {
"provider": {
"order": ["baseten"],
"allow_fallbacks": false
}
}
}
}
}
}
}
```
---
### SAP เอไอคอร์
SAP AI Core ให้การเข้าถึงโมเดลมากกว่า 40 โมเดลจาก OpenAI, Anthropic, Google, Amazon, Meta, Mistral และ AI21 ผ่านแพลตฟอร์มแบบครบวงจร
1. ไปที่ห้องนักบิน [SAP BTP](https://account.hana.ondemand.com/) นำทางไปยังอินสแตนซ์บริการ SAP AI Core ของคุณ และสร้างรหัสบริการ
:::tip
รหัสบริการคือวัตถุ JSON ที่ประกอบด้วย `clientid`, `clientsecret`, `url` และ `serviceurls.AI_API_URL` คุณสามารถค้นหาอินสแตนซ์ AI Core ของคุณได้ภายใต้ **บริการ** > **อินสแตนซ์และการสมัครสมาชิก** ในห้องควบคุม BTP
:::
2. รันคำสั่ง `/connect` และค้นหา **SAP AI Core**
```txt
/connect
```
3. ป้อนรหัสบริการของคุณ JSON
```txt
┌ Service key
│
│
└ enter
```
หรือตั้งค่าตัวแปรสภาพแวดล้อม `AICORE_SERVICE_KEY`:
```bash
AICORE_SERVICE_KEY='{"clientid":"...","clientsecret":"...","url":"...","serviceurls":{"AI_API_URL":"..."}}' opencode
```
หรือเพิ่มลงในโปรไฟล์ทุบตีของคุณ:
```bash title="~/.bash_profile"
export AICORE_SERVICE_KEY='{"clientid":"...","clientsecret":"...","url":"...","serviceurls":{"AI_API_URL":"..."}}'
```
4. ตั้งค่า ID การนำไปใช้งานและกลุ่มทรัพยากรเพิ่มเติม:
```bash
AICORE_DEPLOYMENT_ID=your-deployment-id AICORE_RESOURCE_GROUP=your-resource-group opencode
```
:::note
การตั้งค่าเหล่านี้เป็นทางเลือกและควรกำหนดค่าตามการตั้งค่า SAP AI Core ของคุณ
:::
5. รันคำสั่ง `/models` เพื่อเลือกจากรุ่นที่มีให้เลือกมากกว่า 40 รุ่น
```txt
/models
```
---
### ตำแหน่งข้อมูล AI ของ OVHcloud
1. ไปที่ [แผง OVHcloud](https://ovh.com/manager) ไปที่ส่วน `Public Cloud` `AI & Machine Learning` > `AI Endpoints` และในแท็บ `API Keys` คลิก **สร้างคีย์ API ใหม่**
2. รันคำสั่ง `/connect` และค้นหา **OVHcloud AI Endpoints**
```txt
/connect
```
3. ป้อนคีย์ OVHcloud AI Endpoints API ของคุณ
```txt
┌ API key
│
│
└ enter
```
4. รันคำสั่ง `/models` เพื่อเลือกโมเดลเช่น _gpt-oss-120b_
```txt
/models
```
---
### สเกลเวย์
วิธีใช้ [Scaleway Generative API](https://www.scaleway.com/en/docs/generative-apis/) กับ Opencode:
1. ไปที่ [การตั้งค่า Scaleway Console IAM](https://console.scaleway.com/iam/api-keys) เพื่อสร้างคีย์ API ใหม่
2. รันคำสั่ง `/connect` และค้นหา **Scaleway**
```txt
/connect
```
3. ป้อนคีย์ Scaleway API ของคุณ
```txt
┌ API key
│
│
└ enter
```
4. รันคำสั่ง `/models` เพื่อเลือกโมเดล เช่น _devstral-2-123b-instruct-2512_ หรือ _gpt-oss-120b_
```txt
/models
```
---
### ร่วมกันเอไอ
1. ไปที่ [Together AI console](https://api.together.ai) สร้างบัญชี แล้วคลิก **เพิ่มรหัส**
2. เรียกใช้คำสั่ง `/connect` และค้นหา **Together AI**
```txt
/connect
```
3. ป้อนคีย์ Together AI API ของคุณ
```txt
┌ API key
│
│
└ enter
```
4. รันคำสั่ง `/models` เพื่อเลือกโมเดลเช่น _Kimi K2 Instruct_
```txt
/models
```
---
### เวนิส เอไอ
1. ไปที่ [คอนโซล AI ของเวนิส](https://venice.ai) สร้างบัญชี และสร้างคีย์ API
2. รันคำสั่ง `/connect` และค้นหา **Venice AI**
```txt
/connect
```
3. ป้อนคีย์ Venice AI API ของคุณ
```txt
┌ API key
│
│
└ enter
```
4. รันคำสั่ง `/models` เพื่อเลือกโมเดลเช่น _Llama 3.3 70B_
```txt
/models
```
---
### เกตเวย์ AI ของ Vercel
Vercel AI Gateway ช่วยให้คุณเข้าถึงโมเดลจาก OpenAI, Anthropic, Google, xAI และอื่นๆ อีกมากมายผ่านจุดสิ้นสุดแบบรวม โมเดลมีจำหน่ายในราคาปลีกโดยไม่มีส่วนเพิ่ม
1. ไปที่ [แดชบอร์ด Vercel](https://vercel.com/) ไปที่แท็บ **เกตเวย์ AI** และคลิก **API คีย์** เพื่อสร้างคีย์ API ใหม่
2. รันคำสั่ง `/connect` และค้นหา **Vercel AI Gateway**
```txt
/connect
```
3. ป้อนคีย์ Vercel AI Gateway API ของคุณ
```txt
┌ API key
│
│
└ enter
```
4. รันคำสั่ง `/models` เพื่อเลือกรุ่น
```txt
/models
```
คุณยังสามารถปรับแต่งโมเดลผ่านการกำหนดค่า opencode ของคุณได้อีกด้วย นี่คือตัวอย่างการระบุลำดับการกำหนดเส้นทางของผู้ให้บริการ
```json title="opencode.json"
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"vercel": {
"models": {
"anthropic/claude-sonnet-4": {
"options": {
"order": ["anthropic", "vertex"]
}
}
}
}
}
}
```
ตัวเลือกการกำหนดเส้นทางที่มีประโยชน์:
| ตัวเลือก | คำอธิบาย |
| ------------------- | ------------------------------------------------------- |
| `order` | ลำดับผู้ให้บริการที่จะลอง |
| `only` | จำกัดเฉพาะผู้ให้บริการบางราย |
| `zeroDataRetention` | ใช้ผู้ให้บริการที่ไม่มีนโยบายการเก็บรักษาข้อมูลเท่านั้น |
---
### xAI
1. ไปที่ [xAI console](https://console.x.ai/) สร้างบัญชี และสร้างคีย์ API
2. รันคำสั่ง `/connect` และค้นหา **xAI**
```txt
/connect
```
3. ป้อนคีย์ xAI API ของคุณ
```txt
┌ API key
│
│
└ enter
```
4. รันคำสั่ง `/models` เพื่อเลือกโมเดลเช่น _Grok Beta_
```txt
/models
```
---
### ซี.เอ.ไอ
1. ไปที่ [Z.AI API console](https://z.ai/manage-apikey/apikey-list) สร้างบัญชี และคลิก **สร้างคีย์ API ใหม่**
2. รันคำสั่ง `/connect` และค้นหา **Z.AI**
```txt
/connect
```
หากคุณสมัครสมาชิก **GLM Coding Plan** ให้เลือก **Z.AI Coding Plan**
3. ป้อนคีย์ Z.AI API ของคุณ
```txt
┌ API key
│
│
└ enter
```
4. รันคำสั่ง `/models` เพื่อเลือกโมเดลเช่น _GLM-4.7_
```txt
/models
```
---
### ZenMux
1. ไปที่ [แดชบอร์ด ZenMux](https://zenmux.ai/settings/keys) คลิก **สร้าง API คีย์** และคัดลอกคีย์
2. รันคำสั่ง `/connect` และค้นหา ZenMux
```txt
/connect
```
3. ป้อนคีย์ API สำหรับผู้ให้บริการ
```txt
┌ API key
│
│
└ enter
```
4. ZenMux หลายรุ่นถูกโหลดไว้ล่วงหน้าตามค่าเริ่มต้น รันคำสั่ง `/models` เพื่อเลือกรุ่นที่คุณต้องการ
```txt
/models
```
คุณยังสามารถเพิ่มโมเดลเพิ่มเติมผ่านการกำหนดค่า opencode ของคุณ
```json title="opencode.json" {6}
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"zenmux": {
"models": {
"somecoolnewmodel": {}
}
}
}
}
```
---
## ผู้ให้บริการที่กำหนดเอง
หากต้องการเพิ่มผู้ให้บริการ **รองรับ OpenAI** ที่ไม่อยู่ในคำสั่ง `/connect`:
:::tip
คุณสามารถใช้ผู้ให้บริการที่เข้ากันได้กับ OpenAI ด้วย opencode ผู้ให้บริการ AI สมัยใหม่ส่วนใหญ่เสนอ API ที่เข้ากันได้กับ OpenAI
:::
1. เรียกใช้คำสั่ง `/connect` และเลื่อนลงไปที่ **อื่นๆ**
```bash
$ /connect
┌ Add credential
│
◆ Select provider
│ ...
│ ● Other
└
```
2. ป้อนรหัสเฉพาะสำหรับผู้ให้บริการ
```bash
$ /connect
┌ Add credential
│
◇ Enter provider id
│ myprovider
└
```
:::note
เลือก ID ที่น่าจดจำ คุณจะใช้รหัสนี้ในไฟล์กำหนดค่าของคุณ
:::
3. ป้อนรหัส API ของคุณสำหรับผู้ให้บริการ
```bash
$ /connect
┌ Add credential
│
▲ This only stores a credential for myprovider - you will need to configure it in opencode.json, check the docs for examples.
│
◇ Enter your API key
│ sk-...
└
```
4. สร้างหรืออัปเดตไฟล์ `opencode.json` ในไดเรกทอรีโครงการของคุณ:
```json title="opencode.json" ""myprovider"" {5-15}
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"myprovider": {
"npm": "@ai-sdk/openai-compatible",
"name": "My AI ProviderDisplay Name",
"options": {
"baseURL": "https://api.myprovider.com/v1"
},
"models": {
"my-model-name": {
"name": "My Model Display Name"
}
}
}
}
}
```
นี่คือตัวเลือกการกำหนดค่า:
- **npm**: แพ็คเกจ AI SDK ที่จะใช้ `@ai-sdk/openai-compatible` สำหรับผู้ให้บริการที่เข้ากันได้กับ OpenAI
- **ชื่อ**: ชื่อที่แสดงใน UI
- **รุ่น**: รุ่นที่มีจำหน่าย
- **options.baseURL**: API ปลายทาง URL
- **options.apiKey**: ตั้งค่าคีย์ API หรือไม่ก็ได้ หากไม่ได้ใช้การตรวจสอบสิทธิ์
- **options.headers**: ตั้งค่าส่วนหัวที่กำหนดเองหรือไม่ก็ได้
ข้อมูลเพิ่มเติมเกี่ยวกับตัวเลือกขั้นสูงในตัวอย่างด้านล่าง
5. รันคำสั่ง `/models` จากนั้นผู้ให้บริการและโมเดลที่คุณกำหนดเองจะปรากฏในรายการตัวเลือก
---
##### ตัวอย่าง
นี่คือตัวอย่างการตั้งค่าตัวเลือก `apiKey`, `headers` และโมเดล `limit`
```json title="opencode.json" {9,11,17-20}
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"myprovider": {
"npm": "@ai-sdk/openai-compatible",
"name": "My AI ProviderDisplay Name",
"options": {
"baseURL": "https://api.myprovider.com/v1",
"apiKey": "{env:ANTHROPIC_API_KEY}",
"headers": {
"Authorization": "Bearer custom-token"
}
},
"models": {
"my-model-name": {
"name": "My Model Display Name",
"limit": {
"context": 200000,
"output": 65536
}
}
}
}
}
}
```
รายละเอียดการกำหนดค่า:
- **apiKey**: ตั้งค่าโดยใช้ไวยากรณ์ของตัวแปร `env` [เรียนรู้เพิ่มเติม](/docs/config#env-vars)
- **ส่วนหัว**: ส่วนหัวที่กำหนดเองส่งไปพร้อมกับคำขอแต่ละรายการ
- **limit.context**: Input Tokens สูงสุดที่โมเดลยอมรับ
- **limit.output**: Output Tokens สูงสุดที่โมเดลสามารถสร้างได้
ช่อง `limit` ช่วยให้ OpenCode เข้าใจบริบทที่คุณเหลืออยู่ ผู้ให้บริการมาตรฐานจะดึงข้อมูลเหล่านี้จาก models.dev โดยอัตโนมัติ
---
## การแก้ไขปัญหา
หากคุณประสบปัญหาในการกำหนดค่าผู้ให้บริการ ให้ตรวจสอบสิ่งต่อไปนี้:
1. **ตรวจสอบการตั้งค่าการรับรองความถูกต้อง**: เรียกใช้ `opencode auth list` เพื่อดูว่ามีข้อมูลรับรองหรือไม่
สำหรับผู้ให้บริการจะถูกเพิ่มในการกำหนดค่าของคุณ
สิ่งนี้ใช้ไม่ได้กับผู้ให้บริการอย่าง Amazon Bedrock ที่ต้องอาศัยตัวแปรสภาพแวดล้อมสำหรับการตรวจสอบสิทธิ์
2. สำหรับผู้ให้บริการแบบกำหนดเอง ให้ตรวจสอบการกำหนดค่า opencode และ:
- ตรวจสอบให้แน่ใจว่า ID ผู้ให้บริการที่ใช้ในคำสั่ง `/connect` ตรงกับ ID ในการกำหนดค่า opencode ของคุณ
- มีการใช้แพ็คเกจ npm ที่ถูกต้องสำหรับผู้ให้บริการ ตัวอย่างเช่น ใช้ `@ai-sdk/cerebras` สำหรับ Cerebras และสำหรับผู้ให้บริการรายอื่นที่เข้ากันได้กับ OpenAI ให้ใช้ `@ai-sdk/openai-compatible`
- ตรวจสอบว่ามีการใช้จุดสิ้นสุด API ที่ถูกต้องในช่อง `options.baseURL`

View file

@ -57,13 +57,13 @@ Veya manuel olarak ayarlayabilirsiniz.
permissions:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Run OpenCode
- name: Run OpenCode
uses: anomalyco/opencode/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

View file

@ -57,13 +57,13 @@ opencode github install
permissions:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Run OpenCode
- name: Run OpenCode
uses: anomalyco/opencode/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

View file

@ -57,13 +57,13 @@ opencode github install
permissions:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Run OpenCode
- name: Run OpenCode
uses: anomalyco/opencode/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}