ourongxing / chatgpt-vercel Goto Github PK
View Code? Open in Web Editor NEWElegant and Powerfull. Powered by OpenAI and Vercel.
Home Page: https://vercel-chatgpt-github.vercel.app/
License: MIT License
Elegant and Powerfull. Powered by OpenAI and Vercel.
Home Page: https://vercel-chatgpt-github.vercel.app/
License: MIT License
在电脑上,按‘ 空格 ’或者‘ / ’ 出现的预设,无法用鼠标点击选中
使用CloudFlare配置Pages项目,刚开始提示Node版本过低,升级Node版本为18.0.0后,出现另外一个错误,如下:
-- | --
20:24:42.689 | Installing dependencies
20:24:42.700 | Python version set to 2.7
20:24:46.058 | Downloading and installing node v18.0.0...
20:24:46.551 | Downloading https://nodejs.org/dist/v18.0.0/node-v18.0.0-linux-x64.tar.xz...
20:24:46.986 | Computing checksum with sha256sum
20:24:47.120 | Checksums matched!
20:24:51.354 | node: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.27' not found (required by node) 20:24:51.354 | node: /lib/x86_64-linux-gnu/libc.so.6: version
GLIBC_2.25' not found (required by node)
20:24:51.355 | node: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.28' not found (required by node) 20:24:51.405 | nvm is not compatible with the npm config "prefix" option: currently set to "" 20:24:51.407 | Run
npm config delete prefixor
nvm use --delete-prefix v18.0.0` to unset it.
20:24:51.407 | Failed to install node version '18.0.0'
20:24:51.411 | Failed: build command exited with code: 1
20:24:52.194 | Failed: an internal error occurred
因为在CloudFlare,只能配置npm run build的配置,没办法解决npm和nvm的冲突,有其他人遇到吗
如题,原仓库已经更新日间模式,希望同步更新
是否可以加一个简单的访问控制,校验一个密码,通过之后才能访问
更新到最新版本之后,相应的速度下降了不少,我还是回退到之前部署的版本上面了
能否就是在下面的设置处,可以添加模型选择,然后根据不同的任务选择不同的模型,然后来执行之后的操作
如何在自己的服务器(Ubuntu系统)上进行部署这个项目?
想问下是否会有这么一个功能:“不填KEY就根据IP地址限制提问次数”,部署时可以选择是否开启限制。
大佬可以加个屏蔽词功能吗
就是设置某个屏蔽词然后转成另外一个词
然后可以设置多个的那种
position: fixed;
在手机上使用,点对话右上角复制,提示复制成功,实际没有复制上。
输入问题后,一直提示这个问题
env中加入这个:HTTPS_PROXY=http://127.0.0.1:15235
一样也是连接不成功,求解谢谢
import type { APIRoute } from "astro"
import {
createParser,
ParsedEvent,
ReconnectInterval
} from "eventsource-parser"
const apiKeys = (
import.meta.env.OPENAI_API_KEY?.split(/\s*|\s*/) ?? []
).filter(Boolean)
export const post: APIRoute = async context => {
const body = await context.request.json()
const apiKey = apiKeys.length
? apiKeys[Math.floor(Math.random() * apiKeys.length)]
: ""
let { messages, key = apiKey, temperature = 0.6 } = body
const encoder = new TextEncoder()
const decoder = new TextDecoder()
^
if (!key.startsWith("sk-")) key = apiKey
if (!key) {
return new Response("没有填写 OpenAI API key")
}
if (!messages) {
return new Response("没有输入任何文字")
}
const completion = await fetch("https://api.openai.com/v1/chat/completions", {
headers: {
"Content-Type": "application/json",
Authorization: Bearer ${key}
},
method: "POST",
body: JSON.stringify({
model: "gpt-3.5-turbo",
messages,
temperature,
stream: true
})
})
const stream = new ReadableStream({
async start(controller) {
const streamParser = (event: ParsedEvent | ReconnectInterval) => {
if (event.type === "event") {
const data = event.data
if (data === "[DONE]") {
controller.close()
return
}
try {
// response = {
// id: 'chatcmpl-6pULPSegWhFgi0XQ1DtgA3zTa1WR6',
// object: 'chat.completion.chunk',
// created: 1677729391,
// model: 'gpt-3.5-turbo-0301',
// choices: [
// { delta: { content: '你' }, index: 0, finish_reason: null }
// ],
// }
const json = JSON.parse(data)
const text = json.choices[0].delta?.content
const queue = encoder.encode(text)
controller.enqueue(queue)
} catch (e) {
controller.error(e)
}
}
}
const parser = createParser(streamParser)
for await (const chunk of completion.body as any) {
parser.feed(decoder.decode(chunk))
}
}
})
return new Response(stream)
}
希望可以保存某些历史对话
在需要连续对话的场景,有时一些历史消息是我们不需要提供给api的。目前只有清除整个消息记录的功能,需要携带部分上下文时就满足不了需求了。希望大佬加下
导致连续中文打字后,一回车发现自己的输入被默认的prompt提示词给覆盖了。
部署后填提问回车后一直卡住直至报 Error
试了下fork回去 把key编辑进去再部署到vercel openai马上就来邮件说key暴露了 把key自动换掉了
加了一个gitalk 评论插件 重新部署后,出现下面错误,框架不熟,求大佬指教
ERR_PNPM_OUTDATED_LOCKFILE Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up-to-date with package.json
Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"
英文字符没有这个现像
I am the maintainer of the chatgpt-demo . I suggest you don't violate the open source agreement, try add a fork tag to the secondary development. Thanks
[POST] /api/stream reason=EDGE_FUNCTION_INVOCATION_TIMEOUT, status=504, user_error=true
怎么肥事
无法结合上下文来回答问题
key几分钟就被封了,换了七八个,都是这样,同一批key,在服务器部署的,就没事,你们有碰到过吗~
本地 搭建
项目端口可能有误,检测到当前项目监听了以下端口[ 3001 ]
请问在哪修改端口?
希望页面上增加一个可用余额的展示,该接口请求方式如下:
$ curl -s "https://api.openai.com/dashboard/billing/credit_grants" \
--header 'Content-type: application/json' \
--header 'Authorization: Bearer api_key' | jq 这里替换api_key
{
"object": "credit_summary",
"total_granted": 18,
"total_used": 0.178104, # 已用
"total_available": 17.821896, # 剩余可用余额
"grants": {
"object": "list",
"data": [
{
"object": "credit_grant",
"id": "be32c280-ad4a-4e14-bc1a-077a32275f9e",
"grant_amount": 18,
"used_amount": 0.178104,
"effective_at": 1677628800,
"expires_at": 1688169600
}
]
}
}
如题,还有这个预设可以自己写一个设定,直接在对话开头发给chat吗?还是说需要把写的设定设置到系统角色里?
你的有這問題,diu 的可以針對原問題"繼續"回答
这这这...啥情况,应该不是tizi问题,不然也不能搭建啊
有大佬出来帮解答一下不
个人部署后无法使用导出markdown功能,导出图片功能可正常使用
setSetting({
...defaultSetting,
...parsed
continuousDialogue: false
})
取消注释之后vercel这边上传报错是什么原因
这个项目我想部署到我自己的服务器上面该怎么部署呀求大佬回复
希望添加语音输入输出能力
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.