Use prompt-defined structured output contracts

This commit is contained in:
2026-11-23 04:32:15 +00:00
parent 9977cd9130
commit 6ca5f89356
31 changed files with 299 additions and 445 deletions

View File

@@ -123,7 +123,7 @@ func TestGlossaryModuleProposeMapsCorrectionsAndWritesDiagnostics(t *testing.T)
t.Fatalf("expected one glossary:proposal call, got %+v", client.calls)
}
call := client.calls[0]
if call.Schema != "correction_set" || call.Context.Role != "proposal" || !strings.Contains(call.Variables["SectionJSON"], "section_index") || !strings.Contains(call.Variables["GlossaryJSON"], "Jesters") {
if call.Context.Role != "proposal" || !strings.Contains(call.Variables["SectionJSON"], "section_index") || !strings.Contains(call.Variables["GlossaryJSON"], "Jesters") {
t.Fatalf("proposal mapping incomplete: %+v", call)
}

View File

@@ -133,7 +133,7 @@ func TestGrammarModuleProposeMapsCorrectionsAndWritesDiagnostics(t *testing.T) {
t.Fatalf("expected one grammar:proposal call, got %+v", client.calls)
}
call := client.calls[0]
if call.Schema != "correction_set" || call.Context.Role != "proposal" || !strings.Contains(call.Variables["SectionJSON"], "section_index") || !strings.Contains(call.Variables["GlossaryJSON"], "Jesters") {
if call.Context.Role != "proposal" || !strings.Contains(call.Variables["SectionJSON"], "section_index") || !strings.Contains(call.Variables["GlossaryJSON"], "Jesters") {
t.Fatalf("proposal mapping incomplete: %+v", call)
}

View File

@@ -124,7 +124,7 @@ func TestHomophonesModuleProposeMapsCorrectionsAndWritesDiagnostics(t *testing.T
t.Fatalf("expected one homophones:proposal call, got %+v", client.calls)
}
call := client.calls[0]
if call.Schema != "correction_set" || call.Context.Role != "proposal" || !strings.Contains(call.Variables["SectionJSON"], "section_index") || !strings.Contains(call.Variables["GlossaryJSON"], "Jesters") {
if call.Context.Role != "proposal" || !strings.Contains(call.Variables["SectionJSON"], "section_index") || !strings.Contains(call.Variables["GlossaryJSON"], "Jesters") {
t.Fatalf("proposal mapping incomplete: %+v", call)
}

View File

@@ -124,7 +124,7 @@ func TestSpokenWordModuleProposeMapsCorrectionsAndWritesDiagnostics(t *testing.T
t.Fatalf("expected one spoken_word:proposal call, got %+v", client.calls)
}
call := client.calls[0]
if call.Schema != "correction_set" || call.Context.Role != "proposal" || !strings.Contains(call.Variables["SectionJSON"], "section_index") || !strings.Contains(call.Variables["GlossaryJSON"], "Jesters") {
if call.Context.Role != "proposal" || !strings.Contains(call.Variables["SectionJSON"], "section_index") || !strings.Contains(call.Variables["GlossaryJSON"], "Jesters") {
t.Fatalf("proposal mapping incomplete: %+v", call)
}