feat: change default model to forefront

このコミットが含まれているのは:
xiang 2023-05-06 16:48:48 +08:00
コミット 875aa64275
3個のファイルの変更17行の追加8行の削除

ファイルの表示

@ -3,8 +3,8 @@ This is a replication project for the typescript version of [gpt4free](https://g
Still striving to keep updating. Still striving to keep updating.
Have implemented models here: Have implemented models here:
- [x] you.com GPT-3.5 / Internet / good search - [x] you.com GPT-3.5 / Internet / good search **not active**
- [x] forefront.ai GPT-4/3.5 - [x] forefront.ai GPT-4/3.5 **still active**
- [ ] poe.com GPT-4/3.5 - [ ] poe.com GPT-4/3.5
- [ ] writesonic.com GPT-3.5 / Internet - [ ] writesonic.com GPT-3.5 / Internet
- [ ] t3nsor.com GPT-3.5 - [ ] t3nsor.com GPT-3.5
@ -41,17 +41,20 @@ docker-compose up --build -d
common request common request
```shell ```shell
# test default model chat.forefront.at
curl "http://127.0.0.1:3000/ask?prompt=hello" curl "http://127.0.0.1:3000/ask?prompt=hello"
curl "http://127.0.0.1:3000/ask?prompt=hello&model=forefront"
# test you.com
curl "http://127.0.0.1:3000/ask?prompt=hello&model=you"
``` ```
request event-stream request event-stream
```shell ```shell
# test you # test default model chat.forefront.at
curl "http://127.0.0.1:3000/ask/stream?prompt=hello" curl "http://127.0.0.1:3000/ask/stream?prompt=hello"
# test forefront # test you
curl "http://127.0.0.1:3000/ask/stream?prompt=hello&model=forefront" curl "http://127.0.0.1:3000/ask/stream?prompt=hello&model=you"
``` ```
Due to legal and personal issues, the development speed of this Repository may slow down over the next one to two weeks. I apologize for any inconvenience this may cause. I have been putting a lot of effort into this small personal/educational project, and it is now on the verge of being taken down. Due to legal and personal issues, the development speed of this Repository may slow down over the next one to two weeks. I apologize for any inconvenience this may cause. I have been putting a lot of effort into this small personal/educational project, and it is now on the verge of being taken down.

ファイルの表示

@ -14,7 +14,7 @@ interface AskReq {
} }
router.get('/ask', async (ctx) => { router.get('/ask', async (ctx) => {
const {prompt, model = Model.You} = ctx.query as unknown as AskReq; const {prompt, model = Model.Forefront} = ctx.query as unknown as AskReq;
if (!prompt) { if (!prompt) {
ctx.body = 'please input prompt'; ctx.body = 'please input prompt';
return; return;
@ -29,7 +29,7 @@ router.get('/ask', async (ctx) => {
}); });
router.get('/ask/stream', async (ctx) => { router.get('/ask/stream', async (ctx) => {
const {prompt, model = Model.You} = ctx.query as unknown as AskReq; const {prompt, model = Model.Forefront} = ctx.query as unknown as AskReq;
if (!prompt) { if (!prompt) {
ctx.body = 'please input prompt'; ctx.body = 'please input prompt';
return; return;

ファイルの表示

@ -42,6 +42,12 @@ interface ForefrontSessionInfo {
userID: string; userID: string;
} }
export enum Action {
new = 'new',
continue = 'continue',
newGreeting = 'new:greeting',
}
export class Forefront extends Chat { export class Forefront extends Chat {
private client: AxiosInstance | undefined; private client: AxiosInstance | undefined;
private session: ForefrontSessionInfo | undefined; private session: ForefrontSessionInfo | undefined;