- My home page Hi Jazee
jazee6 / cloudflare-ai-web Goto Github PK
View Code? Open in Web Editor NEW支持Gemini Pro / Cloudflare Workers AI / ChatGPT的融合Web平台
Home Page: https://ai.jaze.top
License: Apache License 2.0
支持Gemini Pro / Cloudflare Workers AI / ChatGPT的融合Web平台
Home Page: https://ai.jaze.top
License: Apache License 2.0
gemini 报错 500,其他模型使用正常
在部署后测试出现400 {"success":false,"errors":[{"code":7000,"message":"No route for that URI"}],"messages":[],"result":null} 报错
高亮代码部能否添加复制的按钮选项。
只是个人感觉好看些和😂
在/page/index.vue文件添加css样式:
::-webkit-scrollbar {
display: none;
}
Stable Diffusion XL应该除了Prompt还可以识别别的一些参数:其所有的参数应该是按照官网上来的:
https://platform.stability.ai/docs/features/api-parameters。
大概常用的参数有:
prompt:正常提示词
height:图片的高度
width: 图片的宽度
steps: 迭代步数
num_samples: 一次性生图的个数
cfg_scale: 提示词的权重
sampler:采样器函数名称,例如k_euler就是euler采样器
seed: 种子,默认为随机(0)
可以通过一个函数来解析聊天message里面是否包含“--width”这种参数来识别是否用户添加了参数,然后将参数解析为一个请求体,发送给SDXL模型。例如聊天内容为“ a cute cat --width 1200 --height 1280" 就可以解析为:
{
prompt:'a cute cat',
width:1200,
height:1280
}
默认的 gemini pro 不知道是啥版本,很笨,不太好用。最近谷歌已经开放gemini-1.5-pro的 api 申请了,我两个谷歌账号都申请成功了,应该还比较容易。希望可以增加gemini-1.5-pro-latest
模型。
Gemini 1.5 Pro Waitlist申请地址
https://aistudio.google.com/app/waitlist/97445851
附上谷歌回复的邮件参考,调用地址是/v1beta
,模型名是gemini-1.5-pro-latest
Gemini 1.5 Pro API
You should now have API access to Gemini 1.5 Pro on the GCP project you shared with us!
To get started:
Create an API key generated from your allowlisted GCP Project.
Run the list_models Python method or this cURL command:
curl 'https://generativelanguage.googleapis.com/v1beta/models?key=<YOUR_API_KEY>'
Check out our Gemini API cookbook or visit the Gemini API docs, open up the Python quickstart (or the programming language of your choice) and update code by replacing the model name with 'gemini-1.5-pro-latest'.
Having access issues? Go to https://aistudio.google.com/app/apikey and confirm that the API key you are using is tied to your allowlisted Google Cloud Project.
And thanks to @cloudflare and raise @ for the pignomy. I don't necessarily want a lot of changes but tip and advice considered and appreciated. Thank you all very much 🙏 u
想要部署在自己的VPS机器上,是否可以提供指南
Error: recieved non-200 status code, {"status":401,"statusText":"Unauthorized","body":"{\n "error": {\n "message": "Incorrect API key provided: undefined. You can find your API key at https://platform.openai.com/account/api-keys.\",\n "type": "invalid_request_error",\n "param": null,\n "code": "invalid_api_key"\n }\n}\n"}
图功能不可用,一直有一个小黑点儿,在转圈
CF_GATEWAY创建,请问名称填什么,URL slug填什么,文档里没有明确。
如题
对于vercel可能在部分地区被污染,因此增加在page部署的方法,同样简单方便
以下是我的构建命令
Build command:
npx nuxt generate
Build output directory:
/dist
Root directory:
/
Build comments on pull requests:
Enabled
i ✓ built in 7.63s 09:33:14
√ Server built in 7646ms 09:33:14
i Initializing prerenderer nitro 09:33:14
[09:33:17] WARN "file:///C:/Users/user01/Documents/GitHub/cloudflare-ai-web/node_modules/nuxt/dist/core/runtime/nitro/cache-driver.js" is imported by "virtual:#internal/nitro/virtual/storage", but could not be resolved – treating it as an external dependency.
i Prerendering 1 routes nitro 09:33:18
├─ / (368ms) nitro 09:33:18
├─ /_payload.json (2ms) nitro 09:33:18
i Prerendered 2 routes in 4.509 seconds nitro 09:33:18
ERROR Cannot read properties of undefined (reading 'split') 09:33:18
at /C:/Users/user01/Documents/GitHub/cloudflare-ai-web/node_modules/@rollup/plugin-inject/dist/es/index.js:74:74
at Map.forEach ()
at inject (/C:/Users/user01/Documents/GitHub/cloudflare-ai-web/node_modules/@rollup/plugin-inject/dist/es/index.js:71:16)
at getRollupConfig (/C:/Users/user01/Documents/GitHub/cloudflare-ai-web/node_modules/nitropack/dist/nitro.mjs:2032:29)
at build (/C:/Users/user01/Documents/GitHub/cloudflare-ai-web/node_modules/nitropack/dist/nitro.mjs:2345:24)
at /C:/Users/user01/Documents/GitHub/cloudflare-ai-web/node_modules/nuxt/dist/index.mjs:3473:13
at async build (/C:/Users/user01/Documents/GitHub/cloudflare-ai-web/node_modules/nuxt/dist/index.mjs:5001:5)
at async Object.run (/C:/Users/user01/Documents/GitHub/cloudflare-ai-web/node_modules/nuxi/dist/chunks/build.mjs:95:5)
at async runCommand$1 (/C:/Users/user01/Documents/GitHub/cloudflare-ai-web/node_modules/nuxi/dist/shared/nuxi.9edf0930.mjs:1648:16)
at async runCommand$1 (/C:/Users/user01/Documents/GitHub/cloudflare-ai-web/node_modules/nuxi/dist/shared/nuxi.9edf0930.mjs:1639:11)
ERROR Cannot read properties of undefined (reading 'split')
你好,我在Cloudflare部署成功。
也都按照说明设置了参数。
但是无论使用哪个AI,都回复405错误。
我可能在哪一步做错了?谢谢。
OPENAI_API_KEY添加了one-api的key。增加了一个OPENAI_API_URL填写了one-api的代理地址,但是chatgpt-3.5没有回应。
使用vercel搭建。是否只能使用官方key
Error: recieved non-200 status code, {"status":401,"statusText":"Unauthorized","body":"{\n "error": {\n "message": "Incorrect API key provided: sk-TK6NM***************************************48B5. You can find your API key at https://platform.openai.com/account/api-keys.\",\n "type": "invalid_request_error",\n "param": null,\n "code": "invalid_api_key"\n }\n}\n"}
建议专注在把CF AI转换成openai格式,这样就可以接入One-API配合其他成熟的前端应用使用。
如增加 openai的dall-e-2等模型,或者是cloudflare内免费的图生图模型
在使用vercel部署后使用,报了两个错,麻烦各位大佬帮忙看看。
1.首先,因为部署代理的链接不可用,因此采用了修改nuxt.config.ts文件的方法,修改后如下,不知是否对不对?
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: {enabled: true},
modules: ['@nuxt/ui'],
css: ['~/assets/css/style.css'],
devServer: {
port: 3001,
},
routeRules: {
'/': {
prerender: true,
}
},
app: {
head: {
title: 'CF AI Web',
meta: [
{
name: 'keywords',
content: 'CF AI Web, AI, Cloudflare Workers, ChatGPT, GeminiPro, Google Generative AI'
},
{
name: 'description',
content: 'Integrated web platform supporting GeminiPro/Cloudflare Workers AI/ChatGPT by Jazee6'
}
]
}
}
})
nitro: {
vercel: {
regions: ["cle1", "iad1", "pdx1", "sfo1", "sin1", "syd1", "hnd1", "kix1"]
}
}
2.环境变量添加了gemini api key,现在报错代码如下。
[POST] /api/auth/gemini/?model=gemini-pro status=500
[nuxt] [request error] [unhandled] [500] [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1/models/gemini-pro:streamGenerateContent?alt=sse: [400 Bad Request] User location is not supported for the API use.
at (index.mjs:1:117483)
at (index.mjs:1:121866)
或者在nuxt.config.ts中添加以下配置
‵‵‵
nitro: {
vercel: {
regions: ["cle1", "iad1", "pdx1", "sfo1", "sin1", "syd1", "hnd1", "kix1"]
}
}
‵‵‵
以上应该如何修改
如题
Build Step改为NITRO_PRESET=deno-deploy npm run build_node
这一步是在哪里修改
设置密码后,页面并未弹出登录框,希望增加登录框
在对话页面的设置按钮中只有填写openai api key的选项,但是填写后依然无法使用chatgpt,gemini的api连填写的地方都没有,实在不知道怎么办?只好向大佬们求助,谢谢解答
可以暂时不用考虑 Service Worker,只加一个 manifest.json
🫠
安照大佬项目的指引,基本搭建成功,能跑起来了。目前唯一的问题是gemini pro 出现地区不支持问题,大佬项目里说到:
或者在nuxt.config.ts中添加以下配置
nitro: {
vercel: {
regions: ["cle1", "iad1", "pdx1", "sfo1", "sin1", "syd1", "hnd1", "kix1"]
}
}
本人小白,找了半天不知道在哪里添加这个内容,麻烦大佬再具体指导一下(如果能截图说明更好),谢谢!
可否增加兼容openai的api接口,在第三方客户端使用
[nuxt] [request error] [unhandled] [500] [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1/models/gemini-pro:streamGenerateContent?alt=sse: [400 Bad Request] API key not valid. Please pass a valid API key. [{"@type":"type.googleapis.com/google.rpc.ErrorInfo","reason":"API_KEY_INVALID","domain":"googleapis.com","metadata":{"service":"generativelanguage.googleapis.com"}}]
at (index.mjs:1:117486)
at (index.mjs:1:121869)
经常提示504 {"result":null,"success":false,"errors":[{"code":7009,"message":"Upstream service unavailable"}],"messages":[]}
只要十秒内没有生成就报这个,有些问题十秒钟输出不完的
hi, is there any plans to add English support?
Thanks,
You've requested a page on a website (gateway.ai.cloudflare.com) that is on the Cloudflare network. An unknown error occurred while rendering the page.
If you are the owner of this website:
you should login to Cloudflare and check the error logs for gateway.ai.cloudflare.com.
这个提示出现得过于频繁(非敏感话题,比如出现“性别"可能就会被限制,请问有办法通过参数修改,或者移除限制吗
某些服务提供商(如 DeepSeek)的 API 使用 OpenAI 兼容的格式,可以通过自定义 API 端点使用这类服务。
[可以正常使用了
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.