Skip to content

Commit f6552d0

Browse files
authored
v4.4.5-2 (#355)
1 parent 38d4db5 commit f6552d0

File tree

48 files changed

+535
-398
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+535
-398
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: '升级到 V4.4.5'
3+
description: 'FastGPT 从旧版本升级到 V4.4.5 操作指南'
4+
icon: 'upgrade'
5+
draft: false
6+
toc: true
7+
weight: 992
8+
---
9+
10+
## 执行初始化 API
11+
12+
发起 1 个 HTTP 请求(记得携带 `headers.rootkey`,这个值是环境变量里的)
13+
14+
1. https://xxxxx/api/admin/initv445
15+
16+
```bash
17+
curl --location --request POST 'https://{{host}}/api/admin/initv445' \
18+
--header 'rootkey: {{rootkey}}' \
19+
--header 'Content-Type: application/json'
20+
```
21+
22+
初始化了 variable 模块,将其合并到用户引导模块中。
23+

projects/app/src/service/lib/openai.ts renamed to packages/core/aiApi/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { UserModelSchema } from '@/types/mongoSchema';
1+
import { UserModelSchema } from '../user/type';
22
import { Configuration, OpenAIApi } from 'openai';
33

44
export const openaiBaseUrl = process.env.OPENAI_BASE_URL || 'https://api.openai.com/v1';

packages/core/aiApi/constant.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { ChatCompletionRequestMessageRoleEnum } from 'openai';

packages/core/aiApi/type.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export type { CreateChatCompletionRequest, ChatCompletionRequestMessage } from 'openai';

packages/core/init.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import tunnel from 'tunnel';
2+
3+
export function initHttpAgent() {
4+
// proxy obj
5+
if (process.env.AXIOS_PROXY_HOST && process.env.AXIOS_PROXY_PORT) {
6+
global.httpsAgent = tunnel.httpsOverHttp({
7+
proxy: {
8+
host: process.env.AXIOS_PROXY_HOST,
9+
port: +process.env.AXIOS_PROXY_PORT
10+
}
11+
});
12+
}
13+
}

packages/core/package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
{
22
"name": "@fastgpt/core",
3-
"version": "1.0.0"
3+
"version": "1.0.0",
4+
"dependencies": {
5+
"openai": "^3.3.0",
6+
"tunnel": "^0.0.6"
7+
},
8+
"devDependencies": {
9+
"@types/tunnel": "^0.0.4"
10+
}
411
}

packages/core/types/index.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import type { Agent } from 'http';
2+
3+
declare global {
4+
var httpsAgent: Agent;
5+
}

packages/core/user/type.d.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
export type UserModelSchema = {
2+
_id: string;
3+
username: string;
4+
password: string;
5+
avatar: string;
6+
balance: number;
7+
promotionRate: number;
8+
inviterId?: string;
9+
openaiKey: string;
10+
createTime: number;
11+
timezone: string;
12+
openaiAccount?: {
13+
key: string;
14+
baseUrl: string;
15+
};
16+
limit: {
17+
exportKbTime?: Date;
18+
};
19+
};

pnpm-lock.yaml

Lines changed: 15 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

projects/app/package.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
"@chakra-ui/system": "^2.5.8",
1515
"@emotion/react": "^11.10.6",
1616
"@emotion/styled": "^11.10.6",
17+
"@fastgpt/common": "workspace:*",
18+
"@fastgpt/core": "workspace:*",
19+
"@fastgpt/support": "workspace:*",
1720
"@mozilla/readability": "^0.4.4",
1821
"@tanstack/react-query": "^4.24.10",
1922
"@types/nprogress": "^0.2.0",
@@ -45,7 +48,6 @@
4548
"next-i18next": "^14.0.3",
4649
"nextjs-cors": "^2.1.2",
4750
"nprogress": "^0.2.0",
48-
"openai": "^3.3.0",
4951
"papaparse": "^5.4.1",
5052
"pg": "^8.10.0",
5153
"pg-query-stream": "^4.5.3",
@@ -64,13 +66,9 @@
6466
"request-ip": "^3.3.0",
6567
"sass": "^1.58.3",
6668
"timezones-list": "^3.0.2",
67-
"tunnel": "^0.0.6",
6869
"winston": "^3.10.0",
6970
"winston-mongodb": "^5.1.1",
70-
"zustand": "^4.3.5",
71-
"@fastgpt/support": "workspace:*",
72-
"@fastgpt/common": "workspace:*",
73-
"@fastgpt/core": "workspace:*"
71+
"zustand": "^4.3.5"
7472
},
7573
"devDependencies": {
7674
"@svgr/webpack": "^6.5.1",
@@ -89,7 +87,6 @@
8987
"@types/react-dom": "18.0.11",
9088
"@types/react-syntax-highlighter": "^15.5.6",
9189
"@types/request-ip": "^0.0.37",
92-
"@types/tunnel": "^0.0.3",
9390
"eslint": "8.34.0",
9491
"eslint-config-next": "13.1.6",
9592
"typescript": "4.9.5"

0 commit comments

Comments
 (0)