From 875aa6427538960ff5dfb70ef65f3f10e5f5b90b Mon Sep 17 00:00:00 2001 From: xiang <1984871009@qq.com> Date: Sat, 6 May 2023 16:48:48 +0800 Subject: [PATCH] feat: change default model to forefront --- README.md | 15 +++++++++------ index.ts | 4 ++-- model/forefront/index.ts | 6 ++++++ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 08c8b42..ab02007 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ This is a replication project for the typescript version of [gpt4free](https://g Still striving to keep updating. Have implemented models here: -- [x] you.com GPT-3.5 / Internet / good search -- [x] forefront.ai GPT-4/3.5 +- [x] you.com GPT-3.5 / Internet / good search **not active** +- [x] forefront.ai GPT-4/3.5 **still active** - [ ] poe.com GPT-4/3.5 - [ ] writesonic.com GPT-3.5 / Internet - [ ] t3nsor.com GPT-3.5 @@ -41,17 +41,20 @@ docker-compose up --build -d common request ```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&model=forefront" + +# test you.com +curl "http://127.0.0.1:3000/ask?prompt=hello&model=you" ``` request event-stream ```shell -# test you +# test default model chat.forefront.at curl "http://127.0.0.1:3000/ask/stream?prompt=hello" -# test forefront -curl "http://127.0.0.1:3000/ask/stream?prompt=hello&model=forefront" +# test you +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. diff --git a/index.ts b/index.ts index 6a5ab10..03b78e5 100644 --- a/index.ts +++ b/index.ts @@ -14,7 +14,7 @@ interface AskReq { } 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) { ctx.body = 'please input prompt'; return; @@ -29,7 +29,7 @@ router.get('/ask', 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) { ctx.body = 'please input prompt'; return; diff --git a/model/forefront/index.ts b/model/forefront/index.ts index e3e4487..ca47e57 100644 --- a/model/forefront/index.ts +++ b/model/forefront/index.ts @@ -42,6 +42,12 @@ interface ForefrontSessionInfo { userID: string; } +export enum Action { + new = 'new', + continue = 'continue', + newGreeting = 'new:greeting', +} + export class Forefront extends Chat { private client: AxiosInstance | undefined; private session: ForefrontSessionInfo | undefined;