Skip to content

Commit

Permalink
修复一些小问题
Browse files Browse the repository at this point in the history
  • Loading branch information
202252197 committed Jan 17, 2025
0 parents commit 7fa0002
Show file tree
Hide file tree
Showing 106 changed files with 43,752 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
> 1%
last 2 versions
not dead
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.github
node_modules
README.md
4 changes: 4 additions & 0 deletions .env.serve
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#设置openai的key,防止页面刷新重新输入
VUE_APP_OPENAI_API_KEY=""
#设置 OpenAI Url
VUE_APP_OPENAI_API_URL=""
13 changes: 13 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
26 changes: 26 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: docker

on:
push:
branches:
- 'main'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Check Out
uses: actions/checkout@v3

- name: Build docker image
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
push: false
tags: chat-gpt:latest

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.DS_Store
node_modules
/dist


# local env files
.env.local
.env.*.local
.env

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

#Electron-builder output
/dist_electron
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry="https://registry.npmmirror.com/"
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM node:16-alpine AS builder
WORKDIR /app

# install and cache app dependencies
COPY package.json .
RUN npm install

ARG OPENAI_API_KEY=""
ARG OPENAI_API_URL=""
ENV VUE_APP_OPENAI_API_KEY="${OPENAI_API_KEY}"
ENV VUE_APP_OPENAI_API_URL="${OPENAI_API_URL}"

COPY . .
RUN npm run build

FROM nginx:alpine

COPY --from=builder /app/dist /usr/share/nginx/html
28 changes: 28 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
BSD 3-Clause License

Copyright (c) 2023, 吕世昊

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
130 changes: 130 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@


<div align=center>
<img src="https://www.freeimg.cn/i/2023/12/26/658a86f8cf809.png" />
</div>
<a href="https://github.com/202252197">
<img width=800 src="https://github-profile-trophy.vercel.app/?username=202252197&column=7&theme=gruvbox&no-frame=true"/>
</a>
<div>
声明:此项目只发布于 GitHub,基于 BSD-3-Clause license 协议,免费且作为开源学习使用。并且不会有任何形式的卖号、付费服务、卖key等行为。谨防受骗。
项目使用Vue2进行开发,给大家提供一个方便使用的OpenAI web 管理界面,有好的建议和bug欢迎大家提出来,项目会一直开源和代码优化,方便对openai进行入门了解使用,后期会接入后端,实现更丰富的功能。
</div>

