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
2f7427e1
authored
Feb 26, 2026
by
Archer
Committed by
GitHub
Feb 26, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: sse response (#6468)
parent
2fd4b603
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
packages/service/core/workflow/dispatch/type.ts
+3
-1
projects/app/src/pages/api/v1/chat/completions.ts
+4
-3
No files found.
packages/service/core/workflow/dispatch/type.ts
View file @
2f7427e1
...
@@ -49,7 +49,9 @@ const WorkflowResponseItemSchema = z.object({
...
@@ -49,7 +49,9 @@ const WorkflowResponseItemSchema = z.object({
id
:
z
.
string
().
optional
(),
id
:
z
.
string
().
optional
(),
stepId
:
z
.
string
().
optional
(),
stepId
:
z
.
string
().
optional
(),
event
:
z
.
custom
<
SseResponseEventEnum
>
(),
event
:
z
.
custom
<
SseResponseEventEnum
>
(),
data
:
z
.
record
(
z
.
string
(),
z
.
any
())
data
:
z
.
custom
<
Record
<
string
,
any
>
&
{
length
?:
never
}
>
(
(
val
)
=>
typeof
val
===
'object'
&&
val
!==
null
&&
!
Array
.
isArray
(
val
)
)
});
});
export
type
WorkflowResponseItemType
=
z
.
infer
<
typeof
WorkflowResponseItemSchema
>
;
export
type
WorkflowResponseItemType
=
z
.
infer
<
typeof
WorkflowResponseItemSchema
>
;
export
const
WorkflowResponseFnSchema
=
z
.
function
({
export
const
WorkflowResponseFnSchema
=
z
.
function
({
...
...
projects/app/src/pages/api/v1/chat/completions.ts
View file @
2f7427e1
...
@@ -398,7 +398,6 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
...
@@ -398,7 +398,6 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
const
feResponseData
=
responseAllData
const
feResponseData
=
responseAllData
?
flowResponses
?
flowResponses
:
filterPublicNodeResponseData
({
nodeRespones
:
flowResponses
,
responseDetail
:
showCite
});
:
filterPublicNodeResponseData
({
nodeRespones
:
flowResponses
,
responseDetail
:
showCite
});
if
(
stream
)
{
if
(
stream
)
{
workflowResponseWrite
({
workflowResponseWrite
({
event
:
SseResponseEventEnum
.
answer
,
event
:
SseResponseEventEnum
.
answer
,
...
@@ -413,10 +412,12 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
...
@@ -413,10 +412,12 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
data
:
'[DONE]'
data
:
'[DONE]'
});
});
// 特殊输配(data 不是{})
if
(
detail
)
{
if
(
detail
)
{
workflowResponseWrite
({
responseWrite
({
res
,
event
:
SseResponseEventEnum
.
flowResponses
,
event
:
SseResponseEventEnum
.
flowResponses
,
data
:
feResponseData
data
:
JSON
.
stringify
(
feResponseData
)
});
});
}
}
...
...
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