llm

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	// GeneratePullRequestSpec calls the LLM to generate PR details
	GeneratePullRequestSpec(ctx context.Context, llmCommand string, promptParams map[string]interface{}, diffContent string, commitHistoryContent string, otherContext map[string]string) (string, error)
	// CountTokens calls the LLM's token counter for given text
	CountTokens(ctx context.Context, llmCommand string, textContent string) (int, error)
}

Adapter defines the interface for LLM operations

type MockAdapter

type MockAdapter struct {
	MockYAMLOutput string
	MockTokenCount int
	MockError      error
}

MockAdapter provides a mock implementation for testing

func NewMockAdapter

func NewMockAdapter() *MockAdapter

NewMockAdapter creates a new mock adapter with sample data

func (*MockAdapter) CountTokens

func (m *MockAdapter) CountTokens(ctx context.Context, llmCommand string, textContent string) (int, error)

CountTokens implements the Adapter interface with mock data

func (*MockAdapter) GeneratePullRequestSpec

func (m *MockAdapter) GeneratePullRequestSpec(ctx context.Context, llmCommand string, promptParams map[string]interface{}, diffContent string, commitHistoryContent string, otherContext map[string]string) (string, error)

GeneratePullRequestSpec implements the Adapter interface with mock data

type PinocchioAdapter

type PinocchioAdapter struct{}

PinocchioAdapter provides an implementation that calls pinocchio

func NewPinocchioAdapter

func NewPinocchioAdapter() *PinocchioAdapter

NewPinocchioAdapter creates a new adapter for pinocchio

func (*PinocchioAdapter) CountTokens

func (a *PinocchioAdapter) CountTokens(ctx context.Context, llmCommand string, textContent string) (int, error)

CountTokens implements the Adapter interface

func (*PinocchioAdapter) GeneratePullRequestSpec

func (a *PinocchioAdapter) GeneratePullRequestSpec(ctx context.Context, llmCommand string, promptParams map[string]interface{}, diffContent string, commitHistoryContent string, otherContext map[string]string) (string, error)

GeneratePullRequestSpec implements the Adapter interface

Jump to

Keyboard shortcuts

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