Cut over public engine construction to ConfigKit sources

This commit is contained in:
2026-09-30 03:18:49 +00:00
parent 17b6c7bca5
commit ba9c972faa
37 changed files with 1653 additions and 1423 deletions

View File

@@ -13,6 +13,7 @@ import (
"time"
"gitea.maximumdirect.net/eric/promptkit"
"gitea.maximumdirect.net/eric/promptkit/testfixture"
)
func TestPreparedExecutionFreezesSourcesAndReturnsIndependentDetails(t *testing.T) {
@@ -26,10 +27,10 @@ func TestPreparedExecutionFreezesSourcesAndReturnsIndependentDetails(t *testing.
client := &preparedRecordingClient{
response: &promptkit.GenerateResponse{Content: `{"value":3}`},
}
engine, err := promptkit.NewEngine(
promptkit.Config{},
promptkit.WithPromptFS(promptSource, "."),
promptkit.WithProfileFS(profileSource, "."),
engine, err := testfixture.NewEngine(
testfixture.Config{},
testfixture.WithPromptFS(promptSource, "."),
testfixture.WithProfileFS(profileSource, "."),
promptkit.WithSchemaFS(schemaSource, "."),
promptkit.WithArtifactReader(reader),
promptkit.WithLLMClient(client),
@@ -430,10 +431,10 @@ func TestPreparedExecutionDiscardAndFormattingDoNotExposePrivateState(t *testing
client := &preparedRecordingClient{
response: &promptkit.GenerateResponse{Content: "generated output"},
}
engine, err := promptkit.NewEngine(
promptkit.Config{},
promptkit.WithPromptFS(contractPromptFS("prepared", "profile", renderedContent), "."),
promptkit.WithProfiles(promptkit.Profile{
engine, err := testfixture.NewEngine(
testfixture.Config{},
testfixture.WithPromptFS(contractPromptFS("prepared", "profile", renderedContent), "."),
testfixture.WithProfiles(testfixture.Profile{
ID: "profile",
Endpoint: "http://example.test/v1",
Model: "model",
@@ -564,10 +565,10 @@ func TestPreparedExecutionCredentialCapacityAndTimingBoundaries(t *testing.T) {
client := &preparedRecordingClient{
response: &promptkit.GenerateResponse{Content: "unexpected"},
}
engine, err := promptkit.NewEngine(
promptkit.Config{},
promptkit.WithPromptFS(contractPromptFS("prepared", "profile", "content"), "."),
promptkit.WithProfiles(promptkit.Profile{
engine, err := testfixture.NewEngine(
testfixture.Config{},
testfixture.WithPromptFS(contractPromptFS("prepared", "profile", "content"), "."),
testfixture.WithProfiles(testfixture.Profile{
ID: "profile",
Endpoint: "http://example.test/v1",
Model: "model",
@@ -766,10 +767,10 @@ func newPreparedContractEngine(
message string,
) *promptkit.Engine {
t.Helper()
engine, err := promptkit.NewEngine(
promptkit.Config{},
promptkit.WithPromptFS(contractPromptFS("prepared", "profile", message), "."),
promptkit.WithProfiles(promptkit.Profile{
engine, err := testfixture.NewEngine(
testfixture.Config{},
testfixture.WithPromptFS(contractPromptFS("prepared", "profile", message), "."),
testfixture.WithProfiles(testfixture.Profile{
ID: "profile",
Endpoint: "http://example.test/v1",
Model: "model",