@aigne/doc-smith 0.8.11-beta.5 → 0.8.11-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.aigne/doc-smith/config.yaml +3 -1
- package/.aigne/doc-smith/output/structure-plan.json +2 -2
- package/.aigne/doc-smith/preferences.yml +28 -20
- package/.aigne/doc-smith/upload-cache.yaml +702 -0
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +22 -2
- package/README.md +2 -2
- package/agents/clear/choose-contents.mjs +2 -2
- package/agents/clear/clear-document-structure.mjs +8 -8
- package/agents/clear/index.yaml +1 -1
- package/agents/evaluate/document-structure.yaml +1 -1
- package/agents/generate/check-document-structure.yaml +3 -3
- package/agents/generate/check-need-generate-structure.mjs +8 -8
- package/agents/generate/document-structure-tools/add-document.mjs +38 -13
- package/agents/generate/document-structure-tools/delete-document.mjs +37 -14
- package/agents/generate/document-structure-tools/move-document.mjs +46 -19
- package/agents/generate/document-structure-tools/update-document.mjs +39 -12
- package/agents/generate/generate-structure.yaml +1 -1
- package/agents/generate/update-document-structure.yaml +3 -9
- package/agents/generate/user-review-document-structure.mjs +15 -14
- package/agents/translate/translate-document.yaml +1 -9
- package/agents/update/batch-generate-document.yaml +1 -1
- package/agents/update/check-document.mjs +2 -2
- package/agents/update/check-update-is-single.mjs +2 -1
- package/agents/update/document-tools/update-document-content.mjs +24 -14
- package/agents/update/fs-tools/glob.mjs +184 -0
- package/agents/update/fs-tools/grep.mjs +317 -0
- package/agents/update/fs-tools/read-file.mjs +307 -0
- package/agents/update/generate-document.yaml +4 -7
- package/agents/update/update-document-detail.yaml +6 -10
- package/agents/update/user-review-document.mjs +13 -13
- package/agents/utils/check-feedback-refiner.mjs +1 -1
- package/agents/utils/choose-docs.mjs +1 -1
- package/agents/utils/load-document-all-content.mjs +3 -3
- package/agents/utils/load-sources.mjs +1 -1
- package/agents/utils/save-docs.mjs +7 -28
- package/aigne.yaml +2 -2
- package/assets/screenshots/doc-complete-setup.png +0 -0
- package/assets/screenshots/doc-generate-docs.png +0 -0
- package/assets/screenshots/doc-generate.png +0 -0
- package/assets/screenshots/doc-generated-successfully.png +0 -0
- package/assets/screenshots/doc-publish.png +0 -0
- package/assets/screenshots/doc-regenerate.png +0 -0
- package/assets/screenshots/doc-translate-langs.png +0 -0
- package/assets/screenshots/doc-translate.png +0 -0
- package/assets/screenshots/doc-update.png +0 -0
- package/docs/_sidebar.md +1 -1
- package/docs/advanced-how-it-works.ja.md +31 -31
- package/docs/advanced-how-it-works.md +10 -10
- package/docs/advanced-how-it-works.zh-TW.md +24 -24
- package/docs/advanced-how-it-works.zh.md +20 -20
- package/docs/advanced-quality-assurance.ja.md +57 -61
- package/docs/advanced-quality-assurance.md +57 -61
- package/docs/advanced-quality-assurance.zh-TW.md +57 -61
- package/docs/advanced-quality-assurance.zh.md +57 -61
- package/docs/advanced.ja.md +8 -4
- package/docs/advanced.md +7 -3
- package/docs/advanced.zh-TW.md +9 -5
- package/docs/advanced.zh.md +9 -5
- package/docs/changelog.ja.md +206 -29
- package/docs/changelog.md +177 -0
- package/docs/changelog.zh-TW.md +229 -52
- package/docs/changelog.zh.md +204 -27
- package/docs/cli-reference.ja.md +181 -80
- package/docs/cli-reference.md +168 -67
- package/docs/cli-reference.zh-TW.md +177 -76
- package/docs/cli-reference.zh.md +172 -71
- package/docs/configuration-interactive-setup.ja.md +45 -42
- package/docs/configuration-interactive-setup.md +9 -6
- package/docs/configuration-interactive-setup.zh-TW.md +26 -23
- package/docs/configuration-interactive-setup.zh.md +25 -22
- package/docs/configuration-language-support.ja.md +33 -63
- package/docs/configuration-language-support.md +32 -62
- package/docs/configuration-language-support.zh-TW.md +35 -65
- package/docs/configuration-language-support.zh.md +32 -62
- package/docs/configuration-llm-setup.ja.md +25 -23
- package/docs/configuration-llm-setup.md +20 -18
- package/docs/configuration-llm-setup.zh-TW.md +21 -19
- package/docs/configuration-llm-setup.zh.md +20 -18
- package/docs/configuration-preferences.ja.md +67 -52
- package/docs/configuration-preferences.md +55 -40
- package/docs/configuration-preferences.zh-TW.md +69 -54
- package/docs/configuration-preferences.zh.md +68 -53
- package/docs/configuration.ja.md +98 -58
- package/docs/configuration.md +42 -2
- package/docs/configuration.zh-TW.md +86 -46
- package/docs/configuration.zh.md +76 -36
- package/docs/features-generate-documentation.ja.md +49 -55
- package/docs/features-generate-documentation.md +49 -55
- package/docs/features-generate-documentation.zh-TW.md +54 -60
- package/docs/features-generate-documentation.zh.md +48 -54
- package/docs/features-publish-your-docs.ja.md +68 -45
- package/docs/features-publish-your-docs.md +65 -42
- package/docs/features-publish-your-docs.zh-TW.md +74 -51
- package/docs/features-publish-your-docs.zh.md +67 -44
- package/docs/features-translate-documentation.ja.md +46 -35
- package/docs/features-translate-documentation.md +39 -28
- package/docs/features-translate-documentation.zh-TW.md +45 -34
- package/docs/features-translate-documentation.zh.md +39 -28
- package/docs/features-update-and-refine.ja.md +75 -71
- package/docs/features-update-and-refine.md +67 -63
- package/docs/features-update-and-refine.zh-TW.md +72 -67
- package/docs/features-update-and-refine.zh.md +71 -67
- package/docs/features.ja.md +29 -19
- package/docs/features.md +25 -15
- package/docs/features.zh-TW.md +28 -18
- package/docs/features.zh.md +31 -21
- package/docs/getting-started.ja.md +43 -46
- package/docs/getting-started.md +36 -39
- package/docs/getting-started.zh-TW.md +41 -44
- package/docs/getting-started.zh.md +39 -42
- package/docs/overview.ja.md +63 -11
- package/docs/overview.md +62 -10
- package/docs/overview.zh-TW.md +67 -15
- package/docs/overview.zh.md +62 -10
- package/docs-mcp/analyze-docs-relevance.yaml +6 -6
- package/docs-mcp/docs-search.yaml +1 -1
- package/media.md +9 -9
- package/package.json +2 -2
- package/prompts/common/document-structure/conflict-resolution-guidance.md +3 -3
- package/prompts/common/document-structure/document-structure-rules.md +2 -2
- package/prompts/detail/custom/custom-components.md +304 -188
- package/prompts/detail/document-rules.md +5 -5
- package/prompts/detail/generate-document.md +21 -8
- package/prompts/detail/update-document.md +8 -12
- package/prompts/evaluate/document-structure.md +6 -6
- package/prompts/structure/check-document-structure.md +10 -10
- package/prompts/structure/document-rules.md +2 -2
- package/prompts/structure/generate-structure-system.md +3 -3
- package/prompts/structure/structure-example.md +1 -1
- package/prompts/structure/structure-getting-started.md +1 -1
- package/prompts/structure/update-document-structure.md +18 -14
- package/prompts/utils/feedback-refiner.md +3 -3
- package/tests/agents/clear/choose-contents.test.mjs +1 -1
- package/tests/agents/clear/clear-document-structure.test.mjs +36 -30
- package/tests/agents/evaluate/generate-report.test.mjs +1 -1
- package/tests/agents/generate/check-need-generate-structure.test.mjs +1 -1
- package/tests/agents/generate/document-structure-tools/add-document.test.mjs +2 -2
- package/tests/agents/generate/document-structure-tools/delete-document.test.mjs +4 -4
- package/tests/agents/generate/document-structure-tools/move-document.test.mjs +12 -12
- package/tests/agents/generate/document-structure-tools/update-document.test.mjs +3 -3
- package/tests/agents/generate/user-review-document-structure.test.mjs +36 -13
- package/tests/agents/update/check-document.test.mjs +1 -1
- package/tests/agents/update/document-tools/update-document-content.test.mjs +115 -112
- package/tests/agents/update/fs-tools/glob.test.mjs +438 -0
- package/tests/agents/update/fs-tools/grep.test.mjs +279 -0
- package/tests/agents/update/fs-tools/read-file.test.mjs +553 -0
- package/tests/agents/update/user-review-document.test.mjs +48 -27
- package/tests/agents/utils/format-document-structure.test.mjs +5 -5
- package/tests/agents/utils/load-sources.test.mjs +4 -4
- package/tests/agents/utils/save-docs.test.mjs +1 -1
- package/tests/utils/conflict-detector.test.mjs +1 -1
- package/tests/utils/docs-finder-utils.test.mjs +8 -8
- package/types/document-schema.mjs +5 -6
- package/types/document-structure-schema.mjs +25 -13
- package/utils/conflict-detector.mjs +1 -1
- package/utils/constants/index.mjs +4 -4
- package/utils/docs-finder-utils.mjs +11 -11
- package/utils/markdown-checker.mjs +1 -1
|
@@ -1,94 +1,64 @@
|
|
|
1
1
|
# 语言支持
|
|
2
2
|
|
|
3
|
-
AIGNE DocSmith
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
direction: down
|
|
9
|
-
|
|
10
|
-
Source-Doc: {
|
|
11
|
-
label: "源文档\n(例如,英语)"
|
|
12
|
-
shape: rectangle
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
AI-Engine: {
|
|
16
|
-
label: "AIGNE DocSmith\nAI 翻译引擎"
|
|
17
|
-
shape: rectangle
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
Translated-Docs: {
|
|
21
|
-
label: "翻译后的文档"
|
|
22
|
-
shape: rectangle
|
|
23
|
-
grid-columns: 3
|
|
24
|
-
|
|
25
|
-
zh: "简体中文"
|
|
26
|
-
ja: "日本語"
|
|
27
|
-
es: "Español"
|
|
28
|
-
fr: "Français"
|
|
29
|
-
de: "Deutsch"
|
|
30
|
-
more: "..."
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
Source-Doc -> AI-Engine: "`aigne doc translate`"
|
|
34
|
-
AI-Engine -> Translated-Docs: "生成"
|
|
35
|
-
```
|
|
3
|
+
AIGNE DocSmith 提供 12 种语言的自动化文档翻译,使您能够为全球受众生成和维护本地化内容。该功能主要通过 `aigne doc translate` 命令进行管理。
|
|
4
|
+
|
|
5
|
+
翻译工作流使用 AI 引擎处理您的源文档,并生成您所选目标语言的版本。`aigne doc translate` 命令提供了一个交互式界面,引导您选择要翻译的文档和语言。
|
|
6
|
+
|
|
7
|
+

|
|
36
8
|
|
|
37
9
|
## 支持的语言
|
|
38
10
|
|
|
39
|
-
DocSmith
|
|
40
|
-
|
|
41
|
-
| 语言 | 语言代码 |
|
|
42
|
-
|
|
43
|
-
|
|
|
44
|
-
| 简体中文 | `zh` |
|
|
45
|
-
| 繁體中文 | `zh-TW` |
|
|
46
|
-
| 日本語 | `ja` |
|
|
47
|
-
| 한국어 | `ko` |
|
|
48
|
-
| Español | `es` |
|
|
49
|
-
| Français | `fr` |
|
|
50
|
-
| Deutsch | `de` |
|
|
51
|
-
| Português | `pt` |
|
|
52
|
-
| Русский | `ru` |
|
|
53
|
-
| Italiano | `it` |
|
|
54
|
-
| العربية | `ar` |
|
|
11
|
+
DocSmith 支持以下语言的 AI 翻译。您可以在使用 `aigne doc init` 进行初始设置时定义项目的主要语言,并可以选择以下任意数量的语言进行翻译。
|
|
12
|
+
|
|
13
|
+
| 语言 | 语言代码 |
|
|
14
|
+
|---|---|
|
|
15
|
+
| English | `en` |
|
|
16
|
+
| 简体中文 | `zh` |
|
|
17
|
+
| 繁體中文 | `zh-TW` |
|
|
18
|
+
| 日本語 | `ja` |
|
|
19
|
+
| 한국어 | `ko` |
|
|
20
|
+
| Español | `es` |
|
|
21
|
+
| Français | `fr` |
|
|
22
|
+
| Deutsch | `de` |
|
|
23
|
+
| Português | `pt` |
|
|
24
|
+
| Русский | `ru` |
|
|
25
|
+
| Italiano | `it` |
|
|
26
|
+
| العربية | `ar` |
|
|
55
27
|
|
|
56
28
|
## 如何配置和使用翻译
|
|
57
29
|
|
|
58
|
-
|
|
30
|
+
语言设置在您初始化项目时进行配置。您可以随时使用 `aigne doc translate` 命令添加新语言或翻译现有文档,该命令支持两种操作模式。
|
|
59
31
|
|
|
60
32
|
### 用于引导式翻译的交互模式
|
|
61
33
|
|
|
62
|
-
|
|
34
|
+
如需分步引导流程,请运行不带任何参数的命令。建议大多数用户使用此方法。
|
|
63
35
|
|
|
64
36
|
```bash 交互式翻译 icon=lucide:wand
|
|
65
37
|
aigne doc translate
|
|
66
38
|
```
|
|
67
39
|
|
|
68
|
-
|
|
40
|
+
交互模式会显示一系列提示,允许您选择要翻译的文档并从列表中选择目标语言。如果项目中尚未包含某些翻译语言,此模式也允许您将其添加到项目配置中。
|
|
69
41
|
|
|
70
|
-
|
|
71
|
-
2. 从支持的语言列表中选择一个或多个目标语言。
|
|
72
|
-
3. 如果项目中尚未包含新的翻译语言,则将其添加到项目配置中。
|
|
42
|
+

|
|
73
43
|
|
|
74
44
|
### 用于自动化的命令行参数
|
|
75
45
|
|
|
76
|
-
|
|
46
|
+
为了直接控制或在自动化脚本中使用,您可以将文档和语言指定为命令行参数。此方法适用于集成到 CI/CD 管道中。
|
|
77
47
|
|
|
78
48
|
```bash 命令示例 icon=lucide:terminal
|
|
79
49
|
# 将 overview.md 和 examples.md 翻译成中文和日文
|
|
80
50
|
aigne doc translate --langs zh --langs ja --docs overview.md --docs examples.md
|
|
81
51
|
```
|
|
82
52
|
|
|
83
|
-
|
|
53
|
+
下表详细介绍了 `translate` 命令的关键参数:
|
|
84
54
|
|
|
85
55
|
| 参数 | 描述 |
|
|
86
56
|
|---|---|
|
|
87
|
-
| `--langs` |
|
|
88
|
-
| `--docs` |
|
|
89
|
-
| `--feedback` |
|
|
90
|
-
| `--glossary` |
|
|
57
|
+
| `--langs` | 指定目标语言代码。该标志可以多次使用以选择多种语言。 |
|
|
58
|
+
| `--docs` | 指定要翻译的文档路径(例如 `overview.md`)。该标志也可以多次使用。 |
|
|
59
|
+
| `--feedback` | 提供具体指令以指导翻译模型(例如 `"使用正式语气"`)。 |
|
|
60
|
+
| `--glossary` | 使用自定义术语表文件(例如 `@path/to/glossary.md`)来确保项目特定术语的翻译一致性。 |
|
|
91
61
|
|
|
92
62
|
---
|
|
93
63
|
|
|
94
|
-
|
|
64
|
+
本节概述了可用的语言以及如何启用它们。有关翻译工作流的完整指南,请参阅 [翻译文档](./features-translate-documentation.md) 指南。
|
|
@@ -1,44 +1,46 @@
|
|
|
1
|
-
# LLMセットアップ
|
|
1
|
+
# LLM セットアップ
|
|
2
2
|
|
|
3
|
-
AIGNE DocSmith
|
|
3
|
+
AIGNE DocSmith は、大規模言語モデル (LLM) を使用してドキュメンテーションコンテンツを生成します。AI モデルプロバイダーの設定は、主に 2 つの方法で行うことができます。統合された AIGNE Hub を利用する方法、またはお好みのプロバイダーから独自のカスタム API キーを接続する方法です。
|
|
4
4
|
|
|
5
|
-
## AIGNE Hub
|
|
5
|
+
## AIGNE Hub (推奨)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
LLM を設定する最も直接的な方法は、AIGNE Hub を使用することです。これは複数の LLM プロバイダーへのゲートウェイとして機能し、主に 2 つの利点があります。
|
|
8
8
|
|
|
9
|
-
- **API
|
|
10
|
-
-
|
|
9
|
+
- **API キー不要:** 独自の API キーやサービスサブスクリプションを管理する必要なく、ドキュメントを生成できます。
|
|
10
|
+
- **柔軟なモデル切り替え:** `--model` フラグを使用することで、任意のコマンドの AI モデルを変更できます。
|
|
11
11
|
|
|
12
|
-
AIGNE Hub
|
|
12
|
+
AIGNE Hub を介して特定のモデルを使用するには、コマンドに `--model` フラグを追加します。以下の例でその使用方法を示します。
|
|
13
13
|
|
|
14
|
-
```bash
|
|
15
|
-
#
|
|
16
|
-
aigne doc generate --model
|
|
14
|
+
```bash AIGNE Hub経由で異なるモデルを使用する icon=mdi:code-braces
|
|
15
|
+
# OpenAI の GPT-4o モデルを使用
|
|
16
|
+
aigne doc generate --model openai:gpt-4o
|
|
17
17
|
|
|
18
|
-
# AnthropicのClaude
|
|
19
|
-
aigne doc generate --model
|
|
18
|
+
# Anthropic の Claude 4.5 Sonnet モデルを使用
|
|
19
|
+
aigne doc generate --model anthropic:claude-sonnet-4-5
|
|
20
20
|
|
|
21
|
-
#
|
|
22
|
-
aigne doc generate --model
|
|
21
|
+
# Google の Gemini 2.5 Pro モデルを使用
|
|
22
|
+
aigne doc generate --model google:gemini-2.5-pro
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
`--model` フラグが指定されていない場合、DocSmith はプロジェクトの設定ファイルで定義されたモデルをデフォルトで使用します。
|
|
26
26
|
|
|
27
|
-
## カスタムAPIキーの使用
|
|
27
|
+
## カスタム API キーの使用
|
|
28
28
|
|
|
29
|
-
OpenAI
|
|
29
|
+
OpenAI、Anthropic、Google などのプロバイダーで独自のアカウントを使用したいユーザーのために、DocSmith は個人の API キーで設定できます。この方法により、API の使用状況と請求を直接管理できます。
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
設定は対話型ウィザードを通じて行われます。起動するには、次のコマンドを実行します。
|
|
32
32
|
|
|
33
|
-
```bash
|
|
33
|
+
```bash 対話型ウィザードの起動 icon=lucide:magic-wand
|
|
34
34
|
aigne doc init
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
ウィザードがプロバイダーの選択と必要な認証情報の入力を求めます。このプロセスの完全なステップバイステップガイドについては、[インタラクティブ設定](./configuration-interactive-setup.md) のドキュメントを参照してください。
|
|
38
38
|
|
|
39
39
|
## デフォルトモデルの設定
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
すべてのドキュメント生成タスクで一貫性を保つため、プロジェクトの `aigne.yaml` 設定ファイルでデフォルトの LLM を設定できます。このモデルは、`--model` フラグを明示的に含まないすべてのコマンドで使用されます。
|
|
42
|
+
|
|
43
|
+
以下は設定例です。
|
|
42
44
|
|
|
43
45
|
```yaml aigne.yaml icon=mdi:file-code
|
|
44
46
|
chat_model:
|
|
@@ -47,8 +49,8 @@ chat_model:
|
|
|
47
49
|
temperature: 0.8
|
|
48
50
|
```
|
|
49
51
|
|
|
50
|
-
この例では、DocSmithはGoogle
|
|
52
|
+
この例では、DocSmith は Google の `gemini-2.5-pro` モデルを `temperature` 設定 `0.8` で、すべての生成タスクのデフォルトとして使用するように設定されています。
|
|
51
53
|
|
|
52
54
|
---
|
|
53
55
|
|
|
54
|
-
LLM
|
|
56
|
+
LLM プロバイダーの設定が完了したら、次のステップはドキュメントの言語設定を管理することです。[言語サポート](./configuration-language-support.md) ガイドに進み、サポートされている言語の全リストを確認し、それらを有効にする方法を学んでください。
|
|
@@ -1,44 +1,46 @@
|
|
|
1
1
|
# LLM Setup
|
|
2
2
|
|
|
3
|
-
AIGNE DocSmith uses Large Language Models (LLMs) to generate documentation content.
|
|
3
|
+
AIGNE DocSmith uses Large Language Models (LLMs) to generate documentation content. Configuration of the AI model provider can be accomplished through two primary methods: utilizing the integrated AIGNE Hub or connecting your own custom API keys from a provider of your choice.
|
|
4
4
|
|
|
5
5
|
## AIGNE Hub (Recommended)
|
|
6
6
|
|
|
7
|
-
The most direct
|
|
7
|
+
The most direct method for configuring the LLM is through AIGNE Hub. It functions as a gateway to multiple LLM providers, offering two main benefits:
|
|
8
8
|
|
|
9
|
-
- **No API Key Required:** You can generate documents without
|
|
10
|
-
- **
|
|
9
|
+
- **No API Key Required:** You can generate documents without the need to manage your own API keys or service subscriptions.
|
|
10
|
+
- **Flexible Model Switching:** You can change the AI model for any command by using the `--model` flag.
|
|
11
11
|
|
|
12
|
-
To use a specific model through AIGNE Hub,
|
|
12
|
+
To use a specific model through AIGNE Hub, append the `--model` flag to your command. The following examples demonstrate its usage:
|
|
13
13
|
|
|
14
14
|
```bash Using Different Models via AIGNE Hub icon=mdi:code-braces
|
|
15
|
-
# Use Google's Gemini 2.5 Flash model
|
|
16
|
-
aigne doc generate --model google:gemini-2.5-flash
|
|
17
|
-
|
|
18
|
-
# Use Anthropic's Claude 3.5 Sonnet model
|
|
19
|
-
aigne doc generate --model claude:claude-3-5-sonnet
|
|
20
|
-
|
|
21
15
|
# Use OpenAI's GPT-4o model
|
|
22
16
|
aigne doc generate --model openai:gpt-4o
|
|
17
|
+
|
|
18
|
+
# Use Anthropic's Claude 4.5 Sonnet model
|
|
19
|
+
aigne doc generate --model anthropic:claude-sonnet-4-5
|
|
20
|
+
|
|
21
|
+
# Use Google's Gemini 2.5 Pro model
|
|
22
|
+
aigne doc generate --model google:gemini-2.5-pro
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
If
|
|
25
|
+
If the `--model` flag is not specified, DocSmith will default to the model defined in your project's configuration file.
|
|
26
26
|
|
|
27
27
|
## Using Custom API Keys
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
For users who prefer to use their own accounts with providers such as OpenAI, Anthropic, or Google, DocSmith can be configured with personal API keys. This method provides direct control over API usage and billing.
|
|
30
30
|
|
|
31
31
|
Configuration is handled through an interactive wizard. To launch it, run the following command:
|
|
32
32
|
|
|
33
|
-
```bash
|
|
33
|
+
```bash Launching the Interactive Wizard icon=lucide:magic-wand
|
|
34
34
|
aigne doc init
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
The wizard will prompt you to select your provider and enter
|
|
37
|
+
The wizard will prompt you to select your provider and enter the necessary credentials. For a complete, step-by-step guide on this process, refer to the [Interactive Setup](./configuration-interactive-setup.md) documentation.
|
|
38
38
|
|
|
39
39
|
## Setting a Default Model
|
|
40
40
|
|
|
41
|
-
To maintain consistency across all documentation generation tasks,
|
|
41
|
+
To maintain consistency across all documentation generation tasks, a default LLM can be set in your project's `aigne.yaml` configuration file. This model will be used for any command that does not explicitly include the `--model` flag.
|
|
42
|
+
|
|
43
|
+
The following is an example configuration:
|
|
42
44
|
|
|
43
45
|
```yaml aigne.yaml icon=mdi:file-code
|
|
44
46
|
chat_model:
|
|
@@ -47,8 +49,8 @@ chat_model:
|
|
|
47
49
|
temperature: 0.8
|
|
48
50
|
```
|
|
49
51
|
|
|
50
|
-
In this example, DocSmith is configured to use Google's `gemini-2.5-pro` model with a `temperature` setting of `0.8`
|
|
52
|
+
In this example, DocSmith is configured to use Google's `gemini-2.5-pro` model with a `temperature` setting of `0.8` as the default for all generation tasks.
|
|
51
53
|
|
|
52
54
|
---
|
|
53
55
|
|
|
54
|
-
With
|
|
56
|
+
With the LLM provider configured, the next step is to manage language settings for your documentation. Proceed to the [Language Support](./configuration-language-support.md) guide to see the full list of supported languages and learn how to enable them.
|
|
@@ -1,44 +1,46 @@
|
|
|
1
1
|
# LLM 設定
|
|
2
2
|
|
|
3
|
-
AIGNE DocSmith 使用大型語言模型 (LLM)
|
|
3
|
+
AIGNE DocSmith 使用大型語言模型 (LLM) 來產生文件內容。AI 模型提供者的設定可以透過兩種主要方式完成:使用整合的 AIGNE Hub 或連接您自己選擇的提供者的自訂 API 金鑰。
|
|
4
4
|
|
|
5
5
|
## AIGNE Hub (推薦)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
設定 LLM 最直接的方法是透過 AIGNE Hub。它作為多個 LLM 提供者的閘道,提供兩大好處:
|
|
8
8
|
|
|
9
|
-
- **無需 API 金鑰:**
|
|
10
|
-
-
|
|
9
|
+
- **無需 API 金鑰:** 您可以產生文件,而無需管理自己的 API 金鑰或服務訂閱。
|
|
10
|
+
- **靈活的模型切換:** 您可以使用 `--model` 旗標為任何指令變更 AI 模型。
|
|
11
11
|
|
|
12
|
-
若要透過 AIGNE Hub
|
|
13
|
-
|
|
14
|
-
```bash 使用不同模型透過 AIGNE Hub icon=mdi:code-braces
|
|
15
|
-
# 使用 Google 的 Gemini 2.5 Flash 模型
|
|
16
|
-
aigne doc generate --model google:gemini-2.5-flash
|
|
17
|
-
|
|
18
|
-
# 使用 Anthropic 的 Claude 3.5 Sonnet 模型
|
|
19
|
-
aigne doc generate --model claude:claude-3-5-sonnet
|
|
12
|
+
若要透過 AIGNE Hub 使用特定模型,請在您的指令後加上 `--model` 旗標。以下範例展示了其用法:
|
|
20
13
|
|
|
14
|
+
```bash 透過 AIGNE Hub 使用不同模型 icon=mdi:code-braces
|
|
21
15
|
# 使用 OpenAI 的 GPT-4o 模型
|
|
22
16
|
aigne doc generate --model openai:gpt-4o
|
|
17
|
+
|
|
18
|
+
# 使用 Anthropic 的 Claude 4.5 Sonnet 模型
|
|
19
|
+
aigne doc generate --model anthropic:claude-sonnet-4-5
|
|
20
|
+
|
|
21
|
+
# 使用 Google 的 Gemini 2.5 Pro 模型
|
|
22
|
+
aigne doc generate --model google:gemini-2.5-pro
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
如果未指定 `--model` 旗標,DocSmith 將預設使用您專案設定檔中定義的模型。
|
|
26
26
|
|
|
27
27
|
## 使用自訂 API 金鑰
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
對於偏好使用自己在 OpenAI、Anthropic 或 Google 等提供者帳戶的使用者,DocSmith 可以設定個人 API 金鑰。此方法可直接控制 API 的使用和計費。
|
|
30
30
|
|
|
31
31
|
設定是透過互動式精靈處理的。若要啟動它,請執行以下指令:
|
|
32
32
|
|
|
33
|
-
```bash
|
|
33
|
+
```bash 啟動互動式精靈 icon=lucide:magic-wand
|
|
34
34
|
aigne doc init
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
精靈會提示您選擇您的提供者並輸入必要的憑證。有關此過程的完整逐步指南,請參閱 [互動式設定](./configuration-interactive-setup.md) 文件。
|
|
38
38
|
|
|
39
39
|
## 設定預設模型
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
為維持所有文件產生任務的一致性,可以在您專案的 `aigne.yaml` 設定檔中設定預設的 LLM。此模型將用於任何未明確包含 `--model` 旗標的指令。
|
|
42
|
+
|
|
43
|
+
以下是範例設定:
|
|
42
44
|
|
|
43
45
|
```yaml aigne.yaml icon=mdi:file-code
|
|
44
46
|
chat_model:
|
|
@@ -47,8 +49,8 @@ chat_model:
|
|
|
47
49
|
temperature: 0.8
|
|
48
50
|
```
|
|
49
51
|
|
|
50
|
-
在此範例中,DocSmith
|
|
52
|
+
在此範例中,DocSmith 設定為使用 Google 的 `gemini-2.5-pro` 模型,並將 `temperature` 設定為 `0.8`,作為所有產生任務的預設值。
|
|
51
53
|
|
|
52
54
|
---
|
|
53
55
|
|
|
54
|
-
|
|
56
|
+
設定好 LLM 提供者後,下一步是管理您文件的語言設定。請前往 [語言支援](./configuration-language-support.md) 指南,查看支援的語言完整列表並了解如何啟用它們。
|
|
@@ -1,44 +1,46 @@
|
|
|
1
1
|
# LLM 设置
|
|
2
2
|
|
|
3
|
-
AIGNE DocSmith 使用大语言模型 (
|
|
3
|
+
AIGNE DocSmith 使用大语言模型 (LLM) 生成文档内容。配置 AI 模型提供商主要有两种方法:利用集成的 AIGNE Hub,或连接您选择的提供商的自定义 API 密钥。
|
|
4
4
|
|
|
5
5
|
## AIGNE Hub (推荐)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
配置 LLM 最直接的方法是通过 AIGNE Hub。它作为多个 LLM 提供商的网关,提供两大优势:
|
|
8
8
|
|
|
9
9
|
- **无需 API 密钥:** 您无需管理自己的 API 密钥或服务订阅即可生成文档。
|
|
10
|
-
-
|
|
10
|
+
- **灵活切换模型:** 您可以使用 `--model` 标志为任何命令更改 AI 模型。
|
|
11
11
|
|
|
12
|
-
要通过 AIGNE Hub
|
|
12
|
+
要通过 AIGNE Hub 使用特定模型,请在命令后附加 `--model` 标志。以下示例演示了其用法:
|
|
13
13
|
|
|
14
14
|
```bash 通过 AIGNE Hub 使用不同模型 icon=mdi:code-braces
|
|
15
|
-
# 使用 Google 的 Gemini 2.5 Flash 模型
|
|
16
|
-
aigne doc generate --model google:gemini-2.5-flash
|
|
17
|
-
|
|
18
|
-
# 使用 Anthropic 的 Claude 3.5 Sonnet 模型
|
|
19
|
-
aigne doc generate --model claude:claude-3-5-sonnet
|
|
20
|
-
|
|
21
15
|
# 使用 OpenAI 的 GPT-4o 模型
|
|
22
16
|
aigne doc generate --model openai:gpt-4o
|
|
17
|
+
|
|
18
|
+
# 使用 Anthropic 的 Claude 4.5 Sonnet 模型
|
|
19
|
+
aigne doc generate --model anthropic:claude-sonnet-4-5
|
|
20
|
+
|
|
21
|
+
# 使用 Google 的 Gemini 2.5 Pro 模型
|
|
22
|
+
aigne doc generate --model google:gemini-2.5-pro
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
如果未指定 `--model` 标志,DocSmith 将默认使用项目配置文件中定义的模型。
|
|
26
26
|
|
|
27
27
|
## 使用自定义 API 密钥
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
对于希望使用自己在 OpenAI、Anthropic 或 Google 等提供商处的账户的用户,可以使用个人 API 密钥配置 DocSmith。这种方法可以对 API 使用和计费进行直接控制。
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
配置通过交互式向导进行。要启动它,请运行以下命令:
|
|
32
32
|
|
|
33
|
-
```bash
|
|
33
|
+
```bash 启动交互式向导 icon=lucide:magic-wand
|
|
34
34
|
aigne doc init
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
向导将提示您选择提供商并输入必要的凭据。有关此过程的完整分步指南,请参阅[交互式设置](./configuration-interactive-setup.md)文档。
|
|
38
38
|
|
|
39
39
|
## 设置默认模型
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
为了在所有文档生成任务中保持一致性,可以在项目的 `aigne.yaml` 配置文件中设置默认的 LLM。任何未明确包含 `--model` 标志的命令都将使用此模型。
|
|
42
|
+
|
|
43
|
+
以下是配置示例:
|
|
42
44
|
|
|
43
45
|
```yaml aigne.yaml icon=mdi:file-code
|
|
44
46
|
chat_model:
|
|
@@ -47,8 +49,8 @@ chat_model:
|
|
|
47
49
|
temperature: 0.8
|
|
48
50
|
```
|
|
49
51
|
|
|
50
|
-
在此示例中,DocSmith
|
|
52
|
+
在此示例中,DocSmith 配置为使用 Google 的 `gemini-2.5-pro` 模型,并将 `temperature` 设置为 `0.8` 作为所有生成任务的默认值。
|
|
51
53
|
|
|
52
54
|
---
|
|
53
55
|
|
|
54
|
-
|
|
56
|
+
配置好 LLM 提供商后,下一步是管理文档的语言设置。请前往[语言支持](./configuration-language-support.md)指南,查看支持的语言完整列表并了解如何启用它们。
|
|
@@ -1,78 +1,93 @@
|
|
|
1
1
|
# プリファレンスの管理
|
|
2
2
|
|
|
3
|
-
AIGNE DocSmith
|
|
3
|
+
AIGNE DocSmith は、フィードバックから学習するように設計されています。生成されたコンテンツを改良または修正すると、DocSmith はそのフィードバックをプリファレンスと呼ばれる永続的なルールに変換できます。これらのルールにより、特定のスタイル、構造要件、コンテンツポリシーが将来のドキュメント作成タスクで一貫して適用されるようになります。すべてのプリファレンスは、プロジェクトルートの `.aigne/doc-smith/preferences.yml` にある人間が読めるYAMLファイルに保存されます。
|
|
4
4
|
|
|
5
5
|
## プリファレンスのライフサイクル
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
次の図は、フィードバックが再利用可能なルールになり、将来のタスクに適用され、コマンドラインから管理される方法を示しています。
|
|
8
8
|
|
|
9
9
|
```d2 プリファレンスのライフサイクル
|
|
10
10
|
direction: down
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
label: "
|
|
14
|
-
shape:
|
|
12
|
+
developer: {
|
|
13
|
+
label: "開発者"
|
|
14
|
+
shape: person
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
label: "
|
|
17
|
+
docsmith_system: {
|
|
18
|
+
label: "AIGNE DocSmith システム"
|
|
19
19
|
shape: rectangle
|
|
20
|
-
}
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
cli: {
|
|
22
|
+
label: "CLI コマンド\n(refine / translate)"
|
|
23
|
+
shape: rectangle
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
agent: {
|
|
27
|
+
label: "内部分析 Agent"
|
|
28
|
+
shape: rectangle
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
decision: {
|
|
32
|
+
label: "フィードバックは\n再利用可能なポリシーか?"
|
|
33
|
+
shape: diamond
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
create_rule: {
|
|
37
|
+
label: "新しいプリファレンスルールを作成"
|
|
38
|
+
shape: rectangle
|
|
39
|
+
}
|
|
25
40
|
}
|
|
26
41
|
|
|
27
|
-
|
|
28
|
-
label: "
|
|
42
|
+
preferences_file: {
|
|
43
|
+
label: ".aigne/doc-smith/preferences.yml"
|
|
29
44
|
shape: cylinder
|
|
30
45
|
}
|
|
31
46
|
|
|
32
|
-
|
|
33
|
-
label: "
|
|
34
|
-
shape:
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
cli: {
|
|
38
|
-
label: "5. CLI管理\n('aigne doc prefs')"
|
|
39
|
-
shape: rectangle
|
|
47
|
+
one_time_fix: {
|
|
48
|
+
label: "一度限りの修正として適用"
|
|
49
|
+
shape: oval
|
|
40
50
|
}
|
|
41
51
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
decision ->
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
52
|
+
developer -> docsmith_system.cli: "1. フィードバックを提供"
|
|
53
|
+
docsmith_system.cli -> docsmith_system.agent: "2. フィードバックをキャプチャ"
|
|
54
|
+
docsmith_system.agent -> docsmith_system.decision: "3. 分析"
|
|
55
|
+
docsmith_system.decision -> docsmith_system.create_rule: "はい"
|
|
56
|
+
docsmith_system.create_rule -> preferences_file: "4. ルールをファイルに保存"
|
|
57
|
+
docsmith_system.decision -> one_time_fix: "いいえ"
|
|
49
58
|
```
|
|
50
59
|
|
|
51
|
-
###
|
|
60
|
+
### プリファレンスの作成方法
|
|
52
61
|
|
|
53
|
-
`refine` または `translate`
|
|
62
|
+
`refine` または `translate` の段階でフィードバックを提供すると、内部 Agent が入力を分析します。フィードバックが一度限りの修正(例:タイポの修正)か、再利用可能なポリシー(例:「コードコメントは常に英語で書く」)かを判断します。それが永続的な指示を表す場合、新しいプリファレンスルールを作成し、プロジェクトの `preferences.yml` ファイルに保存します。
|
|
54
63
|
|
|
55
64
|
### ルールのプロパティ
|
|
56
65
|
|
|
57
|
-
`preferences.yml`
|
|
58
|
-
|
|
59
|
-
<x-field
|
|
60
|
-
<x-field data-name="
|
|
61
|
-
<x-field data-name="
|
|
62
|
-
<x-field data-name="
|
|
63
|
-
<x-field
|
|
64
|
-
|
|
65
|
-
<x-field data-name="
|
|
66
|
+
`preferences.yml` に保存される各ルールは、次の構造を持ちます。
|
|
67
|
+
|
|
68
|
+
<x-field-group>
|
|
69
|
+
<x-field data-name="id" data-type="string" data-desc="ルールの一意でランダムに生成された識別子(例:pref_a1b2c3d4e5f6g7h8)。"></x-field>
|
|
70
|
+
<x-field data-name="active" data-type="boolean" data-desc="ルールが現在有効かどうかを示します。無効なルールは生成タスク中に無視されます。"></x-field>
|
|
71
|
+
<x-field data-name="scope" data-type="string">
|
|
72
|
+
<x-field-desc markdown>ルールをいつ適用するかを定義します。有効なスコープは `global`、`structure`、`document`、または `translation` です。</x-field-desc>
|
|
73
|
+
</x-field>
|
|
74
|
+
<x-field data-name="rule" data-type="string" data-desc="将来のタスクでAIに渡される、具体的で洗練された指示。"></x-field>
|
|
75
|
+
<x-field data-name="feedback" data-type="string" data-desc="ユーザーから提供された元の自然言語のフィードバック。参照用に保存されます。"></x-field>
|
|
76
|
+
<x-field data-name="createdAt" data-type="string" data-desc="ルールが作成された日時を示すISO 8601タイムスタンプ。"></x-field>
|
|
77
|
+
<x-field data-name="paths" data-type="string[]" data-required="false">
|
|
78
|
+
<x-field-desc markdown>オプションのファイルパスのリスト。存在する場合、ルールはこれらの特定のソースファイルに対して生成されたコンテンツにのみ適用されます。</x-field-desc>
|
|
79
|
+
</x-field>
|
|
80
|
+
</x-field-group>
|
|
66
81
|
|
|
67
82
|
## CLIによるプリファレンスの管理
|
|
68
83
|
|
|
69
|
-
`aigne doc prefs`
|
|
84
|
+
`aigne doc prefs` コマンドを使用して、保存されているすべてのプリファレンスを表示および管理できます。これにより、ルールの一覧表示、有効化、無効化、または永久に削除することができます。
|
|
70
85
|
|
|
71
|
-
###
|
|
86
|
+
### すべてのプリファレンスを一覧表示
|
|
72
87
|
|
|
73
|
-
|
|
88
|
+
保存されているすべてのプリファレンス(有効なものと無効なものの両方)の完全なリストを表示するには、`--list` フラグを使用します。
|
|
74
89
|
|
|
75
|
-
```bash
|
|
90
|
+
```bash すべてのプリファレンスを一覧表示 icon=lucide:terminal
|
|
76
91
|
aigne doc prefs --list
|
|
77
92
|
```
|
|
78
93
|
|
|
@@ -83,12 +98,12 @@ aigne doc prefs --list
|
|
|
83
98
|
|
|
84
99
|
**フォーマットの説明:**
|
|
85
100
|
- 🟢 = 有効なプリファレンス, ⚪ = 無効なプリファレンス
|
|
86
|
-
- [scope] =
|
|
101
|
+
- [scope] = プリファレンススコープ (global, structure, document, translation)
|
|
87
102
|
- ID = 一意のプリファレンス識別子
|
|
88
103
|
- Paths = 特定のファイルパス(該当する場合)
|
|
89
104
|
|
|
90
105
|
🟢 [structure] pref_a1b2c3d4e5f6g7h8 | Paths: overview.md
|
|
91
|
-
|
|
106
|
+
概要ドキュメントの最後に「次のステップ」セクションを追加します。
|
|
92
107
|
|
|
93
108
|
⚪ [document] pref_i9j0k1l2m3n4o5p6
|
|
94
109
|
コードコメントは英語で記述する必要があります。
|
|
@@ -96,13 +111,13 @@ aigne doc prefs --list
|
|
|
96
111
|
|
|
97
112
|
### プリファレンスの無効化と再有効化
|
|
98
113
|
|
|
99
|
-
|
|
114
|
+
ルールを削除せずに一時的に無効にする必要がある場合は、`--toggle` フラグで有効ステータスを切り替えることができます。IDなしでコマンドを実行すると対話モードが起動し、切り替えるプリファレンスを1つ以上選択できます。
|
|
100
115
|
|
|
101
|
-
```bash
|
|
116
|
+
```bash プリファレンスを対話的に切り替える icon=lucide:terminal
|
|
102
117
|
aigne doc prefs --toggle
|
|
103
118
|
```
|
|
104
119
|
|
|
105
|
-
特定のルールを直接切り替えるには、`--id` フラグでそのID
|
|
120
|
+
特定のルールを直接切り替えるには、`--id` フラグでそのIDを指定します。このアクションは、ルールの `active` プロパティを変更します。
|
|
106
121
|
|
|
107
122
|
```bash 特定のプリファレンスを切り替える icon=lucide:terminal
|
|
108
123
|
aigne doc prefs --toggle --id pref_i9j0k1l2m3n4o5p6
|
|
@@ -110,15 +125,15 @@ aigne doc prefs --toggle --id pref_i9j0k1l2m3n4o5p6
|
|
|
110
125
|
|
|
111
126
|
### プリファレンスの削除
|
|
112
127
|
|
|
113
|
-
1つ以上のプリファレンスを完全に削除するには、`--remove`
|
|
128
|
+
1つ以上のプリファレンスを完全に削除するには、`--remove` フラグを使用します。この操作は元に戻せません。
|
|
114
129
|
|
|
115
130
|
対話的な選択プロンプトを表示するには、IDなしでコマンドを実行します。
|
|
116
131
|
|
|
117
|
-
```bash
|
|
132
|
+
```bash プリファレンスを対話的に削除する icon=lucide:terminal
|
|
118
133
|
aigne doc prefs --remove
|
|
119
134
|
```
|
|
120
135
|
|
|
121
|
-
|
|
136
|
+
特定のルールを直接削除するには、`--id` フラグでそのIDを指定します。
|
|
122
137
|
|
|
123
138
|
```bash 特定のプリファレンスを削除する icon=lucide:terminal
|
|
124
139
|
aigne doc prefs --remove --id pref_a1b2c3d4e5f6g7h8
|
|
@@ -126,4 +141,4 @@ aigne doc prefs --remove --id pref_a1b2c3d4e5f6g7h8
|
|
|
126
141
|
|
|
127
142
|
## 次のステップ
|
|
128
143
|
|
|
129
|
-
プリファレンスの管理は、DocSmith
|
|
144
|
+
プリファレンスの管理は、DocSmithをプロジェクトの特定のニーズに合わせて調整する上で重要な部分です。その他のカスタマイズオプションについては、メインの[設定ガイド](./configuration.md)をご覧ください。
|