💻 Front-end development
🧑💻 Open source enthusiast
🌈 Less is more, Worse is better ~
用 Express 和 Vue3 搭建的 ChatGPT 演示网页
License: MIT License
💻 Front-end development
🧑💻 Open source enthusiast
🌈 Less is more, Worse is better ~
version: '3'
services:
app:
image: chenzhaoyu94/chatgpt-web
ports:
- 3002:3002
environment:
OPENAI_API_KEY: xxxxx
service: 改为 services:
大佬,docker部署的,一直停留在三个小球弹来弹去的界面上。
目前项目中build只是打包了vue前端代码,后端的Express服务该怎么部署呢?
The build is complete, and the apikey is also added, why is it prompted Network Error
试了下text-davinci-002-render-sha,用的https://github.com/acheong08/ChatGPT
revChatGPT.V1版本,貌似比api的版本回复更好一点
感谢大佬付出
部署在线上,用的apache。前端https能访问到,后端提示404,后端是用pnpm start运行在同一台服务器上的
如题,方便不会配置环境的小白,非常感谢。
如果是nginx的话 应该怎么构建环境大佬
我在页面大约三秒就会返回Request failed with status code 502.但是docker logs 里面是有应答的。
app_1 | Server is running on port 3002
app_1 | upsertMessage 3e4eda8e-8a4d-4534-b9a7-e8c8916c2de2 {
app_1 | role: 'user',
app_1 | id: '3e4eda8e-8a4d-4534-b9a7-e8c8916c2de2',
app_1 | parentMessageId: undefined,
app_1 | conversationId: '841f86c7-4cdd-4996-87ca-f337286f88f9',
app_1 | text: '你知道tiktok吗?'
app_1 | }
app_1 | upsertMessage cmpl-6kppdi7YrxjLR7pIpmkbM5DZDBHdp {
app_1 | role: 'assistant',
app_1 | id: 'cmpl-6kppdi7YrxjLR7pIpmkbM5DZDBHdp',
app_1 | parentMessageId: '3e4eda8e-8a4d-4534-b9a7-e8c8916c2de2',
app_1 | conversationId: '841f86c7-4cdd-4996-87ca-f337286f88f9',
app_1 | text: '当然! TikTok是一个流行的社交媒体应用,它可以让你创建和共享精彩视频。',
app_1 | detail: {
app_1 | id: 'cmpl-6kppdi7YrxjLR7pIpmkbM5DZDBHdp',
app_1 | object: 'text_completion',
app_1 | created: 1676620349,
app_1 | model: 'text-davinci-003',
app_1 | choices: [ [Object] ],
app_1 | usage: { prompt_tokens: 72, completion_tokens: 70, total_tokens: 142 }
app_1 | }
app_1 | }
我看这个项目的服务端也是用的https://github.com/transitive-bullshit/chatgpt-api 这个库,他的代码里聊天记录会缓存最大数量10000条的记录,所谓的“上下文”是把上一句话拼到新的请求里,大概是这个逻辑。
极端情况下,假设10000条数据存满了,现在第10001条push进来了,那第负一条数据就shift了,接下来这条数据想上下文关联就关联不起来了。
想听听大家的意见
功能请求,可以控制每个用户的使用次数。这样防止别人乱刷api余额
这两天提交的代码中,IDEA总是会莫名奇妙报错EsLint
TypeError: Cannot read properties of undefined (reading 'type')
导致ESLint失效,请问知道是什么原因吗,是否是配置有问题
ChatGPT error 500: {
"error": {
"message": "Internal server error",
"type": "auth_subrequest_error",
"param": null,
"code": "internal_error"
}
}
为什么总自动刷新,用起来体验不好
目前h5没有适配
23:57:47 ❯ pnpm run service
> [email protected] service /Users/zhangxin/work/src/github.com/Chanzhaoyu/chatgpt-web
> esno ./service/index.ts
/Users/zhangxin/work/src/github.com/Chanzhaoyu/chatgpt-web/node_modules/.pnpm/[email protected]/node_modules/chatgpt/build/index.js:15
throw new Error("Invalid environment: global fetch not defined");
^
Error: Invalid environment: global fetch not defined
at <anonymous> (/Users/zhangxin/work/src/github.com/Chanzhaoyu/chatgpt-web/node_modules/.pnpm/[email protected]/node_modules/chatgpt/build/index.js:15:9)
at Object.<anonymous> (/Users/zhangxin/work/src/github.com/Chanzhaoyu/chatgpt-web/node_modules/.pnpm/[email protected]/node_modules/chatgpt/build/index.js:76:18)
at Module._compile (node:internal/modules/cjs/loader:1165:14)
at Object.F (/Users/zhangxin/work/src/github.com/Chanzhaoyu/chatgpt-web/node_modules/.pnpm/@[email protected]/node_modules/@esbuild-kit/cjs-loader/dist/index.js:1:941)
at Module.load (node:internal/modules/cjs/loader:1043:32)
at Function.Module._load (node:internal/modules/cjs/loader:878:12)
at Module.require (node:internal/modules/cjs/loader:1067:19)
at require (node:internal/modules/cjs/helpers:103:18)
at <anonymous> (/Users/zhangxin/work/src/github.com/Chanzhaoyu/chatgpt-web/service/chatgpt.ts:2:28)
at Object.<anonymous> (/Users/zhangxin/work/src/github.com/Chanzhaoyu/chatgpt-web/service/chatgpt.ts:48:16)
ELIFECYCLE Command failed with exit code 1.
在服务器上搭建
后端服务/service pnpm start 后IP:3002 得到的页面是 Cannot GET / 如何解决?
网页端报错Error: Network Error
是后端没开成功导致的网络报错吗?
目前跟网页版智能化差距很大,写的文章非常不行,没有办法用,只有网页版的有使用价值
如题
配置过全局API和service里的API了,但是发送消息就报错
现在是向下增加,如果问题过多还需要下滑
是我服务器连接api的问题吗
这样就比较“有感觉”了。
如题
本地dev没有问题,前端build后发布到服务器后
包含/chat
chat/16769007713
不刷新功能正常,一刷新就404
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name chatgpt.baidu.com;
ssl_certificate /opt/cert/chatgpt.baidu.com.cer;
ssl_certificate_key /opt/cert/chatgpt.baidu.com.key;
client_max_body_size 50M;
auth_basic 'chatgpt';
auth_basic_user_file /etc/a.pw;
location / {
proxy_hide_header Authorization;
proxy_redirect off;
proxy_pass http://127.0.0.1:3002;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
加上basic auth就会固定http 500,去掉就正常,即使加了proxy_hide_header Authorization也还是一样。
Client: Docker Engine - Community
Version: 20.10.18
API version: 1.41
Go version: go1.18.6
Git commit: b40c2f6
Built: Thu Sep 8 23:11:45 2022
OS/Arch: linux/amd64
Context: default
Experimental: true
nginx version: nginx/1.20.2
如果过个用户同时使用,每个用户都能实现对话,这个可以实现吗
目前Openai调用失败,会直接终止node进程,建议加上对异常的处理
pm2 挂起后就error。请教下如何部署
里面的端口是1002,运行报错,改为3002就能运行
左下角清除对话按钮建议增加确认框,没有输入问题时右侧提交按钮置灰
需要给span加
word-wrap:break-word;white-space:normal;
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.