Bind schema selections throughout execution

This commit is contained in:
2026-11-20 15:36:44 +00:00
parent 2d96dfa696
commit 6fbbaa9cfa
20 changed files with 218 additions and 66 deletions

View File

@@ -12,6 +12,7 @@ import (
"strings"
"sync"
"testing"
"testing/fstest"
"time"
"go.maximumdirect.net/configkit"
@@ -308,7 +309,10 @@ type failingSchemaFS struct {
calls int
}
func (source *failingSchemaFS) Open(string) (fs.File, error) {
func (source *failingSchemaFS) Open(name string) (fs.File, error) {
if name == "." {
return (fstest.MapFS{}).Open(name)
}
source.mu.Lock()
source.calls++
source.mu.Unlock()
@@ -346,8 +350,8 @@ func TestSmokeTestUsesPrivateInferenceWithoutApplicationResourcesOrListingChange
},
}},
})}
engine, err := promptkit.NewEngine(promptkit.Config{Sources: promptkit.ConfigurationSources{Main: &input}},
promptkit.WithLLMClient(client), promptkit.WithArtifactReader(reader), promptkit.WithSchemaFS(schemaSource, "schemas"))
engine, err := promptkit.NewEngine(promptkit.Config{Sources: promptkit.ConfigurationSources{Main: &input, Underlays: []configkit.Underlay{{Inputs: []configkit.Input{schemaRootInput(schemaSource, "schemas")}}}}},
promptkit.WithLLMClient(client), promptkit.WithArtifactReader(reader))
if err != nil {
t.Fatalf("construct engine: %v", err)
}