Skip to content

Commit

Permalink
feat: change default model to forefront
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangsx committed May 6, 2023
1 parent 1938c0c commit 875aa64
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions model/forefront/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 875aa64

Please sign in to comment.