Skip to content
Snippets Groups Projects
Commit 52ff4f34 authored by Aleksander Einarsen's avatar Aleksander Einarsen
Browse files

# 115 Working on an iteration test

parent 7bdc7233
No related branches found
No related tags found
No related merge requests found
......@@ -64,6 +64,7 @@ func (p *Program) Run(userPrompt string, languagePrompt string) {
}
}
// TODO: data writing should not be in this function, this function should just run a single iteration and return all the results
func (p *Program) RunIteration(
initialPrompt string,
currentPrompt string,
......
......@@ -8,6 +8,7 @@ import (
"llama/modules/extraction"
ollamaimplementation "llama/modules/ollama-implementation"
"testing"
"time"
)
type NoUI struct{}
......@@ -17,13 +18,12 @@ func (n *NoUI) WriteJSON(_ any) error {
return nil
}
func TestProgram_Run_WithLlama3_1_AndGolang(t *testing.T) {
func GetOllamaGoProgramNoUI() Program {
clientOptions := options.Client().ApplyURI(projectdb.UriDb)
db := projectdb.GetDB(clientOptions, projectdb.Production)
languageModel := &ollamaimplementation.Ollama{Model: "llama3.1"}
clientOptions := options.Client().ApplyURI(projectdb.UriDb)
db := projectdb.GetDB(clientOptions, projectdb.Test)
compiler := go_compiler_v2.GoCompiler{}.CheckCompileErrors
extractor := &extraction.GoExtractor{}
prog := Program{
......@@ -35,5 +35,25 @@ func TestProgram_Run_WithLlama3_1_AndGolang(t *testing.T) {
Extractor: extractor,
}
prog.Run("userPrompt", extraction.GoPrompt)
return prog
}
func TestProgram_Run_WithLlama3_1_AndGolang(t *testing.T) {
prog := GetOllamaGoProgramNoUI()
prog.Run("write a code that adds two numbers", extraction.GoPrompt)
}
func TestProgram_RunIteration_with_FirstIterationHavingBugInCode(t *testing.T) {
prog := GetOllamaGoProgramNoUI()
prog.RunIteration(
"write a code that adds two numbers",
"write a code that adds two numbers",
extraction.GoPrompt,
[]int{},
2,
time.Now(),
)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment