Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
661ee799
authored
Oct 30, 2023
by
Archer
Committed by
GitHub
Oct 30, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: CQ module output (#445)
parent
60ee1601
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
72 additions
and
6 deletions
+72
-6
packages/global/support/user/constant.ts
+21
-0
packages/global/support/user/controller.d.ts
+21
-0
packages/global/support/user/type.d.ts
+17
-1
packages/service/support/user/schema.ts
+4
-1
projects/app/src/components/core/module/Flow/components/nodes/NodeCQNode.tsx
+3
-4
projects/app/src/service/moduleDispatch/agent/classifyQuestion.ts
+3
-0
projects/app/src/service/moduleDispatch/agent/extract.ts
+3
-0
No files found.
packages/global/support/user/constant.ts
View file @
661ee799
...
@@ -7,3 +7,24 @@ export const InformTypeMap = {
...
@@ -7,3 +7,24 @@ export const InformTypeMap = {
label
:
'系统通知'
label
:
'系统通知'
}
}
};
};
export
enum
TeamMemberRoleEnum
{
owner
=
'owner'
,
admin
=
'admin'
,
member
=
'member'
,
visitor
=
'visitor'
}
export
const
TeamMemberRoleMap
=
{
[
TeamMemberRoleEnum
.
owner
]:
{
label
:
'user.team.role.owner'
},
[
TeamMemberRoleEnum
.
admin
]:
{
label
:
'user.team.role.admin'
},
[
TeamMemberRoleEnum
.
member
]:
{
label
:
'user.team.role.member'
},
[
TeamMemberRoleEnum
.
visitor
]:
{
label
:
'user.team.role.visitor'
}
};
packages/global/support/user/controller.d.ts
0 → 100644
View file @
661ee799
export
type
CreateTeamProps
=
{
ownerId
:
string
;
name
:
string
;
avatar
?:
string
;
};
export
type
UpdateTeamProps
=
{
id
:
string
;
name
?:
string
;
avatar
?:
string
;
};
export
type
updateTeamBalanceProps
=
{
id
:
string
;
balance
:
number
;
};
export
type
CreateTeamMemberProps
=
{
ownerId
:
string
;
teamId
:
string
;
userId
:
string
;
name
?:
string
;
};
packages/global/support/user/type.d.ts
View file @
661ee799
import
{
InformTypeEnum
}
from
'./constant'
;
import
{
InformTypeEnum
,
TeamMemberRoleEnum
}
from
'./constant'
;
export
type
UserModelSchema
=
{
export
type
UserModelSchema
=
{
_id
:
string
;
_id
:
string
;
...
@@ -30,3 +30,19 @@ export type UserInformSchema = {
...
@@ -30,3 +30,19 @@ export type UserInformSchema = {
content
:
string
;
content
:
string
;
read
:
boolean
;
read
:
boolean
;
};
};
export
type
TeamSchema
=
{
_id
:
string
;
name
:
string
;
ownerId
:
string
;
avatar
:
string
;
createTime
:
Date
;
};
export
type
TeamMemberSchema
=
{
_id
:
string
;
name
:
string
;
teamId
:
string
;
userId
:
string
;
role
:
`
${
TeamMemberRoleEnum
}
`
;
};
packages/service/support/user/schema.ts
View file @
661ee799
...
@@ -4,6 +4,8 @@ import { hashStr } from '@fastgpt/global/common/string/tools';
...
@@ -4,6 +4,8 @@ import { hashStr } from '@fastgpt/global/common/string/tools';
import
{
PRICE_SCALE
}
from
'@fastgpt/global/common/bill/constants'
;
import
{
PRICE_SCALE
}
from
'@fastgpt/global/common/bill/constants'
;
import
type
{
UserModelSchema
}
from
'@fastgpt/global/support/user/type'
;
import
type
{
UserModelSchema
}
from
'@fastgpt/global/support/user/type'
;
export
const
userCollectionName
=
'users'
;
const
UserSchema
=
new
Schema
({
const
UserSchema
=
new
Schema
({
username
:
{
username
:
{
// 可以是手机/邮箱,新的验证都只用手机
// 可以是手机/邮箱,新的验证都只用手机
...
@@ -60,4 +62,5 @@ const UserSchema = new Schema({
...
@@ -60,4 +62,5 @@ const UserSchema = new Schema({
}
}
});
});
export
const
MongoUser
:
Model
<
UserModelSchema
>
=
models
[
'user'
]
||
model
(
'user'
,
UserSchema
);
export
const
MongoUser
:
Model
<
UserModelSchema
>
=
models
[
userCollectionName
]
||
model
(
userCollectionName
,
UserSchema
);
projects/app/src/components/core/module/Flow/components/nodes/NodeCQNode.tsx
View file @
661ee799
...
@@ -121,14 +121,13 @@ const NodeCQNode = ({ data }: NodeProps<FlowModuleItemType>) => {
...
@@ -121,14 +121,13 @@ const NodeCQNode = ({ data }: NodeProps<FlowModuleItemType>) => {
onChangeNode
({
onChangeNode
({
moduleId
,
moduleId
,
type
:
'updateOutput'
,
type
:
'addOutput'
,
key
:
agentKey
,
value
:
{
value
:
outputs
.
concat
({
key
,
key
,
label
:
''
,
label
:
''
,
type
:
FlowNodeOutputTypeEnum
.
hidden
,
type
:
FlowNodeOutputTypeEnum
.
hidden
,
targets
:
[]
targets
:
[]
}
)
}
});
});
}
}
}
}
>
>
...
...
projects/app/src/service/moduleDispatch/agent/classifyQuestion.ts
View file @
661ee799
...
@@ -127,6 +127,9 @@ ${systemPrompt}
...
@@ -127,6 +127,9 @@ ${systemPrompt}
tokens
:
response
.
usage
?.
total_tokens
||
0
tokens
:
response
.
usage
?.
total_tokens
||
0
};
};
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
agentFunction
.
parameters
);
console
.
log
(
response
.
choices
?.[
0
]?.
message
);
console
.
log
(
'Your model may not support function_call'
,
error
);
console
.
log
(
'Your model may not support function_call'
,
error
);
return
{
return
{
...
...
projects/app/src/service/moduleDispatch/agent/extract.ts
View file @
661ee799
...
@@ -141,6 +141,9 @@ async function functionCall({
...
@@ -141,6 +141,9 @@ async function functionCall({
try
{
try
{
return
JSON
.
parse
(
response
.
choices
?.[
0
]?.
message
?.
function_call
?.
arguments
||
'{}'
);
return
JSON
.
parse
(
response
.
choices
?.[
0
]?.
message
?.
function_call
?.
arguments
||
'{}'
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
agentFunction
.
parameters
);
console
.
log
(
response
.
choices
?.[
0
]?.
message
);
console
.
log
(
'Your model may not support function_call'
,
error
);
return
{};
return
{};
}
}
})();
})();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment