Skip to content

Open source AI coding agent. Designed for large projects and real world tasks.

feat: Update promptfoo configuration files for build and fix

ZanzyTHEbar95893908c02a
diff --git a/Makefile b/Makefile
index c2e04769..e9eb25a8 100644
--- a/Makefile
+++ b/Makefile
@@ -35,9 +35,12 @@ test: render
#### Evals and Providers ####
-# TODO: Implement eval command
+# TODO: Implement eval all
eval:
- @echo "Eval command not implemented yet"
+ @cd test/evals/promptfoo-poc/$(filter-out $@,$(MAKECMDGOALS)) && promptfoo eval --no-cache
+
+view-eval:
+ @cd test/evals/promptfoo-poc/$(filter-out $@,$(MAKECMDGOALS)) && promptfoo view
gen-eval:
@$(GOCMD) run app/scripts/cmd/gen/gen.go test/evals/promptfoo-poc/$(filter-out $@,$(MAKECMDGOALS))
@@ -58,6 +61,8 @@ default: build
help:
@echo "Usage:"
@echo " make dev - to run the development scripts"
+ @echo " make eval <directory_name> - to run the promptfoo eval command on a specific directory"
+ @echo " make view-eval - to view the promptfoo eval output"
@echo " make gen-eval <directory_name> - to create a new promptfoo eval directory structure"
@echo " make gen-provider - to create a new promptfoo provider file from the promptfoo diretory structure"
@echo " make clean - to remove generated files and directories"
diff --git a/app/scripts/cmd/provider/gen_provider.go b/app/scripts/cmd/provider/gen_provider.go
index ad9d5737..e914d51f 100644
--- a/app/scripts/cmd/provider/gen_provider.go
+++ b/app/scripts/cmd/provider/gen_provider.go
@@ -9,7 +9,7 @@ import (
"text/template"
)
-var testDir = "../../test/evals/promptfoo-poc"
+var testDir = "test/evals/promptfoo-poc"
var templFile = testDir + "/templates/" + "/provider.template.yml"
func main() {
diff --git a/test/evals/promptfoo-poc/build/assets/build/changes.md b/test/evals/promptfoo-poc/build/assets/build/changes.md
new file mode 100644
index 00000000..4e06dca6
--- /dev/null
+++ b/test/evals/promptfoo-poc/build/assets/build/changes.md
@@ -0,0 +1,177 @@
+### Subtask 1: Parse the range of indices from the command-line arguments.
+
+```
+package cmd
+
+import (
+ "fmt"
+ "path/filepath"
+ "plandex/api"
+ "plandex/auth"
+ "plandex/lib"
+ "plandex/term"
+ "strconv"
+ "strings"
+
+ "github.com/plandex/plandex/shared"
+ "github.com/spf13/cobra"
+)
+
+func parseRange(arg string) ([]int, error) {
+ var indices []int
+ parts := strings.Split(arg, "-")
+ if len(parts) == 2 {
+ start, err := strconv.Atoi(parts[0])
+ if err != nil {
+ return nil, err
+ }
+ end, err := strconv.Atoi(parts[1])
+ if err != nil {
+ return nil, err
+ }
+ for i := start; i <= end; i++ {
+ indices = append(indices, i)
+ }
+ } else {
+ index, err := strconv.Atoi(arg)
+ if err != nil {
+ return nil, err
+ }
+ indices = append(indices, index)
+ }
+ return indices, nil
+}
+```
+
+### Subtask 2: Update the logic to handle the range of indices and mark the corresponding contexts for deletion.
+
+```
+package cmd
+
+import (
+ "fmt"
+ "path/filepath"
+ "plandex/api"
+ "plandex/auth"
+ "plandex/lib"
+ "plandex/term"
+ "strconv"
+ "strings"
+
+ "github.com/plandex/plandex/shared"
+ "github.com/spf13/cobra"
+)
+
+func parseRange(arg string) ([]int, error) {
+ var indices []int
+ parts := strings.Split(arg, "-")
+ if len(parts) == 2 {
+ start, err := strconv.Atoi(parts[0])
+ if err != nil {
+ return nil, err
+ }
+ end, err := strconv.Atoi(parts[1])
+ if err != nil {
+ return nil, err
+ }
+ for i := start; i <= end; i++ {
+ indices = append(indices, i)
+ }
+ } else {
+ index, err := strconv.Atoi(arg)
+ if err != nil {
+ return nil, err
+ }
+ indices = append(indices, index)
+ }
+ return indices, nil
+}
+
+func contextRm(cmd *cobra.Command, args []string) {
+ auth.MustResolveAuthWithOrg()
+ lib.MustResolveProject()
+
+ if lib.CurrentPlanId == "" {
+ fmt.Println("πŸ€·β€β™‚οΈ No current plan")
+ return
+ }
+
+ term.StartSpinner("")
+ contexts, err := api.Client.ListContext(lib.CurrentPlanId, lib.CurrentBranch)
+
+ if err != nil {
+ term.OutputErrorAndExit("Error retrieving context: %v", err)
+ }
+
+ deleteIds := map[string]bool{}
+
+ for _, arg := range args {
+ indices, err := parseRange(arg)
+ if err != nil {
+ term.OutputErrorAndExit("Error parsing range: %v", err)
+ }
+
+ for _, index := range indices {
+ if index > 0 && index <= len(contexts) {
+ context := contexts[index-1]
+ deleteIds[context.Id] = true
+ }
+ }
+ }
+
+ for i, context := range contexts {
+ for _, id := range args {
+ if fmt.Sprintf("%d", i+1) == id || context.Name == id || context.FilePath == id || context.Url == id {
+ deleteIds[context.Id] = true
+ break
+ } else if context.FilePath != "" {
+ // Check if id is a glob pattern
+ matched, err := filepath.Match(id, context.FilePath)
+ if err != nil {
+ term.OutputErrorAndExit("Error matching glob pattern: %v", err)
+ }
+ if matched {
+ deleteIds[context.Id] = true
+ break
+ }
+
+ // Check if id is a parent directory
+ parentDir := context.FilePath
+ for parentDir != "." && parentDir != "/" && parentDir != "" {
+ if parentDir == id {
+ deleteIds[context.Id] = true
+ break
+ }
+ parentDir = filepath.Dir(parentDir) // Move up one directory
+ }
+
+ }
+ }
+ }
+
+ if len(deleteIds) > 0 {
+ res, err := api.Client.DeleteContext(lib.CurrentPlanId, lib.CurrentBranch, shared.DeleteContextRequest{
+ Ids: deleteIds,
+ })
+ term.StopSpinner()
+
+ if err != nil {
+ term.OutputErrorAndExit("Error deleting context: %v", err)
+ }
+
+ fmt.Println("βœ… " + res.Msg)
+ } else {
+ term.StopSpinner()
+ fmt.Println("πŸ€·β€β™‚οΈ No context removed")
+ }
+}
+```
+
+### Subtask 3: Update the `contextRm` function to include the new logic for handling ranges.
+
+
+```
+func init() {
+ RootCmd.AddCommand(contextRmCmd)
+}
+```
\ No newline at end of file
diff --git a/test/evals/promptfoo-poc/build/assets/build/post_build.go b/test/evals/promptfoo-poc/build/assets/build/post_build.go
new file mode 100644
index 00000000..4f855553
--- /dev/null
+++ b/test/evals/promptfoo-poc/build/assets/build/post_build.go
@@ -0,0 +1,123 @@
+pdx-1: package cmd
+pdx-2:
+pdx-3: import (
+pdx-4: "fmt"
+pdx-5: "path/filepath"
+pdx-6: "plandex/api"
+pdx-7: "plandex/auth"
+pdx-8: "plandex/lib"
+pdx-9: "plandex/term"
+pdx-10: "strconv"
+pdx-11: "strings"
+pdx-12:
+pdx-13: "github.com/plandex/plandex/shared"
+pdx-14: "github.com/spf13/cobra"
+pdx-15: )
+pdx-16:
+pdx-17: func parseRange(arg string) ([]int, error) {
+pdx-18: var indices []int
+pdx-19: parts := strings.Split(arg, "-")
+pdx-20: if len(parts) == 2 {
+pdx-21: start, err := strconv.Atoi(parts[0])
+pdx-22: if err != nil {
+pdx-23: return nil, err
+pdx-24: }
+pdx-25: end, err := strconv.Atoi(parts[1])
+pdx-26: if err != nil {
+pdx-27: return nil, err
+pdx-28: }
+pdx-29: for i := start; i <= end; i++ {
+pdx-30: indices = append(indices, i)
+pdx-31: }
+pdx-32: } else {
+pdx-33: index, err := strconv.Atoi(arg)
+pdx-34: if err != nil {
+pdx-35: return nil, err
+pdx-36: }
+pdx-37: indices = append(indices, index)
+pdx-38: }
+pdx-39: return indices, nil
+pdx-40: }
+pdx-41:
+pdx-42: func contextRm(cmd *cobra.Command, args []string) {
+pdx-43: auth.MustResolveAuthWithOrg()
+pdx-44: lib.MustResolveProject()
+pdx-45:
+pdx-46: if lib.CurrentPlanId == "" {
+pdx-47: fmt.Println("πŸ€·β€β™‚οΈ No current plan")
+pdx-48: return
+pdx-49: }
+pdx-50:
+pdx-51: term.StartSpinner("")
+pdx-52: contexts, err := api.Client.ListContext(lib.CurrentPlanId, lib.CurrentBranch)
+pdx-53:
+pdx-54: if err != nil {
+pdx-55: term.OutputErrorAndExit("Error retrieving context: %v", err)
+pdx-56: }
+pdx-57:
+pdx-58: deleteIds := map[string]bool{}
+pdx-59:
+pdx-60: for _, arg := range args {
+pdx-61: indices, err := parseRange(arg)
+pdx-62: if err != nil {
+pdx-63: term.OutputErrorAndExit("Error parsing range: %v", err)
+pdx-64: }
+pdx-65:
+pdx-66: for _, index := range indices {
+pdx-67: if index > 0 && index <= len(contexts) {
+pdx-68: context := contexts[index-1]
+pdx-69: deleteIds[context.Id] = true
+pdx-70: }
+pdx-71: }
+pdx-72: }
+pdx-73:
+pdx-74: for i, context := range contexts {
+pdx-75: for _, id := range args {
+pdx-76: if fmt.Sprintf("%d", i+1) == id || context.Name == id || context.FilePath == id || context.Url == id {
+pdx-77: deleteIds[context.Id] = true
+pdx-78: break
+pdx-79: } else if context.FilePath != "" {
+pdx-80: // Check if id is a glob pattern
+pdx-81: matched, err := filepath.Match(id, context.FilePath)
+pdx-82: if err != nil {
+pdx-83: term.OutputErrorAndExit("Error matching glob pattern: %v", err)
+pdx-84: }
+pdx-85: if matched {
+pdx-86: deleteIds[context.Id] = true
+pdx-87: break
+pdx-88: }
+pdx-89:
+pdx-90: // Check if id is a parent directory
+pdx-91: parentDir := context.FilePath
+pdx-92: for parentDir != "." && parentDir != "/" && parentDir != "" {
+pdx-93: if parentDir == id {
+pdx-94: deleteIds[context.Id] = true
+pdx-95: break
+pdx-96: }
+pdx-97: parentDir = filepath.Dir(parentDir) // Move up one directory
+pdx-98: }
+pdx-99: }
+pdx-100: }
+pdx-101: }
+pdx-102:
+pdx-103: if len(deleteIds) > 0 {
+pdx-104: res, err := api.Client.DeleteContext(lib.CurrentPlanId, lib.CurrentBranch, shared.DeleteContextRequest{
+pdx-105: Ids: deleteIds,
+pdx-106: })
+pdx-107: term.StopSpinner()
+pdx-108:
+pdx-109: if err != nil {
+pdx-110: term.OutputErrorAndExit("Error deleting context: %v", err)
+pdx-111: }
+pdx-112:
+pdx-113: fmt.Println("βœ… " + res.Msg)
+pdx-114: } else {
+pdx-115: term.StopSpinner()
+pdx-116: fmt.Println("πŸ€·β€β™‚οΈ No context removed")
+pdx-117: }
+pdx-118: }
+pdx-119:
+pdx-120: func init() {
+pdx-121: RootCmd.AddCommand(contextRmCmd)
+pdx-122: }
+pdx-123:
\ No newline at end of file
diff --git a/test/evals/promptfoo-poc/build/assets/shared/pre_build.go b/test/evals/promptfoo-poc/build/assets/shared/pre_build.go
new file mode 100644
index 00000000..c90eeb79
--- /dev/null
+++ b/test/evals/promptfoo-poc/build/assets/shared/pre_build.go
@@ -0,0 +1,91 @@
+package cmd
+
+import (
+ "fmt"
+ "path/filepath"
+ "plandex/api"
+ "plandex/auth"
+ "plandex/lib"
+ "plandex/term"
+
+ "github.com/plandex/plandex/shared"
+ "github.com/spf13/cobra"
+)
+
+var contextRmCmd = &cobra.Command{
+ Use: "rm",
+ Aliases: []string{"remove", "unload"},
+ Short: "Remove context",
+ Long: `Remove context by index, name, or glob.`,
+ Args: cobra.MinimumNArgs(1),
+ Run: contextRm,
+}
+
+func contextRm(cmd *cobra.Command, args []string) {
+ auth.MustResolveAuthWithOrg()
+ lib.MustResolveProject()
+
+ if lib.CurrentPlanId == "" {
+ fmt.Println("πŸ€·β€β™‚οΈ No current plan")
+ return
+ }
+
+ term.StartSpinner("")
+ contexts, err := api.Client.ListContext(lib.CurrentPlanId, lib.CurrentBranch)
+
+ if err != nil {
+ term.OutputErrorAndExit("Error retrieving context: %v", err)
+ }
+
+ deleteIds := map[string]bool{}
+
+ for i, context := range contexts {
+ for _, id := range args {
+ if fmt.Sprintf("%d", i+1) == id || context.Name == id || context.FilePath == id || context.Url == id {
+ deleteIds[context.Id] = true
+ break
+ } else if context.FilePath != "" {
+ // Check if id is a glob pattern
+ matched, err := filepath.Match(id, context.FilePath)
+ if err != nil {
+ term.OutputErrorAndExit("Error matching glob pattern: %v", err)
+ }
+ if matched {
+ deleteIds[context.Id] = true
+ break
+ }
+
+ // Check if id is a parent directory
+ parentDir := context.FilePath
+ for parentDir != "." && parentDir != "/" && parentDir != "" {
+ if parentDir == id {
+ deleteIds[context.Id] = true
+ break
+ }
+ parentDir = filepath.Dir(parentDir) // Move up one directory
+ }
+
+ }
+ }
+ }
+
+ if len(deleteIds) > 0 {
+ res, err := api.Client.DeleteContext(lib.CurrentPlanId, lib.CurrentBranch, shared.DeleteContextRequest{
+ Ids: deleteIds,
+ })
+ term.StopSpinner()
+
+ if err != nil {
+ term.OutputErrorAndExit("Error deleting context: %v", err)
+ }
+
+ fmt.Println("βœ… " + res.Msg)
+ } else {
+ term.StopSpinner()
+ fmt.Println("πŸ€·β€β™‚οΈ No context removed")
+ }
+}
+
+func init() {
+ RootCmd.AddCommand(contextRmCmd)
+}
diff --git a/test/evals/promptfoo-poc/build/build.config.properties b/test/evals/promptfoo-poc/build/build.config.properties
index fea41b87..28127414 100644
--- a/test/evals/promptfoo-poc/build/build.config.properties
+++ b/test/evals/promptfoo-poc/build/build.config.properties
@@ -1,7 +1,7 @@
provider_id=openai:gpt-4o
-function_name=
+function_name=listChangesWithLineNums
tool_type=function
function_param_type=object
tool_choice_type=function
-tool_choice_function_name=
+tool_choice_function_name=listChangesWithLineNums
nested_parameters_json=build.parameters.json
diff --git a/test/evals/promptfoo-poc/build/build.parameters.json b/test/evals/promptfoo-poc/build/build.parameters.json
index e69de29b..c03bddfb 100644
--- a/test/evals/promptfoo-poc/build/build.parameters.json
+++ b/test/evals/promptfoo-poc/build/build.parameters.json
@@ -0,0 +1,78 @@
+{
+ "type": "object",
+ "properties": {
+ "comments": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "txt": {
+ "type": "string"
+ },
+ "reference": {
+ "type": "boolean"
+ }
+ },
+ "required": ["txt", "reference"]
+ }
+ },
+ "problems": {
+ "type": "string"
+ },
+ "changes": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "summary": {
+ "type": "string"
+ },
+ "hasChange": {
+ "type": "boolean"
+ },
+ "old": {
+ "type": "object",
+ "properties": {
+ "entireFile": {
+ "type": "boolean"
+ },
+ "startLineString": {
+ "type": "string"
+ },
+ "endLineString": {
+ "type": "string"
+ }
+ },
+ "required": ["startLineString", "endLineString"]
+ },
+ "startLineIncludedReasoning": {
+ "type": "string"
+ },
+ "startLineIncluded": {
+ "type": "boolean"
+ },
+ "endLineIncludedReasoning": {
+ "type": "string"
+ },
+ "endLineIncluded": {
+ "type": "boolean"
+ },
+ "new": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "summary",
+ "hasChange",
+ "old",
+ "startLineIncludedReasoning",
+ "startLineIncluded",
+ "endLineIncludedReasoning",
+ "endLineIncluded",
+ "new"
+ ]
+ }
+ }
+ },
+ "required": ["comments", "problems", "changes"]
+}
\ No newline at end of file
diff --git a/test/evals/promptfoo-poc/build/build.provider.yml b/test/evals/promptfoo-poc/build/build.provider.yml
new file mode 100644
index 00000000..a91430f0
--- /dev/null
+++ b/test/evals/promptfoo-poc/build/build.provider.yml
@@ -0,0 +1,82 @@
+id: openai:gpt-4o
+config:
+ tools:
+ [
+ {
+ "type": "function",
+ "function":
+ {
+ "name": "listChangesWithLineNums",
+ "parameters":
+ {
+ "properties":
+ {
+ "changes":
+ {
+ "items":
+ {
+ "properties":
+ {
+ "endLineIncluded": { "type": "boolean" },
+ "endLineIncludedReasoning":
+ { "type": "string" },
+ "hasChange": { "type": "boolean" },
+ "new": { "type": "string" },
+ "old":
+ {
+ "properties":
+ {
+ "endLineString": { "type": "string" },
+ "entireFile": { "type": "boolean" },
+ "startLineString": { "type": "string" },
+ },
+ "required":
+ ["startLineString", "endLineString"],
+ "type": "object",
+ },
+ "startLineIncluded": { "type": "boolean" },
+ "startLineIncludedReasoning":
+ { "type": "string" },
+ "summary": { "type": "string" },
+ },
+ "required":
+ [
+ "summary",
+ "hasChange",
+ "old",
+ "startLineIncludedReasoning",
+ "startLineIncluded",
+ "endLineIncludedReasoning",
+ "endLineIncluded",
+ "new",
+ ],
+ "type": "object",
+ },
+ "type": "array",
+ },
+ "comments":
+ {
+ "items":
+ {
+ "properties":
+ {
+ "reference": { "type": "boolean" },
+ "txt": { "type": "string" },
+ },
+ "required": ["txt", "reference"],
+ "type": "object",
+ },
+ "type": "array",
+ },
+ "problems": { "type": "string" },
+ },
+ "required": ["comments", "problems", "changes"],
+ "type": "object",
+ },
+ },
+ },
+ ]
+ tool_choice:
+ type: "function"
+ function:
+ name: "listChangesWithLineNums"
diff --git a/test/evals/promptfoo-poc/build/promptfooconfig.yml b/test/evals/promptfoo-poc/build/promptfooconfig.yml
index 363f5bc5..dbce4996 100644
--- a/test/evals/promptfoo-poc/build/promptfooconfig.yml
+++ b/test/evals/promptfoo-poc/build/promptfooconfig.yml
@@ -2,8 +2,6 @@ description: "build"
prompts:
- file://build.prompt.txt
-
providers:
- file://build.provider.yml
-
tests: tests/*.tests.yml
diff --git a/test/evals/promptfoo-poc/build/tests/build.test.yml b/test/evals/promptfoo-poc/build/tests/build.test.yml
new file mode 100644
index 00000000..7e76ab57
--- /dev/null
+++ b/test/evals/promptfoo-poc/build/tests/build.test.yml
@@ -0,0 +1,19 @@
+- description: "Check Build with Line numbers"
+ vars:
+ preBuildState: file://assets/shared/pre_build.go
+ changes: file://assets/build/changes.md
+ filePath: parse.go
+ postBuildState: file://assets/build/post_build.go
+ assert:
+ - type: is-json
+ - type: is-valid-openai-tools-call
+ - type: javascript
+ value: |
+ var args = JSON.parse(output[0].function.arguments)
+ return (
+ args.changes.length > 0 &&
+ args.changes.some(
+ change => change.hasChange &&
+ change.new.includes("var contextRmCmd = &cobra.Command{")
+ )
+ )
diff --git a/test/evals/promptfoo-poc/fix/fix.config.properties b/test/evals/promptfoo-poc/fix/fix.config.properties
index 28127414..dc796603 100644
--- a/test/evals/promptfoo-poc/fix/fix.config.properties
+++ b/test/evals/promptfoo-poc/fix/fix.config.properties
@@ -4,4 +4,4 @@ tool_type=function
function_param_type=object
tool_choice_type=function
tool_choice_function_name=listChangesWithLineNums
-nested_parameters_json=build.parameters.json
+nested_parameters_json=fix.parameters.json
diff --git a/test/evals/promptfoo-poc/fix/fix.provider.yml b/test/evals/promptfoo-poc/fix/fix.provider.yml
index a91430f0..f760f6e8 100644
--- a/test/evals/promptfoo-poc/fix/fix.provider.yml
+++ b/test/evals/promptfoo-poc/fix/fix.provider.yml
@@ -5,75 +5,7 @@ config:
{
"type": "function",
"function":
- {
- "name": "listChangesWithLineNums",
- "parameters":
- {
- "properties":
- {
- "changes":
- {
- "items":
- {
- "properties":
- {
- "endLineIncluded": { "type": "boolean" },
- "endLineIncludedReasoning":
- { "type": "string" },
- "hasChange": { "type": "boolean" },
- "new": { "type": "string" },
- "old":
- {
- "properties":
- {
- "endLineString": { "type": "string" },
- "entireFile": { "type": "boolean" },
- "startLineString": { "type": "string" },
- },
- "required":
- ["startLineString", "endLineString"],
- "type": "object",
- },
- "startLineIncluded": { "type": "boolean" },
- "startLineIncludedReasoning":
- { "type": "string" },
- "summary": { "type": "string" },
- },
- "required":
- [
- "summary",
- "hasChange",
- "old",
- "startLineIncludedReasoning",
- "startLineIncluded",
- "endLineIncludedReasoning",
- "endLineIncluded",
- "new",
- ],
- "type": "object",
- },
- "type": "array",
- },
- "comments":
- {
- "items":
- {
- "properties":
- {
- "reference": { "type": "boolean" },
- "txt": { "type": "string" },
- },
- "required": ["txt", "reference"],
- "type": "object",
- },
- "type": "array",
- },
- "problems": { "type": "string" },
- },
- "required": ["comments", "problems", "changes"],
- "type": "object",
- },
- },
+ { "name": "listChangesWithLineNums", "parameters": {"properties":{"changes":{"items":{"properties":{"endLineIncluded":{"type":"boolean"},"endLineIncludedReasoning":{"type":"string"},"hasChange":{"type":"boolean"},"new":{"type":"string"},"old":{"properties":{"endLineString":{"type":"string"},"entireFile":{"type":"boolean"},"startLineString":{"type":"string"}},"required":["startLineString","endLineString"],"type":"object"},"startLineIncluded":{"type":"boolean"},"startLineIncludedReasoning":{"type":"string"},"summary":{"type":"string"}},"required":["summary","hasChange","old","startLineIncludedReasoning","startLineIncluded","endLineIncludedReasoning","endLineIncluded","new"],"type":"object"},"type":"array"},"comments":{"items":{"properties":{"reference":{"type":"boolean"},"txt":{"type":"string"}},"required":["txt","reference"],"type":"object"},"type":"array"},"problems":{"type":"string"}},"required":["comments","problems","changes"],"type":"object"} },
},
]
tool_choice:
diff --git a/test/evals/promptfoo-poc/verify/verify.provider.yml b/test/evals/promptfoo-poc/verify/verify.provider.yml
index 0db53932..a23b8ad4 100644
--- a/test/evals/promptfoo-poc/verify/verify.provider.yml
+++ b/test/evals/promptfoo-poc/verify/verify.provider.yml
@@ -5,66 +5,7 @@ config:
{
"type": "function",
"function":
- {
- "name": "verifyOutput",
- "parameters":
- {
- "properties":
- {
- "comments":
- {
- "items":
- {
- "properties":
- {
- "reference": { "type": "boolean" },
- "txt": { "type": "string" },
- },
- "required": ["txt", "reference"],
- "type": "object",
- },
- "type": "array",
- },
- "duplicationErrorsReasoning": { "type": "string" },
- "hasDuplicationErrors": { "type": "boolean" },
- "hasReferenceErrors": { "type": "boolean" },
- "hasRemovedCodeErrors": { "type": "boolean" },
- "hasSyntaxErrors": { "type": "boolean" },
- "referenceErrorsReasoning": { "type": "string" },
- "removed":
- {
- "items":
- {
- "properties":
- {
- "code": { "type": "string" },
- "correct": { "type": "boolean" },
- "reasoning": { "type": "string" },
- },
- "required": ["code", "reasoning", "correct"],
- "type": "object",
- },
- "type": "array",
- },
- "removedCodeErrorsReasoning": { "type": "string" },
- "syntaxErrorsReasoning": { "type": "string" },
- },
- "required":
- [
- "syntaxErrorsReasoning",
- "hasSyntaxErrors",
- "removed",
- "removedCodeErrorsReasoning",
- "hasRemovedCodeErrors",
- "duplicationErrorsReasoning",
- "hasDuplicationErrors",
- "comments",
- "referenceErrorsReasoning",
- "hasReferenceErrors",
- ],
- "type": "object",
- },
- },
+ { "name": "verifyOutput", "parameters": {"properties":{"comments":{"items":{"properties":{"reference":{"type":"boolean"},"txt":{"type":"string"}},"required":["txt","reference"],"type":"object"},"type":"array"},"duplicationErrorsReasoning":{"type":"string"},"hasDuplicationErrors":{"type":"boolean"},"hasReferenceErrors":{"type":"boolean"},"hasRemovedCodeErrors":{"type":"boolean"},"hasSyntaxErrors":{"type":"boolean"},"referenceErrorsReasoning":{"type":"string"},"removed":{"items":{"properties":{"code":{"type":"string"},"correct":{"type":"boolean"},"reasoning":{"type":"string"}},"required":["code","reasoning","correct"],"type":"object"},"type":"array"},"removedCodeErrorsReasoning":{"type":"string"},"syntaxErrorsReasoning":{"type":"string"}},"required":["syntaxErrorsReasoning","hasSyntaxErrors","removed","removedCodeErrorsReasoning","hasRemovedCodeErrors","duplicationErrorsReasoning","hasDuplicationErrors","comments","referenceErrorsReasoning","hasReferenceErrors"],"type":"object"} },
},
]
tool_choice: