Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Info embed.FS
Functions ¶
This section is empty.
Types ¶
type ContentFilterError ¶
ContentFilterError indicates that GLM detected unsafe content in the input
func (*ContentFilterError) Error ¶
func (e *ContentFilterError) Error() string
type GLMRequest ¶
type GLMResponse ¶
type GLMResponse struct {
Choices []struct {
Message struct {
Content string `json:"content"`
} `json:"message"`
} `json:"choices"`
Error *struct {
Message string `json:"message"`
Code string `json:"code"`
} `json:"error,omitempty"`
ContentFilter []struct {
Level int `json:"level"`
Role string `json:"role"`
} `json:"contentFilter,omitempty"`
}
type Reviewer ¶
type Reviewer struct {
Config *ReviewerConfig
}
func (*Reviewer) ConfigFields ¶
func (r *Reviewer) ConfigFields() []plugin.ConfigField
func (*Reviewer) ConfigReceiver ¶
func (*Reviewer) Review ¶
func (r *Reviewer) Review(content *plugin.ReviewContent) (result *plugin.ReviewResult)
func (*Reviewer) TestConnection ¶
TestConnection tests the GLM API connection
type ReviewerConfig ¶
type ReviewerConfig struct {
APIKey string `json:"api_key"`
ReviewQuestion bool `json:"review_question"`
ReviewAnswer bool `json:"review_answer"`
ReviewComment bool `json:"review_comment"`
SpamFiltering string `json:"spam_filtering"`
APITimeout int `json:"api_timeout"` // Timeout in seconds
MaxContentLength int `json:"max_content_length"` // Maximum content length in characters
CacheTTL int `json:"cache_ttl"` // Cache TTL in minutes
CacheMaxSize int `json:"cache_max_size"` // Maximum cache entries
RateLimitRPS int `json:"rate_limit_rps"` // Rate limit requests per second
MaxRetries int `json:"max_retries"` // Maximum retry attempts
}
Click to show internal directories.
Click to hide internal directories.