Skip to content

Commit

Permalink
🐛 fix: fix anthropic streaming on Vercel/Cloudflare (lobehub#1480)
Browse files Browse the repository at this point in the history
* 📝 docs(bot): Auto sync agents & plugin to readme

* 🐛 fix: anthropic streaming issue on vercel

* 📝 update document, remove anthropic known issue

---------

Co-authored-by: lobehubbot <[email protected]>
Co-authored-by: GH Action - Upstream Sync <[email protected]>
  • Loading branch information
3 people authored Mar 7, 2024
1 parent 96117fa commit 227101a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
5 changes: 0 additions & 5 deletions docs/self-hosting/environment-variables/model-provider.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,3 @@ When using the `turn` mode, the API Keys will be retrieved in a round-robin mann
- Default: -
- Example: `sk-ant-apixx-xxxxxxxxx-xxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxx`


<Callout type={'warning'}>
There's [a known issue](https://github.com/anthropics/anthropic-sdk-typescript/issues/292) with the official Anthropic SDK on Vercel/Cloudflare edge runtime, which causes chat streams to be interrupted randomly. If you want to use the Anthropic provider, do not use Vercel/Cloudflare for now; the Anthropic provider should be working fine with other hosting options.
</Callout>

Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,4 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
- 类型:必选
- 描述:这是你在 Anthropic AI 服务中申请的 API 密钥
- 默认值:-
- 示例:`sk-ant-apixx-xxxxxxxxx-xxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxx`

<Callout type={'warning'}>
官方 Anthropic SDK 在 Vercel/Cloudflare
边缘节点运行时存在一个[已知问题](https://github.com/anthropics/anthropic-sdk-typescript/issues/292)
,会导致聊天流出现随机中断。如果您希望在 lobe-chat 中使用 Anthropic 模型,请暂时不要部署到
Vercel/Cloudflare。Anthropic 模型在其他部署方式下可以正常工作。
</Callout>
- 示例:`sk-ant-apixx-xxxxxxxxx-xxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxx`
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
},
"dependencies": {
"@ant-design/icons": "^5",
"@anthropic-ai/sdk": "^0.16.0",
"@anthropic-ai/sdk": "^0.17.0",
"@auth/core": "latest",
"@aws-sdk/client-bedrock-runtime": "^3.503.1",
"@azure/openai": "^1.0.0-beta.11",
Expand Down

0 comments on commit 227101a

Please sign in to comment.