Adopt PromptKit layered configuration sources
This commit is contained in:
@@ -5,15 +5,28 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
ck "gitea.maximumdirect.net/eric/ConfigKit"
|
||||
"gitea.maximumdirect.net/eric/audita/internal/framework/responseschema"
|
||||
pk "gitea.maximumdirect.net/eric/promptkit"
|
||||
)
|
||||
|
||||
func TestEmbeddedDefinitionsPrepareThroughPromptKit(t *testing.T) {
|
||||
engine, err := pk.NewEngine(pk.Config{},
|
||||
pk.WithPromptFS(Filesystem(), AssetRoot),
|
||||
promptInputs, err := pk.FilesystemInputs("embedded prompts", Filesystem(), AssetRoot)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
endpoint := "https://example.invalid/v1"
|
||||
model := "fixture-model"
|
||||
sources := pk.ConfigurationSources{
|
||||
Underlays: []ck.Underlay{
|
||||
{Inputs: promptInputs},
|
||||
{Inputs: []ck.Input{{Source: pk.ProfileSource("registry fixture profile", map[string]pk.ProfileConfig{
|
||||
"fixture": {Endpoint: &endpoint, Model: &model},
|
||||
})}}},
|
||||
},
|
||||
}
|
||||
engine, err := pk.NewEngine(pk.Config{Sources: sources},
|
||||
pk.WithSchemaFS(responseschema.Filesystem(), responseschema.AssetRoot),
|
||||
pk.WithProfiles(pk.Profile{ID: "fixture", Endpoint: "https://example.invalid/v1", Model: "fixture-model"}),
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
||||
Reference in New Issue
Block a user