Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ feat: Support Cloudflare Workers AI #2966
✨ feat: Support Cloudflare Workers AI #2966
Changes from 17 commits
f2996eb
6de6000
4b1d4c6
b774549
1336aae
ff5361e
6d658bd
5a0a4da
3608659
161af46
aa609af
0972e11
8ad1100
ed2f3c0
e47aee5
1909a89
5a1180c
7648bde
9d036ee
7fe9401
fa23ba4
4414320
8d1f973
3b57709
7efaab9
87f0721
7844a5b
26de0f1
65463e0
7fe207a
e0f541a
bc26fd8
0f5462f
bb02954
85021aa
cb7dd1c
ac8d4f2
eefacf5
5fc4c81
52ff9d1
b8492e2
b452d30
b46c642
2dca07d
0f40d15
8469931
b3351d8
65c0bd2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
考虑下在这里做 accountId 的拼接传入。或者在
LobeOpenAICompatibleFactory
方法中加个 baseURL 允许是个入参函数的方法。baseURL: (params)=> `https://api.cloudflare.com/client/v4/accounts/${params.accountId}/ai/v1`
。个人感觉后者会更加泛化一些,未来有别的特殊 baseURL 也可以兼容
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里要用
llmEnv.XXX
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
换成 llmEnv.CLOUDFLARE_ACCOUNT_ID 之后报下述错误:
`Error: ❌ Attempted to access a server-side environment variable on the client
请教一下有什么办法能让设置页的 Cloudflare Account ID 同步到此处 baseURL?
配置项写在 src/app/api/chat/agentRuntime.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
accountId 作为参数传给 server端。然后 server 端的 LobeCloudflareAI 初始化时候 baseURL 的逻辑变成 accountId 拼接的?