mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-17 16:06:38 +08:00
feat: support dify agent
This commit is contained in:
parent
a6b6bcfe00
commit
fbce36238e
@ -53,7 +53,7 @@ func streamResponseDify2OpenAI(difyResponse DifyChunkChatCompletionResponse) *dt
|
|||||||
choice.Delta.SetContentString("Workflow: " + difyResponse.Data.WorkflowId + "\n")
|
choice.Delta.SetContentString("Workflow: " + difyResponse.Data.WorkflowId + "\n")
|
||||||
} else if constant.DifyDebug && difyResponse.Event == "node_started" {
|
} else if constant.DifyDebug && difyResponse.Event == "node_started" {
|
||||||
choice.Delta.SetContentString("Node: " + difyResponse.Data.NodeId + "\n")
|
choice.Delta.SetContentString("Node: " + difyResponse.Data.NodeId + "\n")
|
||||||
} else if difyResponse.Event == "message" {
|
} else if difyResponse.Event == "message" || difyResponse.Event == "agent_message" {
|
||||||
choice.Delta.SetContentString(difyResponse.Answer)
|
choice.Delta.SetContentString(difyResponse.Answer)
|
||||||
}
|
}
|
||||||
response.Choices = append(response.Choices, choice)
|
response.Choices = append(response.Choices, choice)
|
||||||
|
Loading…
Reference in New Issue
Block a user