Documentation
¶
Index ¶
- Constants
- func CheckFunc(x Kontext) func(*cli.Context) error
- func CheckUrfaveCommand(x Kontext) *cli.Command
- func DefaultConfigDir() string
- func DefaultConfigMap() map[string]any
- func ExtractFixedCode(input string) (string, string)
- func ExtractTestCode(input string) (string, string)
- func ListFunc(x Kontext) func(*cli.Context) error
- func ListUrfaveCommand(x Kontext) *cli.Command
- func LoadAngineerEnv(fs afero.Fs)
- func ResolveCheckReportFile(cacheDir string, repository string, file string) string
- func ResolveOriginalCodeFile(cacheDir string, repository string, file string) string
- func ResolveSymbolFile(cacheDir string, repository string, file string) string
- func ResolveTestReportFile(cacheDir string, repository string, file string) string
- func TestFunc(x Kontext) func(*cli.Context) error
- func TestUrfaveCommand(x Kontext) *cli.Command
- type AppArgs
- type AppArgsT
- type AppConfig
- type AppConfigT
- type BaseAgent
- type BaseAgentT
- type BaseMetrics
- type BaseMetricsT
- type BaseModelCommand
- type BaseModelCommandT
- type ChatMemory
- func (me ChatMemory) AddAssistantMessage(content string) ChatMemory
- func (me ChatMemory) AddSystemMessage(content string) ChatMemory
- func (me ChatMemory) AddUserMessage(content string) ChatMemory
- func (me ChatMemory) Format() string
- func (me ChatMemory) ToChatCompletionMessageParamUnion() []openai.ChatCompletionMessageParamUnion
- type ChatMemoryT
- type ChatMessage
- type ChatMessageT
- type CheckAgent
- type CheckAgentT
- type CheckArgs
- type CheckArgsT
- type CheckCommand
- type CheckCommandT
- type CheckConfig
- type CheckConfigT
- type CheckIssue
- type CheckIssueT
- type CheckMetrics
- type CheckMetricsT
- type CheckPrompt
- type CheckPromptT
- type CheckPromptVariables
- func (me CheckPromptVariables) WithCodeToCheck(codeToCheck string) CheckPromptVariables
- func (me CheckPromptVariables) WithLang(lang string) CheckPromptVariables
- func (me CheckPromptVariables) WithPath(path string) CheckPromptVariables
- func (me CheckPromptVariables) WithSeverity(severity string) CheckPromptVariables
- type CheckPromptVariablesT
- type CheckReport
- type CheckReportManager
- type CheckReportManagerT
- type CheckReportT
- type CheckResult
- type CheckResultT
- type CodeFile
- type CodeFileManager
- type CodeFileManagerT
- type CodeFileT
- type Kontext
- type KontextT
- type ListCommand
- func (me ListCommand) CollectFiles(x Kontext, c comm.Console, dirPath string) ([]string, int, int)
- func (me ListCommand) CollectTargetFiles(x Kontext, c comm.Console) ([]string, int, int)
- func (me ListCommand) CollectWorkingFiles(x Kontext, c comm.Console) ([]string, int, int, []string)
- func (me ListCommand) List(x Kontext)
- type ListCommandT
- type ModelClient
- type ModelClientT
- type ModelConfig
- type ModelConfigT
- type ModelService
- type ModelServiceT
- type ModelUsageMetrics
- type ModelUsageMetricsT
- type Symbol
- type SymbolAgent
- type SymbolAgentT
- type SymbolAwareAgent
- type SymbolAwareAgentT
- type SymbolManager
- type SymbolManagerT
- type SymbolT
- type TestAgent
- type TestAgentT
- type TestArgs
- type TestArgsT
- type TestCommand
- type TestCommandT
- type TestConfig
- type TestConfigT
- type TestMetrics
- type TestMetricsT
- type TestPrompt
- type TestPromptT
- type TestPromptVariables
- func (me TestPromptVariables) WithCodeToTest(codeToTest string) TestPromptVariables
- func (me TestPromptVariables) WithExistingTestCode(existingTestCode string) TestPromptVariables
- func (me TestPromptVariables) WithLang(lang string) TestPromptVariables
- func (me TestPromptVariables) WithLibraries(libraries []string) TestPromptVariables
- func (me TestPromptVariables) WithPath(path string) TestPromptVariables
- type TestPromptVariablesT
- type TestReport
- type TestReportManager
- type TestReportManagerT
- type TestReportT
- type TestResult
- type TestResultT
Constants ¶
View Source
const ( FIX_BEGIN = "!!!!fix_begin!!!!" FIX_BEGIN_LINE = FIX_BEGIN + "\n" FIX_END = "!!!!fix_end!!!!" FIX_END_LINE = FIX_END )
View Source
const ( TEST_BEGIN = "!!!!test_begin!!!!" TEST_BEGIN_LINE = TEST_BEGIN + "\n" TEST_END = "!!!!test_end!!!!" TEST_END_LINE = TEST_END )
View Source
const CHECK_REPORT_JSON_FORMAT = `` /* 706-byte string literal not displayed */
View Source
const SYMBOL_JSON_FORMAT = `` /* 206-byte string literal not displayed */
View Source
const TEST_REPORT_JSON_FORMAT = `
{
"test_file_path": "",
"amount_of_generated_test_cases": 0,
"single_test_run_command": ""
}`
Variables ¶
This section is empty.
Functions ¶
func CheckUrfaveCommand ¶ added in v0.1.2
func DefaultConfigDir ¶
func DefaultConfigDir() string
func DefaultConfigMap ¶
func ExtractFixedCode ¶
func ExtractTestCode ¶ added in v0.1.2
func ListUrfaveCommand ¶ added in v0.1.2
func LoadAngineerEnv ¶
func ResolveCheckReportFile ¶ added in v0.1.2
func ResolveOriginalCodeFile ¶
func ResolveSymbolFile ¶
func ResolveTestReportFile ¶ added in v0.1.2
func TestUrfaveCommand ¶ added in v0.1.2
Types ¶
type AppConfig ¶
type AppConfig = *AppConfigT
func ConfigWithYaml ¶
func (AppConfig) GetExclude ¶
func (AppConfig) GetInclude ¶
func (AppConfig) LoadModel ¶
func (me AppConfig) LoadModel(modelId string) ModelConfig
type AppConfigT ¶
type AppConfigT struct {
Includes []string `mapstructure:"includes"`
Excludes []string `mapstructure:"excludes"`
CacheDir string `mapstructure:"cache_dir"`
Lang string `mapstructure:"lang"`
Test TestConfig `mapstructure:"test"`
Check CheckConfig `mapstructure:"check"`
Models []ModelConfig `mapstructure:"models"`
// contains filtered or unexported fields
}
type BaseAgent ¶ added in v0.1.2
type BaseAgent = *BaseAgentT
type BaseAgentT ¶ added in v0.1.2
type BaseAgentT struct {
// contains filtered or unexported fields
}
type BaseMetrics ¶ added in v0.1.2
type BaseMetrics = *BaseMetricsT
func NewBaseMetrics ¶ added in v0.1.2
func NewBaseMetrics() BaseMetrics
func (BaseMetrics) PreparePrint ¶ added in v0.1.2
func (me BaseMetrics) PreparePrint(console comm.Console)
type BaseMetricsT ¶ added in v0.1.2
type BaseModelCommand ¶ added in v0.1.2
type BaseModelCommand = *BaseModelCommandT
func NewBaseModelCommand ¶ added in v0.1.2
func NewBaseModelCommand(x Kontext) BaseModelCommand
type BaseModelCommandT ¶ added in v0.1.2
type BaseModelCommandT struct {
// contains filtered or unexported fields
}
type ChatMemory ¶
type ChatMemory = *ChatMemoryT
func NewChatMemory ¶
func NewChatMemory() ChatMemory
func (ChatMemory) AddAssistantMessage ¶
func (me ChatMemory) AddAssistantMessage(content string) ChatMemory
func (ChatMemory) AddSystemMessage ¶
func (me ChatMemory) AddSystemMessage(content string) ChatMemory
func (ChatMemory) AddUserMessage ¶
func (me ChatMemory) AddUserMessage(content string) ChatMemory
func (ChatMemory) Format ¶
func (me ChatMemory) Format() string
func (ChatMemory) ToChatCompletionMessageParamUnion ¶
func (me ChatMemory) ToChatCompletionMessageParamUnion() []openai.ChatCompletionMessageParamUnion
type ChatMemoryT ¶
type ChatMemoryT struct {
// contains filtered or unexported fields
}
type ChatMessage ¶
type ChatMessage = *ChatMessageT
func NewAssistantMessage ¶
func NewAssistantMessage(content string) ChatMessage
func NewSystemMessage ¶
func NewSystemMessage(content string) ChatMessage
func NewUserMessage ¶
func NewUserMessage(content string) ChatMessage
func (ChatMessage) Format ¶
func (me ChatMessage) Format() string
func (ChatMessage) ToChatCompletionMessageParamUnion ¶
func (me ChatMessage) ToChatCompletionMessageParamUnion() openai.ChatCompletionMessageParamUnion
type ChatMessageT ¶
type CheckAgent ¶ added in v0.1.2
type CheckAgent = *CheckAgentT
func NewCheckAgent ¶ added in v0.1.2
func NewCheckAgent(reportManager CheckReportManager, codeFileManager CodeFileManager, symbolManager SymbolManager, modelService ModelService, codeFile string, ) CheckAgent
func (CheckAgent) Run ¶ added in v0.1.2
func (me CheckAgent) Run(x Kontext, checkArgs CheckArgs, resultChan chan<- CheckResult, wg *sync.WaitGroup)
type CheckAgentT ¶ added in v0.1.2
type CheckAgentT struct {
SymbolAwareAgentT
// contains filtered or unexported fields
}
type CheckArgs ¶ added in v0.1.2
type CheckArgs = *CheckArgsT
type CheckArgsT ¶ added in v0.1.2
type CheckArgsT struct {
Fix bool
}
type CheckCommand ¶ added in v0.1.2
type CheckCommand = *CheckCommandT
func NewCheckCommand ¶ added in v0.1.2
func NewCheckCommand(x Kontext) CheckCommand
func (CheckCommand) Check ¶ added in v0.1.2
func (me CheckCommand) Check(x Kontext, checkArgs CheckArgs)
type CheckCommandT ¶ added in v0.1.2
type CheckCommandT struct {
BaseModelCommandT
// contains filtered or unexported fields
}
type CheckConfig ¶ added in v0.1.2
type CheckConfig = *CheckConfigT
func (CheckConfig) Init ¶ added in v0.1.2
func (me CheckConfig) Init(config AppConfig)
func (CheckConfig) RenderPrompt ¶ added in v0.1.2
func (me CheckConfig) RenderPrompt(codeToCheck string, codeFile string) string
type CheckConfigT ¶ added in v0.1.2
type CheckConfigT struct {
AppConfig AppConfig
ModelId string `mapstructure:"model_id"`
Severity string `mapstructure:"severity"`
Prompt CheckPrompt `mapstructure:"prompt"`
}
type CheckIssue ¶ added in v0.1.2
type CheckIssue = *CheckIssueT
func (CheckIssue) Print ¶ added in v0.1.2
func (me CheckIssue) Print(console comm.Console)
type CheckIssueT ¶ added in v0.1.2
type CheckIssueT struct {
ShortDescription string `json:"short_description"`
DetailedExplaination string `json:"detailed_explaination"`
Suggestion string `json:"suggestion"`
IssueLineBegin int `json:"issue_line_begin"`
IssueLineEnd int `json:"issue_line_end"`
IssueReferenceUrls []string `json:"issue_reference_urls"`
Severity string `json:"severity"`
SeverityReason string `json:"severity_reason"`
}
type CheckMetrics ¶ added in v0.1.2
type CheckMetrics = *CheckMetricsT
func NewCheckMetrics ¶ added in v0.1.2
func NewCheckMetrics() CheckMetrics
func (CheckMetrics) Print ¶ added in v0.1.2
func (me CheckMetrics) Print(console comm.Console)
type CheckMetricsT ¶ added in v0.1.2
type CheckMetricsT struct {
BaseMetricsT
HasIssue int
TotalIssue int
}
type CheckPrompt ¶ added in v0.1.2
type CheckPrompt = *CheckPromptT
func (CheckPrompt) Generate ¶ added in v0.1.2
func (me CheckPrompt) Generate(vars CheckPromptVariables) string
func (CheckPrompt) Init ¶ added in v0.1.2
func (me CheckPrompt) Init(config AppConfig)
type CheckPromptT ¶ added in v0.1.2
type CheckPromptVariables ¶ added in v0.1.2
type CheckPromptVariables = *CheckPromptVariablesT
func NewCheckPromptVariables ¶ added in v0.1.2
func NewCheckPromptVariables() CheckPromptVariables
func (CheckPromptVariables) WithCodeToCheck ¶ added in v0.1.2
func (me CheckPromptVariables) WithCodeToCheck(codeToCheck string) CheckPromptVariables
func (CheckPromptVariables) WithLang ¶ added in v0.1.2
func (me CheckPromptVariables) WithLang(lang string) CheckPromptVariables
func (CheckPromptVariables) WithPath ¶ added in v0.1.2
func (me CheckPromptVariables) WithPath(path string) CheckPromptVariables
func (CheckPromptVariables) WithSeverity ¶ added in v0.1.2
func (me CheckPromptVariables) WithSeverity(severity string) CheckPromptVariables
type CheckPromptVariablesT ¶ added in v0.1.2
type CheckReport ¶ added in v0.1.2
type CheckReport = *CheckReportT
func ExtractCheckReport ¶ added in v0.1.2
func ExtractCheckReport(answer string, isGolang bool) CheckReport
type CheckReportManager ¶ added in v0.1.2
type CheckReportManager = *CheckReportManagerT
func NewCheckReportManager ¶ added in v0.1.2
func NewCheckReportManager() CheckReportManager
func (CheckReportManager) LoadReport ¶ added in v0.1.2
func (me CheckReportManager) LoadReport(x Kontext, file string) CheckReport
func (CheckReportManager) SaveReport ¶ added in v0.1.2
func (me CheckReportManager) SaveReport(x Kontext, file string, report CheckReport) string
type CheckReportManagerT ¶ added in v0.1.2
type CheckReportManagerT struct {
// contains filtered or unexported fields
}
type CheckReportT ¶ added in v0.1.2
type CheckReportT struct {
HasIssue bool `json:"has_issue"`
OverallSeverity string `json:"overall_severity"`
Issues []CheckIssue `json:"issues"`
FixedCode string `json:"fixed_code"`
Path string `json:"path"`
ModelUsageMetrics ModelUsageMetrics `json:"model_usage_metrics"`
}
type CheckResult ¶ added in v0.1.2
type CheckResult = *CheckResultT
type CheckResultT ¶ added in v0.1.2
type CheckResultT struct {
Report CheckReport
Skipped bool
Failed bool
}
type CodeFileManager ¶
type CodeFileManager = *CodeFileManagerT
func NewCodeFileManager ¶
func NewCodeFileManager() CodeFileManager
type CodeFileManagerT ¶
type CodeFileManagerT struct {
// contains filtered or unexported fields
}
type ListCommand ¶ added in v0.1.1
type ListCommand = *ListCommandT
func NewListCommand ¶ added in v0.1.1
func NewListCommand() ListCommand
func (ListCommand) CollectFiles ¶ added in v0.1.1
func (ListCommand) CollectTargetFiles ¶ added in v0.1.1
func (ListCommand) CollectWorkingFiles ¶ added in v0.1.1
func (ListCommand) List ¶ added in v0.1.1
func (me ListCommand) List(x Kontext)
type ListCommandT ¶ added in v0.1.1
type ListCommandT struct{}
type ModelClient ¶
type ModelClient = *ModelClientT
func NewModelClient ¶
func NewModelClient(config ModelConfig) ModelClient
func (ModelClient) Chat ¶
func (me ModelClient) Chat(x Kontext, memory ChatMemory) (*openai.ChatCompletion, time.Duration)
type ModelClientT ¶
type ModelClientT struct {
// contains filtered or unexported fields
}
type ModelConfig ¶
type ModelConfig = *ModelConfigT
func (ModelConfig) Init ¶
func (me ModelConfig) Init(config AppConfig)
type ModelConfigT ¶
type ModelConfigT struct {
Id string `mapstructure:"id,omitempty"`
Name string `mapstructure:"name,omitempty"`
Temperature float64 `mapstructure:"temperature,omitempty"`
MaxOutputTokens int `mapstructure:"max_output_tokens"`
ContextWindow int `mapstructure:"context_window"`
TikTokenEnabled bool `mapstructure:"tik_token_enabled"`
ApiKey string `mapstructure:"api_key"`
BaseUrl string `mapstructure:"base_url"`
Timeout time.Duration `mapstructure:"timeout,omitempty" default:"10s"`
ProxyUrl string `mapstructure:"proxy_url,omitempty"`
ProxyUser string `mapstructure:"proxy_user,omitempty"`
ProxyPass string `mapstructure:"proxy_pass,omitempty"`
ProxyInsecureSkipVerify bool `mapstructure:"proxy_insecure_skip_verify" default:"false"`
CheckPrompt CheckPrompt `mapstructure:"check_prompt"`
TestPrompt TestPrompt `mapstructure:"test_prompt"`
MaxConcurrentRequests int `mapstructure:"max_concurrent_requests"`
}
type ModelService ¶
type ModelService = *ModelServiceT
func NewModelService ¶
func NewModelService(config AppConfig) ModelService
func (ModelService) Chat ¶
func (me ModelService) Chat(x Kontext, modelId string, memory ChatMemory) (string, ModelUsageMetrics)
func (ModelService) Decode ¶
func (me ModelService) Decode(tokens []uint) string
type ModelServiceT ¶
type ModelServiceT struct {
// contains filtered or unexported fields
}
type ModelUsageMetrics ¶
type ModelUsageMetrics = *ModelUsageMetricsT
func NewModelUsageMetrics ¶
func NewModelUsageMetrics() ModelUsageMetrics
func (ModelUsageMetrics) IncreaseUsage ¶
func (me ModelUsageMetrics) IncreaseUsage(usage ModelUsageMetrics)
type ModelUsageMetricsT ¶
type ModelUsageMetricsT struct {
Duration time.Duration
EvaluatedPromptTokens int
OpenAiUsage *openai.CompletionUsage
}
type SymbolAgent ¶
type SymbolAgent = *SymbolAgentT
func NewSymbolAgent ¶
func NewSymbolAgent(symbolManager SymbolManager, codeFileManager CodeFileManager, modelService ModelService, file string, ) SymbolAgent
type SymbolAgentT ¶
type SymbolAgentT struct {
BaseAgentT
// contains filtered or unexported fields
}
type SymbolAwareAgent ¶ added in v0.1.2
type SymbolAwareAgent = *SymbolAwareAgentT
type SymbolAwareAgentT ¶ added in v0.1.2
type SymbolAwareAgentT struct {
BaseAgentT
// contains filtered or unexported fields
}
type SymbolManager ¶
type SymbolManager = *SymbolManagerT
func NewSymbolManager ¶
func NewSymbolManager() SymbolManager
func (SymbolManager) LoadAll ¶
func (me SymbolManager) LoadAll(x Kontext, files []string)
type SymbolManagerT ¶
type SymbolManagerT struct {
// contains filtered or unexported fields
}
type TestAgent ¶ added in v0.1.2
type TestAgent = *TestAgentT
func NewTestAgent ¶ added in v0.1.2
func NewTestAgent(reportManager TestReportManager, codeFileManager CodeFileManager, symbolManager SymbolManager, modelService ModelService, codeFile string, ) TestAgent
type TestAgentT ¶ added in v0.1.2
type TestAgentT struct {
SymbolAwareAgentT
// contains filtered or unexported fields
}
type TestCommand ¶ added in v0.1.2
type TestCommand = *TestCommandT
func NewTestCommand ¶ added in v0.1.2
func NewTestCommand(x Kontext) TestCommand
func (TestCommand) Test ¶ added in v0.1.2
func (me TestCommand) Test(x Kontext, testArgs TestArgs)
type TestCommandT ¶ added in v0.1.2
type TestCommandT struct {
BaseModelCommandT
// contains filtered or unexported fields
}
type TestConfig ¶ added in v0.1.2
type TestConfig = *TestConfigT
func (TestConfig) Init ¶ added in v0.1.2
func (me TestConfig) Init(config AppConfig)
func (TestConfig) RenderPrompt ¶ added in v0.1.2
type TestConfigT ¶ added in v0.1.2
type TestConfigT struct {
AppConfig AppConfig
ModelId string `mapstructure:"model_id"`
Prompt TestPrompt `mapstructure:"prompt"`
}
type TestMetrics ¶ added in v0.1.2
type TestMetrics = *TestMetricsT
func NewTestMetrics ¶ added in v0.1.2
func NewTestMetrics() TestMetrics
func (TestMetrics) Print ¶ added in v0.1.2
func (me TestMetrics) Print(console comm.Console)
type TestMetricsT ¶ added in v0.1.2
type TestMetricsT struct {
BaseMetricsT
TotalTestCases int
}
type TestPrompt ¶ added in v0.1.2
type TestPrompt = *TestPromptT
func (TestPrompt) Generate ¶ added in v0.1.2
func (me TestPrompt) Generate(vars TestPromptVariables) string
func (TestPrompt) Init ¶ added in v0.1.2
func (me TestPrompt) Init(config AppConfig)
type TestPromptT ¶ added in v0.1.2
type TestPromptVariables ¶ added in v0.1.2
type TestPromptVariables = *TestPromptVariablesT
func NewTestPromptVariables ¶ added in v0.1.2
func NewTestPromptVariables() TestPromptVariables
func (TestPromptVariables) WithCodeToTest ¶ added in v0.1.2
func (me TestPromptVariables) WithCodeToTest(codeToTest string) TestPromptVariables
func (TestPromptVariables) WithExistingTestCode ¶ added in v0.1.2
func (me TestPromptVariables) WithExistingTestCode(existingTestCode string) TestPromptVariables
func (TestPromptVariables) WithLang ¶ added in v0.1.2
func (me TestPromptVariables) WithLang(lang string) TestPromptVariables
func (TestPromptVariables) WithLibraries ¶ added in v0.1.2
func (me TestPromptVariables) WithLibraries(libraries []string) TestPromptVariables
func (TestPromptVariables) WithPath ¶ added in v0.1.2
func (me TestPromptVariables) WithPath(path string) TestPromptVariables
type TestPromptVariablesT ¶ added in v0.1.2
type TestReport ¶ added in v0.1.2
type TestReport = *TestReportT
func ExtractTestReport ¶ added in v0.1.2
func ExtractTestReport(answer string, isGolang bool) TestReport
func (TestReport) Print ¶ added in v0.1.2
func (me TestReport) Print(console comm.Console)
type TestReportManager ¶ added in v0.1.2
type TestReportManager = *TestReportManagerT
func NewTestReportManager ¶ added in v0.1.2
func NewTestReportManager() TestReportManager
func (TestReportManager) LoadReport ¶ added in v0.1.2
func (me TestReportManager) LoadReport(x Kontext, file string) TestReport
func (TestReportManager) SaveReport ¶ added in v0.1.2
func (me TestReportManager) SaveReport(x Kontext, file string, report TestReport) string
type TestReportManagerT ¶ added in v0.1.2
type TestReportManagerT struct {
// contains filtered or unexported fields
}
type TestReportT ¶ added in v0.1.2
type TestReportT struct {
Path string `json:"path"`
ModelUsageMetrics ModelUsageMetrics
TestFilePath string `json:"test_file_path"`
TestCode string `json:"test_code"`
AmountOfGeneratedTestCases int `json:"amount_of_generated_test_cases"`
SingleTestRunCommand string `json:"single_test_run_command"`
}
type TestResult ¶ added in v0.1.2
type TestResult = *TestResultT
type TestResultT ¶ added in v0.1.2
type TestResultT struct {
Skipped bool
Failed bool
Report TestReport
}
Source Files
¶
- app_args.go
- app_config.go
- base_agent.go
- base_metrics.go
- base_model_command.go
- chat_memory.go
- chat_message.go
- check_agent.go
- check_args.go
- check_command.go
- check_config.go
- check_metrics.go
- check_prompt.go
- check_report.go
- check_report_manager.go
- code_file_manager.go
- kontext.go
- list_command.go
- model_client.go
- model_config.go
- model_service.go
- model_usage_metrics.go
- symbol_agent.go
- symbol_aware_agent.go
- symbol_manager.go
- test_agent.go
- test_args.go
- test_command.go
- test_config.go
- test_metrics.go
- test_prompt.go
- test_report.go
- test_report_manager.go
Click to show internal directories.
Click to hide internal directories.