core/text: typed argument tags, a format whose argument tag says JSON or string

RadChatFormat/ChatFormat gain arg_json_value_prefix, a second value prefix written in place of
arg_value_prefix before a JSON value (DeepSeek-V4.1's DSML: string="false" before JSON,
string="true" before text). The tag the reply writes decides how its value is read, for declared
and undeclared names alike, and JSON that does not parse is kept as its text; the grammar writes
the tag each argument's schema calls for and either for an undeclared name. The field sits at the
end of the struct, so an older plugin's shorter struct reads as unset and nothing changes for it.
chat_format_check refuses a typed format without both prefixes, with prefixes not told apart, or
with string-typed other values.

Tests: reading, streaming at every truncation, grammar arms per schema, refusals, ABI tail.
This commit is contained in:
baKon authored and StillDeadcode committed 2026-10-27 18:16:26 +01:00
1 parent 70639f7ea2
commit fe27edb4da
7 files changed
+289 -28

No files matched your search

+3 -1
View File
@@ -1401,7 +1401,9 @@ derived from it: the reply parser, the lazy tool-call grammar and its trigger wo
tokens the decoder must render as text.
There are two families of call syntax. In the tagged family each argument has its own tags (Qwen's
`<parameter=NAME>`, MiniCPM's `<param name="NAME">`) and is typed by the tool's schema. In the
`<parameter=NAME>`, MiniCPM's `<param name="NAME">`) and is typed by the tool's schema, or by its
own tag where the format's tag says the type (DeepSeek-V4.1's DSML writes `string="true"` before
text and `string="false"` before JSON; the grammar writes the tag the schema calls for). In the
object family a call is its name and one object holding the arguments: JSON, or a dialect with
strings between declared delimiters and bare keys, as Gemma 4 writes
`call:NAME{path:<|"|>/a<|"|>,limit:3}`; values carry their own types.