forked from LLM-Red-Team/emohaa-free-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 700233d
Showing
34 changed files
with
2,526 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
logs | ||
dist | ||
doc | ||
node_modules | ||
.vscode | ||
.git | ||
.gitignore | ||
README.md | ||
*.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dist/ | ||
node_modules/ | ||
logs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM node:lts AS BUILD_IMAGE | ||
|
||
WORKDIR /app | ||
|
||
COPY . /app | ||
|
||
RUN npm i --registry http://registry.npmmirror.com && npm run build | ||
|
||
FROM node:lts-alpine | ||
|
||
COPY --from=BUILD_IMAGE /app/configs ./configs | ||
COPY --from=BUILD_IMAGE /app/package.json ./package.json | ||
COPY --from=BUILD_IMAGE /app/dist ./dist | ||
COPY --from=BUILD_IMAGE /app/node_modules ./node_modules | ||
|
||
WORKDIR /app | ||
|
||
EXPOSE 8000 | ||
|
||
CMD ["npm", "start"] |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Emohaa AI Free 服务 | ||
|
||
![](https://img.shields.io/github/license/llm-red-team/emohaa-free-api.svg) | ||
![](https://img.shields.io/github/stars/llm-red-team/emohaa-free-api.svg) | ||
![](https://img.shields.io/github/forks/llm-red-team/emohaa-free-api.svg) | ||
![](https://img.shields.io/docker/pulls/vinlic/emohaa-free-api.svg) | ||
|
||
支持高速流式输出、支持多轮对话,零配置部署,多路token支持,自动清理会话痕迹。 | ||
|
||
与ChatGPT接口完全兼容。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# 服务名称 | ||
name: emohaa-free-api | ||
# 服务绑定主机地址 | ||
host: '0.0.0.0' | ||
# 服务绑定端口 | ||
port: 8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# 是否开启请求日志 | ||
requestLog: true | ||
# 临时目录路径 | ||
tmpDir: ./tmp | ||
# 日志目录路径 | ||
logDir: ./logs | ||
# 日志写入间隔(毫秒) | ||
logWriteInterval: 200 | ||
# 日志文件有效期(毫秒) | ||
logFileExpires: 2626560000 | ||
# 公共目录路径 | ||
publicDir: ./public | ||
# 临时文件有效期(毫秒) | ||
tmpFileExpires: 86400000 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"name": "emohaa-free-api", | ||
"version": "0.0.1", | ||
"description": "Emohaa Free API Server", | ||
"type": "module", | ||
"main": "dist/index.js", | ||
"module": "dist/index.mjs", | ||
"types": "dist/index.d.ts", | ||
"directories": { | ||
"dist": "dist" | ||
}, | ||
"files": [ | ||
"dist/" | ||
], | ||
"scripts": { | ||
"dev": "tsup src/index.ts --format cjs,esm --sourcemap --dts --publicDir public --watch --onSuccess \"node dist/index.js\"", | ||
"start": "node dist/index.js", | ||
"build": "tsup src/index.ts --format cjs,esm --sourcemap --dts --clean --publicDir public" | ||
}, | ||
"author": "Vinlic", | ||
"license": "ISC", | ||
"dependencies": { | ||
"axios": "^1.6.7", | ||
"colors": "^1.4.0", | ||
"crc-32": "^1.2.2", | ||
"cron": "^3.1.6", | ||
"date-fns": "^3.3.1", | ||
"eventsource-parser": "^1.1.2", | ||
"fs-extra": "^11.2.0", | ||
"koa": "^2.15.0", | ||
"koa-body": "^5.0.0", | ||
"koa-bodyparser": "^4.4.1", | ||
"koa-range": "^0.3.0", | ||
"koa-router": "^12.0.1", | ||
"koa2-cors": "^2.0.6", | ||
"lodash": "^4.17.21", | ||
"mime": "^4.0.1", | ||
"minimist": "^1.2.8", | ||
"randomstring": "^1.3.0", | ||
"uuid": "^9.0.1", | ||
"yaml": "^2.3.4" | ||
}, | ||
"devDependencies": { | ||
"@types/lodash": "^4.14.202", | ||
"@types/mime": "^3.0.4", | ||
"tsup": "^8.0.2", | ||
"typescript": "^5.3.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export default { | ||
API_TEST: [-9999, 'API异常错误'], | ||
API_REQUEST_PARAMS_INVALID: [-2000, '请求参数非法'], | ||
API_REQUEST_FAILED: [-2001, '请求失败'], | ||
API_TOKEN_EXPIRES: [-2002, 'Token已失效'], | ||
API_FILE_URL_INVALID: [-2003, '远程文件URL非法'], | ||
API_FILE_EXECEEDS_SIZE: [-2004, '远程文件超出大小'], | ||
API_CHAT_STREAM_PUSHING: [-2005, '已有对话流正在输出'] | ||
} |
Oops, something went wrong.