Refactor: split prompt definition from execution settings and migrate run contracts to prompt_* + execution_target
This commit is contained in:
@@ -12,9 +12,9 @@ func TestGoRenderer_Render(t *testing.T) {
|
||||
renderer := NewGoRenderer()
|
||||
ctx := context.Background()
|
||||
|
||||
profile := &domain.PromptProfile{
|
||||
profile := &domain.PromptDefinition{
|
||||
ID: "test-profile",
|
||||
ExpectedInputs: []string{"transcript"},
|
||||
Inputs: []domain.PromptInput{{Name: "transcript", Required: true}},
|
||||
Templates: []domain.PromptMessageTemplate{
|
||||
{Role: "system", Content: "You are a {{.role}}."},
|
||||
{Role: "user", Content: "Analyze this: {{input \"transcript\"}}"},
|
||||
@@ -54,7 +54,8 @@ func TestGoRenderer_Render(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("unknown input in template", func(t *testing.T) {
|
||||
profileUnknown := &domain.PromptProfile{
|
||||
profileUnknown := &domain.PromptDefinition{
|
||||
Inputs: []domain.PromptInput{{Name: "transcript", Required: true}},
|
||||
Templates: []domain.PromptMessageTemplate{
|
||||
{Role: "user", Content: "Hello {{input \"ghost\"}}"},
|
||||
},
|
||||
@@ -69,7 +70,8 @@ func TestGoRenderer_Render(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("invalid template syntax", func(t *testing.T) {
|
||||
profileInvalid := &domain.PromptProfile{
|
||||
profileInvalid := &domain.PromptDefinition{
|
||||
Inputs: []domain.PromptInput{{Name: "transcript", Required: true}},
|
||||
Templates: []domain.PromptMessageTemplate{
|
||||
{Role: "user", Content: "Hello {{.unclosed"},
|
||||
},
|
||||
@@ -81,7 +83,8 @@ func TestGoRenderer_Render(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("empty message role", func(t *testing.T) {
|
||||
profileNoRole := &domain.PromptProfile{
|
||||
profileNoRole := &domain.PromptDefinition{
|
||||
Inputs: []domain.PromptInput{{Name: "transcript", Required: true}},
|
||||
Templates: []domain.PromptMessageTemplate{
|
||||
{Role: "", Content: "Hello"},
|
||||
},
|
||||
@@ -93,7 +96,8 @@ func TestGoRenderer_Render(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("missing variable in template", func(t *testing.T) {
|
||||
profileMissingVar := &domain.PromptProfile{
|
||||
profileMissingVar := &domain.PromptDefinition{
|
||||
Inputs: []domain.PromptInput{{Name: "transcript", Required: true}},
|
||||
Templates: []domain.PromptMessageTemplate{
|
||||
{Role: "system", Content: "You are {{.missing}}"},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user