Documentation
¶
Index ¶
- Constants
- func DefaultBaseURL(provider string) string
- func DefaultModelName(provider string) string
- func IsCustomPrompt(promptType PromptType) bool
- func LoadCustomPrompt(filePath, language string) (string, error)
- type Client
- func (c *Client) Close()
- func (c *Client) GenerateReport(commits []git.CommitInfo, fromDate, toDate time.Time) (string, error)
- func (c *Client) GenerateReportWithPrompt(commits []git.CommitInfo, fromDate, toDate time.Time, promptType PromptType) (string, error)
- func (c *Client) SummarizeCommits(commits []git.CommitInfo) (string, error)
- func (c *Client) SummarizeCommitsWithPrompt(commits []git.CommitInfo, promptType PromptType) (string, error)
- type ClientConfig
- type PromptType
Constants ¶
View Source
const ( ProviderOpenAI = "openai" ProviderGemini = "gemini" ProviderDeepSeek = "deepseek" DefaultProvider = ProviderGemini )
Variables ¶
This section is empty.
Functions ¶
func DefaultBaseURL ¶
DefaultBaseURL returns the default OpenAI-compatible endpoint for a provider.
func DefaultModelName ¶
DefaultModelName returns the default text model for a provider.
func IsCustomPrompt ¶
func IsCustomPrompt(promptType PromptType) bool
IsCustomPrompt 检查是否为自定义提示词(文件路径)
func LoadCustomPrompt ¶
LoadCustomPrompt 加载自定义提示词文件
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps an OpenAI-compatible chat completion client.
func NewClient ¶
func NewClient(cfg ClientConfig) (*Client, error)
func (*Client) GenerateReport ¶
func (*Client) GenerateReportWithPrompt ¶
func (c *Client) GenerateReportWithPrompt(commits []git.CommitInfo, fromDate, toDate time.Time, promptType PromptType) (string, error)
func (*Client) SummarizeCommits ¶
func (c *Client) SummarizeCommits(commits []git.CommitInfo) (string, error)
func (*Client) SummarizeCommitsWithPrompt ¶
func (c *Client) SummarizeCommitsWithPrompt(commits []git.CommitInfo, promptType PromptType) (string, error)
type ClientConfig ¶
type ClientConfig struct {
Provider string
BaseURL string
APIKey string
Model string
Language string
}
ClientConfig is the provider-neutral runtime config for the AI client.
func NormalizeClientConfig ¶
func NormalizeClientConfig(cfg ClientConfig, lookup func(string) string) (ClientConfig, error)
NormalizeClientConfig applies provider defaults and resolves env fallback values.
type PromptType ¶
type PromptType string
PromptType 表示不同类型的提示词
const ( // BasicPrompt 基础提示词:核心摘要 BasicPrompt PromptType = "basic" // ManagerUpdatePrompt 向上汇报提示词:强调进展、价值、风险和下一步 ManagerUpdatePrompt PromptType = "manager-update" // SelfReviewPrompt 自我复盘提示词:强调产出、经验和后续改进 SelfReviewPrompt PromptType = "self-review" // DetailedPrompt 中级提示词:详细且结构化的报告 DetailedPrompt PromptType = "detailed" // ReleaseNotesPrompt 发布说明提示词:强调新增、修复和改进 ReleaseNotesPrompt PromptType = "release-notes" )
func GetPromptTypeFromString ¶
func GetPromptTypeFromString(promptTypeStr string) PromptType
GetPromptTypeFromString 根据字符串返回对应的提示词类型
Click to show internal directories.
Click to hide internal directories.