From 72f1dc25fca772f9cf043893abda0ff4088cf6f5 Mon Sep 17 00:00:00 2001 From: leilei3167 Date: Sun, 25 Oct 2026 04:17:10 +0000 Subject: [PATCH] fix(gallery): render single-brace JSON in Llama 3.1 function examples The function templates stored the few-shot JSON sample inside a Go raw string that still had an extra pair of braces. text/template printed that literal, so the prompt showed {{"example_name": "example_value"}} and models copied invalid JSON. Fixes #12890 Signed-off-by: leilei3167 --- gallery/llama3.1-instruct-grammar.yaml | 2 +- gallery/llama3.1-instruct.yaml | 2 +- gallery/llama3.1-reflective.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gallery/llama3.1-instruct-grammar.yaml b/gallery/llama3.1-instruct-grammar.yaml index b918349379..d9b2af3c6b 100644 --- a/gallery/llama3.1-instruct-grammar.yaml +++ b/gallery/llama3.1-instruct-grammar.yaml @@ -40,7 +40,7 @@ config_file: | Think very carefully before calling functions. If a you choose to call a function ONLY reply in the following format with no prefix or suffix: - {{`{{"example_name": "example_value"}}`}} + {{`{"example_name": "example_value"}`}} Reminder: - If looking for real time information use relevant functions before falling back to searching on internet diff --git a/gallery/llama3.1-instruct.yaml b/gallery/llama3.1-instruct.yaml index 1d078f2b06..93408db135 100644 --- a/gallery/llama3.1-instruct.yaml +++ b/gallery/llama3.1-instruct.yaml @@ -38,7 +38,7 @@ config_file: | Think very carefully before calling functions. If a you choose to call a function ONLY reply in the following format with no prefix or suffix: - {{`{{"example_name": "example_value"}}`}} + {{`{"example_name": "example_value"}`}} Reminder: - If looking for real time information use relevant functions before falling back to searching on internet diff --git a/gallery/llama3.1-reflective.yaml b/gallery/llama3.1-reflective.yaml index 75f6edf2f0..a27dbaa481 100644 --- a/gallery/llama3.1-reflective.yaml +++ b/gallery/llama3.1-reflective.yaml @@ -40,7 +40,7 @@ config_file: | Think very carefully before calling functions. If a you choose to call a function ONLY reply in the following format with no prefix or suffix: - {{`{{"example_name": "example_value"}}`}} + {{`{"example_name": "example_value"}`}} Reminder: - If looking for real time information use relevant functions before falling back to searching on internet