49 lines
1.0 KiB
Go
49 lines
1.0 KiB
Go
|
|
package tencent
|
||
|
|
|
||
|
|
type Config struct {
|
||
|
|
Enabled bool
|
||
|
|
SecretID string
|
||
|
|
SecretKey string
|
||
|
|
Region string
|
||
|
|
BizType string
|
||
|
|
Timeout int
|
||
|
|
}
|
||
|
|
|
||
|
|
type ModerationSuggestion string
|
||
|
|
|
||
|
|
const (
|
||
|
|
SuggestionPass ModerationSuggestion = "Pass"
|
||
|
|
SuggestionReview ModerationSuggestion = "Review"
|
||
|
|
SuggestionBlock ModerationSuggestion = "Block"
|
||
|
|
)
|
||
|
|
|
||
|
|
type ModerationResponse struct {
|
||
|
|
Suggestion ModerationSuggestion
|
||
|
|
Label string
|
||
|
|
RiskLevel string
|
||
|
|
Keywords []string
|
||
|
|
RequestID string
|
||
|
|
}
|
||
|
|
|
||
|
|
type textModerationRequest struct {
|
||
|
|
Content string `json:"Content"`
|
||
|
|
BizType string `json:"BizType,omitempty"`
|
||
|
|
}
|
||
|
|
|
||
|
|
type tencentAPIResponse struct {
|
||
|
|
Response struct {
|
||
|
|
Suggestion string `json:"Suggestion"`
|
||
|
|
Label string `json:"Label"`
|
||
|
|
RiskLevel string `json:"RiskLevel"`
|
||
|
|
Keywords []struct {
|
||
|
|
Word string `json:"Word"`
|
||
|
|
} `json:"Keywords,omitempty"`
|
||
|
|
RequestID string `json:"RequestId"`
|
||
|
|
Error *struct {
|
||
|
|
Code string `json:"Code"`
|
||
|
|
Message string `json:"Message"`
|
||
|
|
} `json:"Error,omitempty"`
|
||
|
|
} `json:"Response"`
|
||
|
|
}
|
||
|
|
|