Skip to content

Commit

Permalink
feat: !!!Support Forefront Now!!!
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangsx committed May 12, 2023
1 parent ed8edf7 commit 3b3d3a7
Show file tree
Hide file tree
Showing 10 changed files with 954 additions and 402 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
yarn-error.log
package-lock.json
node_modules/
.env
.env
pool/run
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ Still striving to keep updating.

Have implemented models here:
If you do not want your website to appear here, please raise an issue and I will remove it immediately.
|model|support|status|
|--|--|--|
|[aidream](http://aidream.cloud)|GPT-3.5|![Active](https://img.shields.io/badge/Active-brightgreen)|
|[you.com](you.com)|GPT-3.5|![Active](https://img.shields.io/badge/Active-brightgreen)|
|[forefront.ai](forefront.ai)|GPT-3.5 / Internet / good search|![Active](https://img.shields.io/badge/Active-grey)|
|model|support|status|active time|
|--|--|--|--|
|[forefront.ai](forefront.ai)|GPT-4/gpt3.5|![Active](https://img.shields.io/badge/Active-brightgreen)|after 2023-05-21|
|[aidream](http://aidream.cloud)|GPT-3.5|![Active](https://img.shields.io/badge/Active-brightgreen)|after 2023-05-21|
|[you.com](you.com)|GPT-3.5|![Active](https://img.shields.io/badge/Active-brightgreen)|after 2023-05-21|
|[phind.com](https://www.phind.com/)|GPT-4 / Internet / good search|![Active](https://img.shields.io/badge/Active-grey)|
|[bing.com/chat](bing.com/chat)|GPT-4/3.5||
|[poe.com](poe.com)| GPT-4/3.5||
Expand Down Expand Up @@ -102,6 +102,9 @@ common request
curl "http://127.0.0.1:3000/ask?prompt=hello&model=aidream"

# test default model chat.forefront.at
# !!!!ATTENTION!!!! It Unstable when the first time use, but support GPT4
# !!!!ATTENTION!!!! You may got timeout when you run this project ant req forefront the first time.
# !!!!ATTENTION!!!! It will run quickly in your next time;
curl "http://127.0.0.1:3000/ask?prompt=hello&model=forefront&gptmodel=gpt-4&resignup=1"

# test you.com
Expand All @@ -115,6 +118,9 @@ request event-stream
curl "http://127.0.0.1:3000/ask/stream?prompt=hello&model=aidream"

# test chat.forefront.at
# !!!!ATTENTION!!!! It Unstable when the first time use, but support GPT4
# !!!!ATTENTION!!!! You may got timeout when you run this project ant req forefront the first time.
# !!!!ATTENTION!!!! It will run quickly in your next time;
curl "http://127.0.0.1:3000/ask/stream?prompt=hello&model=forefront&gptmodel=gpt-4&resignup=1"

# test you
Expand Down
20 changes: 12 additions & 8 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Router from 'koa-router'
import bodyParser from 'koa-bodyparser';
import {ChatModelFactory, Model} from "./model";
import dotenv from 'dotenv';
import {freeBrowserPool} from "./pool/puppeteer";

dotenv.config();

Expand Down Expand Up @@ -63,12 +64,15 @@ router.get('/ask/stream', async (ctx) => {

app.use(router.routes());

const server = app.listen(3000, () => {
console.log("Now listening: 127.0.0.1:3000");
});

process.on('SIGINT', () => {
server.close(() => {
process.exit(0);
(async () => {
await freeBrowserPool.init(1, process.env.DEBUG === '1');
const server = app.listen(3000, () => {
console.log("Now listening: 127.0.0.1:3000");
});
});
process.on('SIGINT', () => {
server.close(() => {
process.exit(0);
});
});
})()

Loading

0 comments on commit 3b3d3a7

Please sign in to comment.