> 🤭记得点个小星星Starred
## 会话
![webui4.5](https://www.freeimg.cn/i/2023/12/26/658a737bec9c4.jpeg)
## 模型
![webui4.5](https://www.freeimg.cn/i/2023/12/26/658a7358e83b7.jpeg)
## 微调模型
![webui4.5](https://www.freeimg.cn/i/2023/12/26/658a74002da34.jpeg)
## 文件
![webui4.5](https://www.freeimg.cn/i/2023/12/26/658a73b451da1.jpeg)
## 中英文切换
![webui4.5](https://www.freeimg.cn/i/2023/12/26/658a73e2c8945.jpeg)
## 适配手机
<div>
<img src="https://www.freeimg.cn/i/2023/12/26/658a7444f169c.jpeg" alt="drawing" width="270px"/>
<img src="https://www.freeimg.cn/i/2023/12/26/658a7456ade1e.jpeg" alt="drawing" width="280px"/>
<img src="https://www.freeimg.cn/i/2023/12/26/658a74685a4e4.jpeg" alt="drawing" width="270px"/>
</div>

## 参考视频
https://www.bilibili.com/video/BV1BM4y187bp 使用API调用StableDiffusion生成图片简单案例
https://www.bilibili.com/video/BV1iL411k7pC 本地+云服务器 部署此项目视频
https://www.bilibili.com/video/BV1ss4y1d72g 此项目微调使用的简单案例
关注我的B站,持续输出简单的入门案例

# 部署步骤
## 本地部署

```sh
npm install
npm run serve
npm run build
```

# 在线体验地址 (需要使用OpenAI KEY)

> https://huggingface.co/spaces/junchenmo/OpenAI-Manager
## OpenAI-Key设置以及自定义设置

### 配置使用自定义的 OpenAI proxy

在 .env.serve 中添加代码

```env
VUE_APP_OPENAI_API_URL='你的openai api proxy'
```

### 在/src/store/mutation-types.js

可以在此文件中设置AI头像+用户头像+用户名称

# 技术栈

| 名称 | 版本 |
| ---- | ---- |
| vue | 2.6.14 |
| element-ui | 2.15.12 |
| NodeJS | 14+ |

# 项目进度(对标OpenAI官方接口文档)

| 接口 | 描述 |
| ---- | ---- |
| List Models | 获取模型列表 |
| Completion | text-davinci-003, text-davinci-002, text-curie-001, text-babbage-001, text-ada-001, davinci, curie, babbage, ada模型 |
| Chat Completion | gpt-4, gpt-4-0314, gpt-4-32k, gpt-4-32k-0314, gpt-3.5-turbo, gpt-3.5-turbo-0301模型 |
| Create edit | 创建编辑(待..) |
| Create Image | 根据描述生成图片 |
| Create image edit | 根据上传的图片结合输入的描述生成图片 |
| Create Image Variation | 根据上传的图片生成变体图片 |
| Create embeddings | 创建向量查询(可以实现PDF对话)(待..) |
| Create transcription | 语音转换为文字 |
| Create translation | 一个或多个来源语言的语音或音频文件翻译成目标语言 |
| List files | 文件列表 |
| Upload file | 上传文件 |
| Delete file | 删除文件 |
| Retrieve file | 检索文件信息 |
| Retrieve file content | 检索文件内容(OpenAI为了防止滥用,只要plus用户才可以使用) |
| Create fine-tune | 创建微调 |
| List fine-tunes | 微调列表 |
| Retrieve fine-tune | 检索微调信息 |
| Cancel fine-tune | 取消微调 |
| List fine-tune events | 微调事件列表(待..) |
| Delete fine-tune model | 删除微调模型 |
| Create moderation | 创建审核 |
| List engines | 引擎列表(已弃用) |
| Retrieve engine | 检索引擎信息(已弃用) |
| 多会话储存和上下文逻辑 | GPT3.5模型支持上下文逻辑,多窗口上下文对话 |
| 导出导入数据 | 支持导出当前会话,导出全部会话,导入当前会话,导出当前会话,清除当前会话,清除全部会话 |
| 聊天截图到本地图片 | 截图功能,有缺陷只能截图当前窗口的图片,建议QQ长截图(暂时取消) |
| 更换聊天窗口背景 | 支持输入背景图片URL,暂时取消并保留此功能,没太大意义(暂时取消) |
| 角色扮演 | 内置多角色prompt |
| 界面多语言 | 支持中英文语言 |

# 贡献者
<div>
<a href="https://github.com/202252197/ChatGPT_JCM/graphs/contributors">
<img src="https://contrib.rocks/image?repo=202252197/ChatGPT_JCM" />
</a>
</div>


## Star History
[![Star History Chart](https://api.star-history.com/svg?repos=202252197/ChatGPT_JCM&type=Timeline)](https://star-history.com/#202252197/ChatGPT_JCM&Timeline)

# 免责声明
这不是官方的OpenAI产品。这是一个个人项目,与OpenAI没有任何关系。不要起诉我。

<a href="https://github.com/202252197/ChatGPT_JCM" ><img src="https://img.shields.io/github/stars/202252197/ChatGPT_JCM" /></a>
<a href="https://github.com/202252197/ChatGPT_JCM" ><img src="https://img.shields.io/github/last-commit/202252197/ChatGPT_JCM" /></a>
<a href="https://github.com/202252197/ChatGPT_JCM" ><img src="https://img.shields.io/github/release/202252197/ChatGPT_JCM" /></a>
<a href="https://github.com/202252197/ChatGPT_JCM" ><img src="https://img.shields.io/github/downloads/202252197/ChatGPT_JCM/total" /></a>
<a href="https://github.com/202252197/ChatGPT_JCM" ><img src="https://img.shields.io/github/license/202252197/ChatGPT_JCM" /></a>
</p>

![Visitor Count](https://profile-counter.glitch.me/202252197/count.svg)

5 changes: 5 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
19 changes: 19 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: "3.6"

services:
chatgpt:
container_name: chatgpt
build:
context: .
dockerfile: ./Dockerfile
args:
# - OPENAI_API_KEY=xx-xxx
# - OPENAI_API_URL=http://baidu.com
ports:
- 8090:80
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "1"
44 changes: 44 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>666</title>
<style type="text/css">
.div1{
width: 500px;
height: 300px;
overflow-y: scroll;
margin: auto;
border: 1px solid red;
}
.div2{
width: 200px;
height: 50px;
border: 1px solid red;
}


</style>
</head>
<body>

<div class="div1">
666
</div>

<button type="button" id="btn">添加</button>

<script type="text/javascript">
var div1 = document.querySelector('.div1');
var btn = document.querySelector('#btn');
btn.addEventListener('click',function(){
console.log('66')
var k = div1.innerHTML;
div1.innerHTML = k+"<br/>66";

div1.scrollTop = div1.scrollHeight;

})
</script>
</body>
</html>
19 changes: 19 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"baseUrl": "./",
"moduleResolution": "node",
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
}
}
Loading

0 comments on commit 7fa0002

Please sign in to comment.