anse-app / chatgpt-demo Goto Github PK
View Code? Open in Web Editor NEWMinimal web UI for ChatGPT.
Home Page: https://chatgpt.ddiu.me
License: MIT License
Minimal web UI for ChatGPT.
Home Page: https://chatgpt.ddiu.me
License: MIT License
网页进入后台再进入会自动刷新,切程序什么的都会,用的docker部署。还有就是有时候,聊天过久会直接不回复
希望能跟ChatGPT 一样有深浅主题模式切换,现在的夜间模式白天看不太清楚
希望能跟ChatGPT 一样有深浅主题模式切换,现在的夜间模式白天看不太清楚
No response
No response
如题
environment:
Linux instance-20211025-1400 5.15.0-1029-oracle #35~20.04.1-Ubuntu SMP Wed Jan 25 10:16:03 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux
npm version v9.6.0
node version v16.19.1
error log :
root@instance:~/chatgpt/chatgpt-demo# npm run dev
> [email protected] dev
> astro dev
file:///root/chatgpt/chatgpt-demo/node_modules/node-fetch-native/dist/shared/node-fetch-native.2b047dc1.mjs:432
throw new TypeError(`${context} is not a ReadableStream.`);
^
TypeError: First parameter has member 'readable' that is not a ReadableStream.
at assertReadableStream (file:///root/chatgpt/chatgpt-demo/node_modules/node-fetch-native/dist/shared/node-fetch-native.2b047dc1.mjs:432:21)
at convertReadableWritablePair (file:///root/chatgpt/chatgpt-demo/node_modules/node-fetch-native/dist/shared/node-fetch-native.2b047dc1.mjs:3509:11)
at ReadableStream.pipeThrough (file:///root/chatgpt/chatgpt-demo/node_modules/node-fetch-native/dist/shared/node-fetch-native.2b047dc1.mjs:3584:33)
at fetchFinale (/root/chatgpt/chatgpt-demo/node_modules/undici/lib/fetch/index.js:973:52)
at mainFetch (/root/chatgpt/chatgpt-demo/node_modules/undici/lib/fetch/index.js:773:5)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
docker镜像呢
Add a copy button to the top right corner of the code block
When used on the official website, the code block has a copy button, hoping to add this function
No response
No response
Hello!
Thank you for creating this demonstration.
Could you please tell me the proper method for deploying it on Vercel? I attempted to do so but it did not work.
在centos上部署很复杂啊。
设置和安装依赖项npm i
制作一个副本.env.example,然后将其重命名为.env
添加到.env OPENAI_API_KEY=sk-xxx...
运行应用 npm run dev
这四步成功了,打开网站,403
不合适小白一键部署,大佬出个完整教程吧,在centos上部署。
请问有人build成功了吗?运行run build,有几个warning,但是看不到dist文件夹
error
Cause { "errno": -4078, "code": "ECONNREFUSED", "syscall": "connect", "address": "127.0.0.1", "port": 7890 }
npm
RT
机器 Mac mini M1
❯ node -v
v16.13.2
❯ npm -v
8.3.0
按照 readme 操作之后,运行不起来
❯ npm run dev
[email protected] dev
astro dev
(node:55714) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time
(Use node --trace-warnings ...
to show where the warning was created)
🚀 astro v2.0.17 started in 40ms
┃ Local http://localhost:3000/
┃ Network use --host to expose
file:///Users/ming/code/chatgpt-demo/node_modules/node-fetch-native/dist/shared/node-fetch-native.2b047dc1.mjs:432
throw new TypeError(${context} is not a ReadableStream.
);
^
TypeError: First parameter has member 'readable' that is not a ReadableStream.
at assertReadableStream (file:///Users/ming/code/chatgpt-demo/node_modules/node-fetch-native/dist/shared/node-fetch-native.2b047dc1.mjs:432:21)
at convertReadableWritablePair (file:///Users/ming/code/chatgpt-demo/node_modules/node-fetch-native/dist/shared/node-fetch-native.2b047dc1.mjs:3509:11)
at ReadableStream.pipeThrough (file:///Users/ming/code/chatgpt-demo/node_modules/node-fetch-native/dist/shared/node-fetch-native.2b047dc1.mjs:3584:33)
at fetchFinale (/Users/ming/code/chatgpt-demo/node_modules/undici/lib/fetch/index.js:973:52)
at mainFetch (/Users/ming/code/chatgpt-demo/node_modules/undici/lib/fetch/index.js:773:5)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
1
1
npm
the code is not working GHSA-5ff8-jcf9-fw62
大佬 我可以分担服务器费用 跟梯子费用 能加个好友吗 discord vx qq 都可以
root@ # ./dist/server/entry.mjs
-bash: ./dist/server/entry.mjs: No such file or directory
It can turn out to be a public service rather than self use.
还要等他全部生成完毕后手动滑倒底部看完整回答,能优化这个步骤吗
Hello, may we please add a new feature that allows the export of conversations using markdown format and a click-to-copy function when clicking a message/conversation?
And can we use the official OpenAI package and typing? https://platform.openai.com/docs/api-reference/chat/create
Thank you.
超级快啊
The front end will always show that the AI is Thinking instead of throwing an exception that exceeds the length limit. This interaction can easily confuse users.
Determine whether the message length exceeds the limit, or handle the error message returned by openai.
No response
No response
建议api key 从环境变量中取
输入能放到下面固定么
建议实现多行输入
https://stats.ddiu.io/app.js
!
function() {
"use strict"; !
function(t) {
var e = t.screen,
n = e.width,
r = e.height,
a = t.navigator.language,
i = t.location,
o = t.localStorage,
c = t.document,
u = t.history,
s = i.hostname,
f = i.pathname,
l = i.search,
d = c.currentScript;
if (d) {
var v, p = function(t, e) {
return Object.keys(e).forEach((function(n) {
void 0 !== e[n] && (t[n] = e[n])
})),
t
},
h = function(t, e, n) {
var r = t[e];
return function() {
for (var e = [], a = arguments.length; a--;) e[a] = arguments[a];
return n.apply(null, e),
r.apply(t, e)
}
},
m = function() {
return o && o.getItem("umami.disabled") || E &&
function() {
var e = t.doNotTrack,
n = t.navigator,
r = t.external,
a = "msTrackingProtectionEnabled",
i = e || n.doNotTrack || n.msDoNotTrack || r && a in r && r[a]();
return "1" == i || "yes" === i
} () || A && !N.includes(s)
},
g = "data-",
b = "false",
y = d.getAttribute.bind(d),
w = y(g + "website-id"),
S = y(g + "host-url"),
k = y(g + "auto-track") !== b,
E = y(g + "do-not-track"),
T = y(g + "css-events") !== b,
A = y(g + "domains") || "",
N = A.split(",").map((function(t) {
return t.trim()
})),
j = (S ? S.replace(/\/$/, "") : d.src.split("/").slice(0, -1).join("/")) + "/api/collect",
x = n + "x" + r,
O = /^umami--([a-z]+)--([\w]+[\w-]*)$/,
K = "[class*='umami--']",
L = {},
D = "" + f + l,
P = c.referrer,
$ = function() {
return {
website: w,
hostname: s,
screen: x,
language: a,
url: D
}
},
_ = function(t, e) {
var n;
if (!m()) return fetch(j, {
method: "POST",
body: JSON.stringify({
type: t,
payload: e
}),
headers: p({
"Content-Type": "application/json"
},
(n = {},
n["x-umami-cache"] = v, n))
}).then((function(t) {
return t.text()
})).then((function(t) {
return v = t
}))
},
q = function(t, e, n) {
return void 0 === t && (t = D),
void 0 === e && (e = P),
void 0 === n && (n = w),
_("pageview", p($(), {
website: n,
url: t,
referrer: e
}))
},
z = function(t, e, n, r) {
return void 0 === n && (n = D),
void 0 === r && (r = w),
_("event", p($(), {
website: r,
url: n,
event_name: t,
event_data: e
}))
},
C = function(t) {
var e = t.querySelectorAll(K);
Array.prototype.forEach.call(e, I)
},
I = function(t) {
var e = t.getAttribute.bind(t); (e("class") || "").split(" ").forEach((function(n) {
if (O.test(n)) {
var r = n.split("--"),
a = r[1],
o = r[2],
c = L[n] ? L[n] : L[n] = function(n) {
"click" !== a || "A" !== t.tagName || n.ctrlKey || n.shiftKey || n.metaKey || n.button && 1 === n.button || e("target") ? z(o) : (n.preventDefault(), z(o).then((function() {
var t = e("href");
t && (i.href = t)
})))
};
t.addEventListener(a, c, !0)
}
}))
},
J = function(t, e, n) {
if (n) {
P = D;
var r = n.toString(); (D = "http" === r.substring(0, 4) ? "/" + r.split("/").splice(3).join("/") : r) !== P && q()
}
};
if (!t.umami) {
var M = function(t) {
return z(t)
};
M.trackView = q,
M.trackEvent = z,
t.umami = M
}
if (k && !m()) {
u.pushState = h(u, "pushState", J),
u.replaceState = h(u, "replaceState", J);
var V = function() {
"complete" === c.readyState && (q(), T && (C(c), new MutationObserver((function(t) {
t.forEach((function(t) {
var e = t.target;
I(e),
C(e)
}))
})).observe(c, {
childList: !0,
subtree: !0
})))
};
c.addEventListener("readystatechange", V, !0),
V()
}
}
} (window)
} ();
这个js会向作者api发送域名,客户端分辨率等不算特别敏感的信息。虽然说不是很敏感,也明白可能是为了统计,但是这样做也是很不妥的吧。
Thanks for the great work.
According to https://platform.openai.com/docs/guides/chat/introduction
openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Who won the world series in 2020?"},
{"role": "assistant", "content": "The Los Angeles Dodgers won the World Series in 2020."},
{"role": "user", "content": "Where was it played?"}
]
)
Seen like we can specify a "system role" to apply on the assistant role?
If that's so, maybe we can add a box in the beginning of the chat to let user write a role for the assistant?
牛
As the title
希望能实现类似openai官网的功能:保存和管理历史会话、继续历史会话
通过询问chatgpt,应该是可以实现的,具体包括:
增加类似官网的new chat功能,有个侧边栏可以保留历史聊天记录。
增加类似官网的new chat功能,有个侧边栏可以保留历史聊天记录。
No response
No response
作者的工作真的做的很棒!
访问作者贴出的demo链接,发现回答的速度特别快以及回答的内容都是完整的(chatgpt网页版总是会限制每次回答的字数)
想请问下作者哪些因素和技术决定了回答的速度和回答的内容字数呢?
还有作者的demo链接用的是您自己的api key吗,这样大家都可以访问的话,18美元的免费额度是不是很快就会用完呀😂
宝塔node项目新建里部署,端口填写错误 502。 这个项目正确端口应该是多少?
Hello, it has come to my attention that Katext poses serious security vulnerabilities which have yet to be addressed. As a precaution, I advise using alternative, related packages that are consistently updated and maintained at a high level.
加了key以后,一直connect error的错误。求救。。。
TypeError: fetch failed
at Object.fetch (node:internal/deps/undici/undici:11413:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Module.post (D:\new_phpstudy_pro\WWW\chatgpt-demo-main\src\pages\api\generate.ts:14:22)
at async call (file:///D:/new_phpstudy_pro/WWW/chatgpt-demo-main/node_modules/astro/dist/core/endpoint/index.js:71:20)
at async call (file:///D:/new_phpstudy_pro/WWW/chatgpt-demo-main/node_modules/astro/dist/core/endpoint/dev/index.js:15:10)
at async handleRoute (file:///D:/new_phpstudy_pro/WWW/chatgpt-demo-main/node_modules/astro/dist/vite-plugin-astro-server/route.js:117:20)
at async run (file:///D:/new_phpstudy_pro/WWW/chatgpt-demo-main/node_modules/astro/dist/vite-plugin-astro-server/request.js:46:14)
at async runWithErrorHandling (file:///D:/new_phpstudy_pro/WWW/chatgpt-demo-main/node_modules/astro/dist/vite-plugin-astro-server/controller.js:65:5)
at async handleRequest (file:///D:/new_phpstudy_pro/WWW/chatgpt-demo-main/node_modules/astro/dist/vite-plugin-astro-server/request.js:40:3)
Cause:
ConnectTimeoutError: Connect Timeout Error
at onConnectTimeout (D:\new_phpstudy_pro\WWW\chatgpt-demo-main\node_modules\undici\lib\core\connect.js:182:24)
at D:\new_phpstudy_pro\WWW\chatgpt-demo-main\node_modules\undici\lib\core\connect.js:129:46
at Immediate._onImmediate (D:\new_phpstudy_pro\WWW\chatgpt-demo-main\node_modules\undici\lib\core\connect.js:168:33)
at process.processImmediate (node:internal/timers:476:21)
现在开放了3.5的api,不进行登录权限的控制,很容易把额度刷完,只需要加一个简单的验证,然后是否可以把部署方式搞到railway里面
frist: 非常感谢 developer 奉献了这么一个好的项目, 也为了节省大家的时间,提供一下部署的步骤:
# ---- Dependencies ----
FROM node:19.7.0 AS dependencies
WORKDIR /app
COPY package.json /app
RUN npm install
# ---- RUN ----
FROM dependencies AS RUN
WORKDIR /app
COPY . /app
COPY .env.example /app/.env
ENV PORT=3000
VOLUME ["./env"]
CMD [ "npm", "run", "dev", "--", "--port", "3000", "--host", "0.0.0.0"]
如果还是不会部署的话 这边帮忙部署环境;只需要提供域名即可;Q:1194191181
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.