Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
265 changes: 125 additions & 140 deletions rust/src/chat/tests/grammar_replay/Kimi-K3.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,18 @@
"type": "or",
"elements": [
{
"type": "plus",
"type": "tag",
"begin": "<|open|>argument key=\"location\" type=\"string\"<|sep|>",
"content": {
"type": "tag",
"begin": "<|open|>argument key=\"location\" type=\"string\"<|sep|>",
"content": {
"type": "any_text",
"excludes": [
"<|close|>argument<|sep|>",
"<|close|>call<|sep|>"
],
"max_tokens": null,
"max_chars": null
},
"end": "<|close|>argument<|sep|>"
}
"type": "any_text",
"excludes": [
"<|close|>argument<|sep|>",
"<|close|>call<|sep|>"
],
"max_tokens": null,
"max_chars": null
},
"end": "<|close|>argument<|sep|>"
},
{
"type": "tag",
Expand Down Expand Up @@ -119,60 +116,57 @@
"type": "or",
"elements": [
{
"type": "plus",
"content": {
"type": "or",
"elements": [
{
"type": "tag",
"begin": "<|open|>argument key=\"y\" type=\"number\"<|sep|>",
"content": {
"type": "json_schema",
"json_schema": {
"type": "number"
},
"style": "json",
"any_order": false,
"max_whitespace_cnt": null,
"excludes": []
"type": "sequence",
"elements": [
{
"type": "tag",
"begin": "<|open|>argument key=\"y\" type=\"number\"<|sep|>",
"content": {
"type": "json_schema",
"json_schema": {
"type": "number"
},
"end": "<|close|>argument<|sep|>"
"style": "json",
"any_order": false,
"max_whitespace_cnt": null,
"excludes": []
},
{
"type": "tag",
"begin": "<|open|>argument key=\"x\" type=\"number\"<|sep|>",
"content": {
"type": "json_schema",
"json_schema": {
"type": "number"
},
"style": "json",
"any_order": false,
"max_whitespace_cnt": null,
"excludes": []
"end": "<|close|>argument<|sep|>"
},
{
"type": "tag",
"begin": "<|open|>argument key=\"x\" type=\"number\"<|sep|>",
"content": {
"type": "json_schema",
"json_schema": {
"type": "number"
},
"end": "<|close|>argument<|sep|>"
"style": "json",
"any_order": false,
"max_whitespace_cnt": null,
"excludes": []
},
{
"type": "tag",
"begin": "<|open|>argument key=\"items\" type=\"array\"<|sep|>",
"content": {
"type": "json_schema",
"json_schema": {
"type": "array",
"items": {
"type": "string"
}
},
"style": "json",
"any_order": false,
"max_whitespace_cnt": null,
"excludes": []
"end": "<|close|>argument<|sep|>"
},
{
"type": "tag",
"begin": "<|open|>argument key=\"items\" type=\"array\"<|sep|>",
"content": {
"type": "json_schema",
"json_schema": {
"type": "array",
"items": {
"type": "string"
}
},
"end": "<|close|>argument<|sep|>"
}
]
}
"style": "json",
"any_order": false,
"max_whitespace_cnt": null,
"excludes": []
},
"end": "<|close|>argument<|sep|>"
}
]
},
{
"type": "tag",
Expand Down Expand Up @@ -287,21 +281,18 @@
"type": "or",
"elements": [
{
"type": "plus",
"type": "tag",
"begin": "<|open|>argument key=\"location\" type=\"string\"<|sep|>",
"content": {
"type": "tag",
"begin": "<|open|>argument key=\"location\" type=\"string\"<|sep|>",
"content": {
"type": "any_text",
"excludes": [
"<|close|>argument<|sep|>",
"<|close|>call<|sep|>"
],
"max_tokens": null,
"max_chars": null
},
"end": "<|close|>argument<|sep|>"
}
"type": "any_text",
"excludes": [
"<|close|>argument<|sep|>",
"<|close|>call<|sep|>"
],
"max_tokens": null,
"max_chars": null
},
"end": "<|close|>argument<|sep|>"
},
{
"type": "tag",
Expand Down Expand Up @@ -350,60 +341,57 @@
"type": "or",
"elements": [
{
"type": "plus",
"content": {
"type": "or",
"elements": [
{
"type": "tag",
"begin": "<|open|>argument key=\"y\" type=\"number\"<|sep|>",
"content": {
"type": "json_schema",
"json_schema": {
"type": "number"
},
"style": "json",
"any_order": false,
"max_whitespace_cnt": null,
"excludes": []
"type": "sequence",
"elements": [
{
"type": "tag",
"begin": "<|open|>argument key=\"y\" type=\"number\"<|sep|>",
"content": {
"type": "json_schema",
"json_schema": {
"type": "number"
},
"end": "<|close|>argument<|sep|>"
"style": "json",
"any_order": false,
"max_whitespace_cnt": null,
"excludes": []
},
{
"type": "tag",
"begin": "<|open|>argument key=\"x\" type=\"number\"<|sep|>",
"content": {
"type": "json_schema",
"json_schema": {
"type": "number"
},
"style": "json",
"any_order": false,
"max_whitespace_cnt": null,
"excludes": []
"end": "<|close|>argument<|sep|>"
},
{
"type": "tag",
"begin": "<|open|>argument key=\"x\" type=\"number\"<|sep|>",
"content": {
"type": "json_schema",
"json_schema": {
"type": "number"
},
"end": "<|close|>argument<|sep|>"
"style": "json",
"any_order": false,
"max_whitespace_cnt": null,
"excludes": []
},
{
"type": "tag",
"begin": "<|open|>argument key=\"items\" type=\"array\"<|sep|>",
"content": {
"type": "json_schema",
"json_schema": {
"type": "array",
"items": {
"type": "string"
}
},
"style": "json",
"any_order": false,
"max_whitespace_cnt": null,
"excludes": []
"end": "<|close|>argument<|sep|>"
},
{
"type": "tag",
"begin": "<|open|>argument key=\"items\" type=\"array\"<|sep|>",
"content": {
"type": "json_schema",
"json_schema": {
"type": "array",
"items": {
"type": "string"
}
},
"end": "<|close|>argument<|sep|>"
}
]
}
"style": "json",
"any_order": false,
"max_whitespace_cnt": null,
"excludes": []
},
"end": "<|close|>argument<|sep|>"
}
]
},
{
"type": "tag",
Expand Down Expand Up @@ -517,21 +505,18 @@
"type": "or",
"elements": [
{
"type": "plus",
"type": "tag",
"begin": "<|open|>argument key=\"location\" type=\"string\"<|sep|>",
"content": {
"type": "tag",
"begin": "<|open|>argument key=\"location\" type=\"string\"<|sep|>",
"content": {
"type": "any_text",
"excludes": [
"<|close|>argument<|sep|>",
"<|close|>call<|sep|>"
],
"max_tokens": null,
"max_chars": null
},
"end": "<|close|>argument<|sep|>"
}
"type": "any_text",
"excludes": [
"<|close|>argument<|sep|>",
"<|close|>call<|sep|>"
],
"max_tokens": null,
"max_chars": null
},
"end": "<|close|>argument<|sep|>"
},
{
"type": "tag",
Expand Down
24 changes: 11 additions & 13 deletions rust/src/chat/tests/grammar_replay/Kimi-K3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@ sequence
/[1-9][0-9]*/
`"<|sep|>`
or
plus tag `<|open|>argument key="location" type="string"<|sep|>` text excluding [`<|close|>argument<|sep|>`, `<|close|>call<|sep|>`] `<|close|>argument<|sep|>`
tag `<|open|>argument key="location" type="string"<|sep|>` text excluding [`<|close|>argument<|sep|>`, `<|close|>call<|sep|>`] `<|close|>argument<|sep|>`
tag `<|open|>json type="object"<|sep|>` json({ location: string }) `<|close|>json<|sep|>`
tag `<|open|>call tool="add" index="` .. `<|close|>call<|sep|>`
sequence
/[1-9][0-9]*/
`"<|sep|>`
or
plus
or
tag `<|open|>argument key="y" type="number"<|sep|>` json(number) `<|close|>argument<|sep|>`
tag `<|open|>argument key="x" type="number"<|sep|>` json(number) `<|close|>argument<|sep|>`
tag `<|open|>argument key="items" type="array"<|sep|>` json(string[]) `<|close|>argument<|sep|>`
sequence
tag `<|open|>argument key="y" type="number"<|sep|>` json(number) `<|close|>argument<|sep|>`
tag `<|open|>argument key="x" type="number"<|sep|>` json(number) `<|close|>argument<|sep|>`
tag `<|open|>argument key="items" type="array"<|sep|>` json(string[]) `<|close|>argument<|sep|>`
tag `<|open|>json type="object"<|sep|>` json({ y: number, x: number, items: string[] }) `<|close|>json<|sep|>`
optional `<|close|>message<|sep|>`

Expand All @@ -36,18 +35,17 @@ sequence
/[1-9][0-9]*/
`"<|sep|>`
or
plus tag `<|open|>argument key="location" type="string"<|sep|>` text excluding [`<|close|>argument<|sep|>`, `<|close|>call<|sep|>`] `<|close|>argument<|sep|>`
tag `<|open|>argument key="location" type="string"<|sep|>` text excluding [`<|close|>argument<|sep|>`, `<|close|>call<|sep|>`] `<|close|>argument<|sep|>`
tag `<|open|>json type="object"<|sep|>` json({ location: string }) `<|close|>json<|sep|>`
tag `<|open|>call tool="add" index="` .. `<|close|>call<|sep|>`
sequence
/[1-9][0-9]*/
`"<|sep|>`
or
plus
or
tag `<|open|>argument key="y" type="number"<|sep|>` json(number) `<|close|>argument<|sep|>`
tag `<|open|>argument key="x" type="number"<|sep|>` json(number) `<|close|>argument<|sep|>`
tag `<|open|>argument key="items" type="array"<|sep|>` json(string[]) `<|close|>argument<|sep|>`
sequence
tag `<|open|>argument key="y" type="number"<|sep|>` json(number) `<|close|>argument<|sep|>`
tag `<|open|>argument key="x" type="number"<|sep|>` json(number) `<|close|>argument<|sep|>`
tag `<|open|>argument key="items" type="array"<|sep|>` json(string[]) `<|close|>argument<|sep|>`
tag `<|open|>json type="object"<|sep|>` json({ y: number, x: number, items: string[] }) `<|close|>json<|sep|>`
optional `<|close|>message<|sep|>`

Expand All @@ -62,6 +60,6 @@ sequence
/[1-9][0-9]*/
`"<|sep|>`
or
plus tag `<|open|>argument key="location" type="string"<|sep|>` text excluding [`<|close|>argument<|sep|>`, `<|close|>call<|sep|>`] `<|close|>argument<|sep|>`
tag `<|open|>argument key="location" type="string"<|sep|>` text excluding [`<|close|>argument<|sep|>`, `<|close|>call<|sep|>`] `<|close|>argument<|sep|>`
tag `<|open|>json type="object"<|sep|>` json({ location: string }) `<|close|>json<|sep|>`
optional `<|close|>message<|sep|>`
Loading
Loading