feat: 增加sse支持
This commit is contained in:
@@ -139,3 +139,13 @@ type ResponseOption struct {
|
||||
Extension map[string]any `json:"extension"` // 扩展数据
|
||||
XmlName string `json:"xml_name"` // 以xml文件格式响应数据时, Xml文件名(根节点)
|
||||
}
|
||||
|
||||
type SseData struct {
|
||||
ID string `json:"id"` // 响应数据 ID
|
||||
Object string `json:"object"` // 响应数据对象类型
|
||||
Created int64 `json:"created"` // 创建时间, 秒级时间戳
|
||||
Choices []map[string]any `json:"choices"` // choice 列表
|
||||
EventType string `json:"event_type"` // 事件类型
|
||||
}
|
||||
|
||||
const SseMsgFormat = "id:%v\nevent:%v\ndata:%v\n\n"
|
||||
|
||||
Reference in New Issue
Block a user