contentSecurity/internal/model/text.go
2025-10-15 17:01:31 +08:00

43 lines
1.2 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package model
// TextScanRequest 文本审核请求结构2.0版本)
type TextScanRequest struct {
Tasks []TextTask `json:"tasks"`
Services []string `json:"services"` // 2.0版本使用services而不是scenes
}
// TextTask 文本任务结构
type TextTask struct {
DataID string `json:"dataId"`
Content string `json:"content"`
}
// TextScanResponse 文本审核响应结构2.0版本)
type TextScanResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data []struct {
Code int `json:"code"`
Message string `json:"message"`
DataID string `json:"dataId"`
Results []struct {
Scene string `json:"scene"`
Label string `json:"label"`
Suggestion string `json:"suggestion"`
Rate float64 `json:"rate"`
// 2.0版本新增字段
SubLabel string `json:"subLabel,omitempty"` // 子标签
Details []TextDetail `json:"details,omitempty"` // 详细信息
Extras map[string]interface{} `json:"extras,omitempty"` // 扩展信息
} `json:"results"`
} `json:"data"`
}
// TextDetail 文本审核详细信息
type TextDetail struct {
Context struct {
Context string `json:"context"`
Pos []int `json:"pos"`
} `json:"context"`
}