feat: change default model to forefront
このコミットが含まれているのは:
コミット
875aa64275
15
README.md
15
README.md
|
@ -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.
|
||||||
|
|
4
index.ts
4
index.ts
|
@ -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;
|
||||||
|
|
読み込み中…
新しいイシューから参照