-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmain.go
34 lines (31 loc) · 1.13 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package main
import (
"dagger/toy-programmer/internal/dagger"
)
type ToyProgrammer struct{}
// Write a Go program
func (m *ToyProgrammer) GoProgram(
// The programming assignment
// Example: "write me a curl clone"
assignment string,
// Run LLM-powered QA on the result
// +optional
qa bool) *dagger.Container {
result := dag.Llm().
WithToyWorkspace(dag.ToyWorkspace().Write("assignment.txt", assignment)).
WithPrompt("You are an expert go programmer. You have access to a workspace").
WithPrompt("Complete the assignment written at assignment.txt").
WithPrompt("Don't stop until the code builds").
ToyWorkspace().
Container()
if qa {
return dag.Llm().
WithContainer(result).
WithPrompt("You are an expert QA engineer. You have access to a container").
WithPrompt("There is a go program in the current directory. Build and run it. Understand what it does. Write your findings in QA.md").
WithPrompt("Include a table of each command you ran, and the result").
WithPrompt("Be careful not to wipe the state of the container with a new image. Focus on withExec, file, directory").
Container()
}
return result
}