Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AIClient ¶
type AIClient interface {
GetCommitMessage(ctx context.Context, prompt string) (string, error)
SanitizeResponse(message, commitType string) string
ProviderName() string
MaybeSummarizeDiff(diff string, maxLength int) (string, bool)
}
AIClient defines the interface for AI providers.
type BaseAIClient ¶
type BaseAIClient struct {
Provider string
}
func (*BaseAIClient) MaybeSummarizeDiff ¶
func (b *BaseAIClient) MaybeSummarizeDiff(diff string, maxLength int) (string, bool)
func (*BaseAIClient) ProviderName ¶
func (b *BaseAIClient) ProviderName() string
func (*BaseAIClient) SanitizeResponse ¶
func (b *BaseAIClient) SanitizeResponse(message, commitType string) string
type StreamingAIClient ¶ added in v0.9.0
type StreamingAIClient interface {
StreamCommitMessage(ctx context.Context, prompt string, onDelta func(delta string)) (final string, err error)
}
StreamingAIClient is an optional interface that providers can implement to stream text deltas while generating the message. Implementations should call onDelta with incremental text (may be per-token or per-chunk) and return the final full text when the stream finishes.
Click to show internal directories.
Click to hide internal directories.