你正常点

This commit is contained in:
2023-03-17 00:27:11 +08:00
parent e56389b4c2
commit 383d6de1d6
3 changed files with 6 additions and 8 deletions

View File

@@ -12,7 +12,7 @@
- 对话记录使用浏览器的 localStorage 保存在本地
- 可删除对话消息
- 可以设置 system message (如:"你是一个娘",参见官方 [API 文档](https://platform.openai.com/docs/guides/chat))
- 可以设置 system message (如:"你是一个娘",参见官方 [API 文档](https://platform.openai.com/docs/guides/chat))
- 可以为不同对话设置不同 APIKEY
- 小(整个网页 30k 左右)
- 可以设置不同的 API Endpoint方便墙内人士使用反向代理转发 API 请求)
@@ -21,8 +21,6 @@
![screenshot](./screenshot.webp)
~~让喵娘统治世界吧((发病.webp~~
## 使用
以下任意方式都可:

View File

@@ -20,7 +20,7 @@ export interface ChatStore {
const _defaultAPIEndpoint = "https://api.openai.com/v1/chat/completions";
const newChatStore = (
apiKey = "",
systemMessageContent = "你是一个猫娘,你要模仿猫娘的语气说话",
systemMessageContent = "你是一个有用的人工智能助理",
apiEndpoint = _defaultAPIEndpoint,
streamMode = true
): ChatStore => {

View File

@@ -164,17 +164,17 @@ export default function ChatBOX(props: {
<div className="grow overflow-scroll">
{!chatStore.apiKey && (
<p className="opacity-60 p-6 rounded bg-white my-3 text-left">
(OPENAI) API KEY
(OPENAI) API KEY
</p>
)}
{!chatStore.apiEndpoint && (
<p className="opacity-60 p-6 rounded bg-white my-3 text-left">
API Endpoint
API Endpoint
</p>
)}
{chatStore.history.length === 0 && (
<p className="opacity-60 p-6 rounded bg-white my-3 text-left">
QwQ
</p>
)}
{chatStore.history.map((chat, i) => {
@@ -226,7 +226,7 @@ export default function ChatBOX(props: {
<p className="p-2 my-2 animate-pulse">
{generatingMessage
? generatingMessage.split("\n").map((line) => <p>{line}</p>)
: "生成中,保持网络稳定"}
: "生成中,保持网络稳定"}
...
</p>
)}