ai

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildConventionalCommitPrompt

func BuildConventionalCommitPrompt() string

func GeneratePrompt

func GeneratePrompt(language string) string

func ListAgentTypes

func ListAgentTypes() []string

Types

type Agent

type Agent interface {
	GenerateCommitMessage(ctx context.Context, diff, language string) (string, error)
}

func NewAgent

func NewAgent(agentType string, opts ...Option) (Agent, error)

type AgentFactory

type AgentFactory func(*config.Config) Agent

type AgentType

type AgentType string
const (
	AgentTypeOpenAI AgentType = "openai"
	AgentTypeGemini AgentType = "gemini"
)

func (AgentType) IsValid

func (a AgentType) IsValid() bool

func (AgentType) String

func (a AgentType) String() string

type GeminiClient added in v0.1.1

type GeminiClient struct {
	// contains filtered or unexported fields
}

func NewGeminiClient added in v0.1.1

func NewGeminiClient(apiKey string) *GeminiClient

func (*GeminiClient) GenerateCommitMessage added in v0.1.1

func (c *GeminiClient) GenerateCommitMessage(ctx context.Context, diff, language string) (string, error)

type OpenAIClient

type OpenAIClient struct {
	// contains filtered or unexported fields
}

func NewOpenAIClient

func NewOpenAIClient(apiKey string) *OpenAIClient

func (*OpenAIClient) GenerateCommitMessage

func (c *OpenAIClient) GenerateCommitMessage(ctx context.Context, diff, language string) (string, error)

type Option

type Option func(*config.Config)

func WithAPIKey

func WithAPIKey(apiKey string) Option

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL