Migrate facade tests to the new configuration contracts
This commit is contained in:
@@ -11,6 +11,14 @@ import (
|
||||
"go.maximumdirect.net/promptkit"
|
||||
)
|
||||
|
||||
func mountSettingsInputs(inputs []configkit.Input) []configkit.Input {
|
||||
result := append([]configkit.Input(nil), inputs...)
|
||||
for i := range result {
|
||||
result[i].Destination = configkit.Keys("promptkit")
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
type fakeLLMClient struct {
|
||||
response *promptkit.GenerateResponse
|
||||
responses []*promptkit.GenerateResponse
|
||||
@@ -59,7 +67,7 @@ func newSimpleEngine(t *testing.T, content string, options ...promptkit.Option)
|
||||
|
||||
func simpleConfig(content string) promptkit.Config {
|
||||
return promptkit.Config{Sources: promptkit.ConfigurationSources{
|
||||
Main: &configkit.Input{Source: configkit.Mapping("consumer test", map[string]any{
|
||||
Main: &configkit.Input{Destination: configkit.Keys("promptkit"), Source: configkit.Mapping("consumer test", map[string]any{
|
||||
"profiles": []any{map[string]any{"id": "profile",
|
||||
"endpoint": "http://example.test/v1", "model": "model",
|
||||
}},
|
||||
|
||||
Reference in New Issue
Block a user