Skip to content

Commit dc7ce7b

Browse files
bincooobincooo
bincooo
authored and
bincooo
committed
feat(bing): AI绘图适配
1 parent 43b155a commit dc7ce7b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

relay/llm/bing/message.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,17 @@ func waitResponse(ctx *gin.Context, message chan []byte, sse bool) (content stri
9292
continue
9393
}
9494

95-
if !msg.Is("event", "appendText") {
95+
raw := ""
96+
if msg.Is("event", "appendText") {
97+
raw = msg.GetString("text")
98+
}
99+
if msg.Is("event", "imageGenerated") {
100+
raw = fmt.Sprintf("![image](%s)", msg.GetString("url"))
101+
}
102+
if len(raw) == 0 {
96103
continue
97104
}
98105

99-
raw := msg.GetString("text")
100106
logger.Debug("----- raw -----")
101107
logger.Debug(raw)
102108

0 commit comments

Comments
 (0)