Documentation
¶
Index ¶
- Variables
- func GenerateSchema[T any]() interface{}
- type CommitMessageResponse
- type HistoryAnalysisResponse
- type OllamaClient
- func (c *OllamaClient) AnalyzeHistory(ctx context.Context, diff string, history string) (*HistoryAnalysisResponse, error)
- func (c *OllamaClient) GenerateCommitMessage(ctx context.Context, diff string, history string, answers map[string]string) (string, error)
- func (c *OllamaClient) GenerateQuestions(ctx context.Context, diff string, history string) ([]string, error)
- type OpenAIClient
- func (c *OpenAIClient) AnalyzeHistory(ctx context.Context, diff string, history string) (*HistoryAnalysisResponse, error)
- func (c *OpenAIClient) GenerateCommitMessage(ctx context.Context, diff string, history string, answers map[string]string) (string, error)
- func (c *OpenAIClient) GenerateQuestions(ctx context.Context, diff string, history string) ([]string, error)
- type Provider
- type QuestionsResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var CommitMessageResponseSchema = GenerateSchema[CommitMessageResponse]()
Generate the JSON schema at initialization time
View Source
var HistoryAnalysisResponseSchema = GenerateSchema[HistoryAnalysisResponse]()
Generate the JSON schema at initialization time
View Source
var QuestionsResponseSchema = GenerateSchema[QuestionsResponse]()
Generate the JSON schema at initialization time
Functions ¶
func GenerateSchema ¶
func GenerateSchema[T any]() interface{}
GenerateSchema creates a JSON schema for a given type T. This is used for OpenAI Structured Outputs.
Types ¶
type CommitMessageResponse ¶
type HistoryAnalysisResponse ¶
type OllamaClient ¶
type OllamaClient struct {
// contains filtered or unexported fields
}
func NewOllamaClient ¶
func NewOllamaClient(baseURL, model string) *OllamaClient
func (*OllamaClient) AnalyzeHistory ¶
func (c *OllamaClient) AnalyzeHistory(ctx context.Context, diff string, history string) (*HistoryAnalysisResponse, error)
func (*OllamaClient) GenerateCommitMessage ¶
func (*OllamaClient) GenerateQuestions ¶
type OpenAIClient ¶
type OpenAIClient struct {
// contains filtered or unexported fields
}
func NewOpenAIClient ¶
func NewOpenAIClient(apiKey string) *OpenAIClient
func (*OpenAIClient) AnalyzeHistory ¶
func (c *OpenAIClient) AnalyzeHistory(ctx context.Context, diff string, history string) (*HistoryAnalysisResponse, error)
func (*OpenAIClient) GenerateCommitMessage ¶
func (*OpenAIClient) GenerateQuestions ¶
type Provider ¶
type Provider interface {
GenerateQuestions(ctx context.Context, diff string, history string) ([]string, error)
GenerateCommitMessage(ctx context.Context, diff string, history string, answers map[string]string) (string, error)
AnalyzeHistory(ctx context.Context, diff string, history string) (*HistoryAnalysisResponse, error)
}
Provider defines the interface for AI providers.
type QuestionsResponse ¶
type QuestionsResponse struct {
Questions []string `` /* 147-byte string literal not displayed */
}
Click to show internal directories.
Click to hide internal directories.