Update public configuration and inventory contracts
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
func TestInspectProfileUsesLiteralFileKeyForPreparation(t *testing.T) {
|
||||
profiles, err := promptkit.FilesystemInputs("literal profile", fstest.MapFS{
|
||||
"config/profile.yaml": &fstest.MapFile{Data: []byte("profiles:\n ' literal ':\n endpoint: https://example.test/v1\n model: model\n")},
|
||||
"config/profile.yaml": &fstest.MapFile{Data: []byte("profiles:\n - id: ' literal '\n endpoint: https://example.test/v1\n model: model\n")},
|
||||
}, "config")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -20,8 +20,8 @@ func TestInspectProfileUsesLiteralFileKeyForPreparation(t *testing.T) {
|
||||
engine, err := promptkit.NewEngine(promptkit.Config{Sources: promptkit.ConfigurationSources{
|
||||
Underlays: []configkit.Underlay{{Inputs: profiles}},
|
||||
Main: &configkit.Input{Source: configkit.Mapping("prompt", map[string]any{
|
||||
"prompts": map[string]any{"prompt": map[string]any{
|
||||
"version": "1",
|
||||
"prompts": []any{map[string]any{
|
||||
"id": "prompt",
|
||||
"default_profile": " literal ",
|
||||
"messages": []any{map[string]any{"role": "user", "content": "hello"}},
|
||||
"output": map[string]any{"format": "text", "validation_mode": "none"},
|
||||
@@ -50,8 +50,8 @@ func TestInspectProfileUsesLiteralFileKeyForPreparation(t *testing.T) {
|
||||
func TestInspectProfileIsIndependentAndDoesNotInvokeProvider(t *testing.T) {
|
||||
client := &fakeLLMClient{response: &promptkit.GenerateResponse{Content: "unexpected"}}
|
||||
engine, err := promptkit.NewEngine(promptkit.Config{Sources: promptkit.ConfigurationSources{Main: &configkit.Input{
|
||||
Source: configkit.Mapping("inspection", map[string]any{"profiles": map[string]any{
|
||||
"profile": map[string]any{
|
||||
Source: configkit.Mapping("inspection", map[string]any{"profiles": []any{
|
||||
map[string]any{"id": "profile",
|
||||
"endpoint": "https://example.test/v1", "model": "model", "api_key_required": true,
|
||||
"extra_params": map[string]any{"nested": map[string]any{"value": "original"}},
|
||||
},
|
||||
@@ -77,7 +77,7 @@ func TestInspectProfilePublicErrorsAndPartialTarget(t *testing.T) {
|
||||
t.Fatalf("nil engine: %v", err)
|
||||
}
|
||||
engine, err := promptkit.NewEngine(promptkit.Config{Sources: promptkit.ConfigurationSources{Main: &configkit.Input{
|
||||
Source: configkit.Mapping("partial", map[string]any{"profiles": map[string]any{"profile": map[string]any{"model": "model"}}}),
|
||||
Source: configkit.Mapping("partial", map[string]any{"profiles": []any{map[string]any{"id": "profile", "model": "model"}}}),
|
||||
}}})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
||||
Reference in New Issue
Block a user