File tree Expand file tree Collapse file tree 7 files changed +72
-6
lines changed
components/core/module/Flow/components/nodes
service/moduleDispatch/agent Expand file tree Collapse file tree 7 files changed +72
-6
lines changed Original file line number Diff line number Diff line change @@ -7,3 +7,24 @@ export const InformTypeMap = {
7
7
label : '系统通知'
8
8
}
9
9
} ;
10
+
11
+ export enum TeamMemberRoleEnum {
12
+ owner = 'owner' ,
13
+ admin = 'admin' ,
14
+ member = 'member' ,
15
+ visitor = 'visitor'
16
+ }
17
+ export const TeamMemberRoleMap = {
18
+ [ TeamMemberRoleEnum . owner ] : {
19
+ label : 'user.team.role.owner'
20
+ } ,
21
+ [ TeamMemberRoleEnum . admin ] : {
22
+ label : 'user.team.role.admin'
23
+ } ,
24
+ [ TeamMemberRoleEnum . member ] : {
25
+ label : 'user.team.role.member'
26
+ } ,
27
+ [ TeamMemberRoleEnum . visitor ] : {
28
+ label : 'user.team.role.visitor'
29
+ }
30
+ } ;
Original file line number Diff line number Diff line change
1
+ export type CreateTeamProps = {
2
+ ownerId : string ;
3
+ name : string ;
4
+ avatar ?: string ;
5
+ } ;
6
+ export type UpdateTeamProps = {
7
+ id : string ;
8
+ name ?: string ;
9
+ avatar ?: string ;
10
+ } ;
11
+ export type updateTeamBalanceProps = {
12
+ id : string ;
13
+ balance : number ;
14
+ } ;
15
+
16
+ export type CreateTeamMemberProps = {
17
+ ownerId : string ;
18
+ teamId : string ;
19
+ userId : string ;
20
+ name ?: string ;
21
+ } ;
Original file line number Diff line number Diff line change 1
- import { InformTypeEnum } from './constant' ;
1
+ import { InformTypeEnum , TeamMemberRoleEnum } from './constant' ;
2
2
3
3
export type UserModelSchema = {
4
4
_id : string ;
@@ -30,3 +30,19 @@ export type UserInformSchema = {
30
30
content : string ;
31
31
read : boolean ;
32
32
} ;
33
+
34
+ export type TeamSchema = {
35
+ _id : string ;
36
+ name : string ;
37
+ ownerId : string ;
38
+ avatar : string ;
39
+ createTime : Date ;
40
+ } ;
41
+
42
+ export type TeamMemberSchema = {
43
+ _id : string ;
44
+ name : string ;
45
+ teamId : string ;
46
+ userId : string ;
47
+ role : `${TeamMemberRoleEnum } `;
48
+ } ;
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ import { hashStr } from '@fastgpt/global/common/string/tools';
4
4
import { PRICE_SCALE } from '@fastgpt/global/common/bill/constants' ;
5
5
import type { UserModelSchema } from '@fastgpt/global/support/user/type' ;
6
6
7
+ export const userCollectionName = 'users' ;
8
+
7
9
const UserSchema = new Schema ( {
8
10
username : {
9
11
// 可以是手机/邮箱,新的验证都只用手机
@@ -60,4 +62,5 @@ const UserSchema = new Schema({
60
62
}
61
63
} ) ;
62
64
63
- export const MongoUser : Model < UserModelSchema > = models [ 'user' ] || model ( 'user' , UserSchema ) ;
65
+ export const MongoUser : Model < UserModelSchema > =
66
+ models [ userCollectionName ] || model ( userCollectionName , UserSchema ) ;
Original file line number Diff line number Diff line change @@ -121,14 +121,13 @@ const NodeCQNode = ({ data }: NodeProps<FlowModuleItemType>) => {
121
121
122
122
onChangeNode ( {
123
123
moduleId,
124
- type : 'updateOutput' ,
125
- key : agentKey ,
126
- value : outputs . concat ( {
124
+ type : 'addOutput' ,
125
+ value : {
127
126
key,
128
127
label : '' ,
129
128
type : FlowNodeOutputTypeEnum . hidden ,
130
129
targets : [ ]
131
- } )
130
+ }
132
131
} ) ;
133
132
} }
134
133
>
Original file line number Diff line number Diff line change @@ -127,6 +127,9 @@ ${systemPrompt}
127
127
tokens : response . usage ?. total_tokens || 0
128
128
} ;
129
129
} catch ( error ) {
130
+ console . log ( agentFunction . parameters ) ;
131
+ console . log ( response . choices ?. [ 0 ] ?. message ) ;
132
+
130
133
console . log ( 'Your model may not support function_call' , error ) ;
131
134
132
135
return {
Original file line number Diff line number Diff line change @@ -141,6 +141,9 @@ async function functionCall({
141
141
try {
142
142
return JSON . parse ( response . choices ?. [ 0 ] ?. message ?. function_call ?. arguments || '{}' ) ;
143
143
} catch ( error ) {
144
+ console . log ( agentFunction . parameters ) ;
145
+ console . log ( response . choices ?. [ 0 ] ?. message ) ;
146
+ console . log ( 'Your model may not support function_call' , error ) ;
144
147
return { } ;
145
148
}
146
149
} ) ( ) ;
You can’t perform that action at this time.
0 commit comments