Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chat ¶
type Chat struct {
// contains filtered or unexported fields
}
Chat handles interactions with LLM APIs (OpenAI, Azure OpenAI, Volc Deepseek V3)
func (*Chat) CodeReview ¶
CodeReview performs a code review on the given patch
type DirectLLMMessage ¶
type DirectLLMMessage = LLMMessage
type DirectLLMResponse ¶
type DirectLLMResponse = LLMResponse
type DirectLLMResponseFormat ¶
type DirectLLMResponseFormat = LLMResponseFormat
type LLMMessage ¶
LLMMessage 表示 LLM API 的消息
type LLMRequest ¶
type LLMRequest struct {
Model string `json:"model"`
Messages []LLMMessage `json:"messages"`
Temperature float32 `json:"temperature,omitempty"`
TopP float32 `json:"top_p,omitempty"`
MaxTokens int `json:"max_tokens,omitempty"`
ResponseFormat *LLMResponseFormat `json:"response_format,omitempty"`
}
LLMRequest 表示发送到 LLM API 的通用请求
type LLMResponse ¶
type LLMResponse struct {
ID string `json:"id"`
Object string `json:"object"`
Created int64 `json:"created"`
Model string `json:"model"`
Choices []struct {
Message struct {
Role string `json:"role"`
Content string `json:"content"`
} `json:"message"`
FinishReason string `json:"finish_reason"`
} `json:"choices"`
Usage struct {
PromptTokens int `json:"prompt_tokens"`
CompletionTokens int `json:"completion_tokens"`
TotalTokens int `json:"total_tokens"`
} `json:"usage"`
}
LLMResponse 表示从 LLM API 接收的通用响应
type LLMResponseFormat ¶
type LLMResponseFormat struct {
Type string `json:"type"`
}
LLMResponseFormat 表示 LLM API 的响应格式
type ReviewResult ¶
type ReviewResult struct {
LGTM bool `json:"lgtm"`
ReviewComment string `json:"review_comment"`
Summary string `json:"summary"` // 代码变更的总结
Suggestions string `json:"suggestions"` // 改进建议
Highlights string `json:"highlights"` // 代码亮点
Risks string `json:"risks"` // 潜在风险
}
ReviewResult represents the result of a code review
Click to show internal directories.
Click to hide internal directories.