Skip to content

Commit 26fa83d

Browse files
authored
docs: add support and documentation for Anthropic API service (#212)
- Add support for Anthropic API service - Update README to include Anthropic API in the list of supported services - Provide configuration instructions for using Anthropic API - Add links to Anthropic API documentation and model list Signed-off-by: Bo-Yi Wu <[email protected]>
1 parent 4690f33 commit 26fa83d

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ A CLI written in [Go](https://go.dev) that writes git commit messages or provide
2020

2121
## Features
2222

23-
- Supports [Azure OpenAI Service](https://azure.microsoft.com/en-us/products/cognitive-services/openai-service), [OpenAI API](https://platform.openai.com/docs/api-reference), [Gemini][60], [Ollama][41], [Groq][30], and [OpenRouter][50].
23+
- Supports [Azure OpenAI Service](https://azure.microsoft.com/en-us/products/cognitive-services/openai-service), [OpenAI API](https://platform.openai.com/docs/api-reference), [Gemini][60], [Anthropic][100], [Ollama][41], [Groq][30], and [OpenRouter][50].
2424
- Supports [conventional commits specification](https://www.conventionalcommits.org/en/v1.0.0/).
2525
- Supports Git prepare-commit-msg Hook, see the [Git Hooks documentation](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks).
2626
- Supports customizing generated diffs with n lines of context, the default is three.
@@ -132,6 +132,23 @@ codegpt config set openai.model gemini-1.5-flash-latest
132132
[61]: https://ai.google.dev/gemini-api/docs
133133
[62]: https://aistudio.google.com/app/apikey
134134

135+
## Support [Anthropic][100] API Service
136+
137+
Build with the Anthropic API, you can see the [Anthropic API documentation][101]. Update the `provider` and `api_key` in your config file. Please create an API key from the [Anthropic API][102] page.
138+
139+
```sh
140+
codegpt config set openai.provider anthropic
141+
codegpt config set openai.api_key xxxxxxx
142+
codegpt config set openai.model claude-3-5-sonnet-20241022
143+
```
144+
145+
See the model list from the [Anthropic API documentation][103].
146+
147+
[100]: https://anthropic.com/
148+
[101]: https://docs.anthropic.com/en/home
149+
[102]: https://anthropic.com/
150+
[103]: https://docs.anthropic.com/en/docs/about-claude/models
151+
135152
### How to change to [Groq][30] API Service
136153

137154
Please get the `API key` from Groq API Service, please visit [here][31]. Update the `base_url` and `api_key` in your config file.

README.zh-tw.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
## 功能
2222

23-
- 支援 [Azure OpenAI Service](https://azure.microsoft.com/en-us/products/cognitive-services/openai-service)[OpenAI API](https://platform.openai.com/docs/api-reference)[Gemini][60][Ollama][41][Groq][30][OpenRouter][50]
23+
- 支援 [Azure OpenAI Service](https://azure.microsoft.com/en-us/products/cognitive-services/openai-service)[OpenAI API](https://platform.openai.com/docs/api-reference)[Gemini][60][Anthropic][100][Ollama][41][Groq][30][OpenRouter][50]
2424
- 支援 [conventional commits 規範](https://www.conventionalcommits.org/en/v1.0.0/)
2525
- 支援 Git prepare-commit-msg Hook,請參閱 [Git Hooks 文件](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks)
2626
- 支援自訂生成的差異上下文行數,預設為三行。
@@ -132,6 +132,23 @@ codegpt config set openai.model gemini-1.5-flash-latest
132132
[61]: https://ai.google.dev/gemini-api/docs
133133
[62]: https://aistudio.google.com/app/apikey
134134

135+
## 支援 [Anthropic][100] API 服務
136+
137+
使用 Anthropic API 構建,你可以參考 [Anthropic API 文件][101]。在你的配置文件中更新 `provider``api_key`。請從 [Anthropic API][102] 頁面創建 API 金鑰。.
138+
139+
```sh
140+
codegpt config set openai.provider anthropic
141+
codegpt config set openai.api_key xxxxxxx
142+
codegpt config set openai.model claude-3-5-sonnet-20241022
143+
```
144+
145+
請參閱 [Anthropic API 文件][103] 中的模型列表。
146+
147+
[100]: https://anthropic.com/
148+
[101]: https://docs.anthropic.com/en/home
149+
[102]: https://anthropic.com/
150+
[103]: https://docs.anthropic.com/en/docs/about-claude/models
151+
135152
### 如何切換到 [Groq][30] API 服務
136153

137154
請從 Groq API 服務獲取 `API 金鑰`,請訪問[這裡][31]。在你的配置文件中更新 `base_url``api_key`

0 commit comments

Comments
 (0)