Move prompts into embedded Markdown assets
This commit is contained in:
@@ -191,6 +191,13 @@ func TestGenerateCandidatesDiagnosticsIncludeSchemaMetadata(t *testing.T) {
|
||||
req := defaultRequest(t)
|
||||
req.LLMClient = client
|
||||
req.DiagnosticsWriter = diag
|
||||
req.PromptMetadata = map[string]any{
|
||||
"prompt_id": "modules.grammar.proposal",
|
||||
"prompt_version": "v1",
|
||||
"prompt_source": "builtin",
|
||||
"embedded_path": "assets/modules/grammar",
|
||||
"sha256": "abc",
|
||||
}
|
||||
|
||||
_, err := GenerateCandidates(context.Background(), req)
|
||||
if err != nil {
|
||||
@@ -208,6 +215,13 @@ func TestGenerateCandidatesDiagnosticsIncludeSchemaMetadata(t *testing.T) {
|
||||
if schemaMap["id"] != want.ID || schemaMap["version"] != want.Version || schemaMap["name"] != want.Name || schemaMap["sha256"] != want.SHA256 {
|
||||
t.Fatalf("unexpected diagnostics schema metadata: got=%v want=%+v", schemaMap, want)
|
||||
}
|
||||
promptMap, ok := metadata["prompt_metadata"].(map[string]any)
|
||||
if !ok {
|
||||
t.Fatalf("expected prompt_metadata map, got %T", metadata["prompt_metadata"])
|
||||
}
|
||||
if promptMap["prompt_id"] != "modules.grammar.proposal" || promptMap["prompt_version"] != "v1" || promptMap["prompt_source"] != "builtin" || promptMap["embedded_path"] != "assets/modules/grammar" || promptMap["sha256"] != "abc" {
|
||||
t.Fatalf("unexpected prompt metadata map: %v", promptMap)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGenerateCandidatesMalformedStructuredResponse(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user