# auto (from_token_zero)
sequence
  tag `` text excluding [`<|close|>think<|sep|>`, `<|end_of_msg|>`] `<|close|>think<|sep|>`
  or
    sequence
      tag `<|open|>response<|sep|>` text excluding [`<|open|>`, `<|close|>`, `<|end_of_msg|>`] `<|close|>response<|sep|>`
      optional
        tag `<|open|>tools<|sep|>` .. `<|close|>tools<|sep|>`
          tags_with_separator `` at_least_one
            tag `<|open|>call tool="get_weather" index="` .. `<|close|>call<|sep|>`
              sequence
                /[1-9][0-9]*/
                `"<|sep|>`
                or
                  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
                  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|>`
    tag `<|open|>tools<|sep|>` .. `<|close|>tools<|sep|>`
      tags_with_separator `` at_least_one
        tag `<|open|>call tool="get_weather" index="` .. `<|close|>call<|sep|>`
          sequence
            /[1-9][0-9]*/
            `"<|sep|>`
            or
              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
              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|>`

# required (from_token_zero)
sequence
  tag `` text excluding [`<|close|>think<|sep|>`, `<|end_of_msg|>`] `<|close|>think<|sep|>`
  sequence
    optional tag `<|open|>response<|sep|>` text excluding [`<|open|>`, `<|close|>`, `<|end_of_msg|>`] `<|close|>response<|sep|>`
    tag `<|open|>tools<|sep|>` .. `<|close|>tools<|sep|>`
      tags_with_separator `` at_least_one
        tag `<|open|>call tool="get_weather" index="` .. `<|close|>call<|sep|>`
          sequence
            /[1-9][0-9]*/
            `"<|sep|>`
            or
              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
              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|>`

# named (from_token_zero)
sequence
  tag `` text excluding [`<|close|>think<|sep|>`, `<|end_of_msg|>`] `<|close|>think<|sep|>`
  sequence
    optional tag `<|open|>response<|sep|>` text excluding [`<|open|>`, `<|close|>`, `<|end_of_msg|>`] `<|close|>response<|sep|>`
    tag `<|open|>tools<|sep|>` .. `<|close|>tools<|sep|>`
      tags_with_separator `` at_least_one stop_after_first
        tag `<|open|>call tool="get_weather" index="` .. `<|close|>call<|sep|>`
          sequence
            /[1-9][0-9]*/
            `"<|sep|>`
            or
              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|>`

# none_schema (from_token_zero)
sequence
  tag `` text excluding [`<|close|>think<|sep|>`, `<|end_of_msg|>`] `<|close|>think<|sep|>`
  tag `<|open|>response<|sep|>` json({ answer: string }) `<|close|>response<|sep|>`
  optional `<|close|>message<|sep|>`

# auto_schema_content, auto_schema_calls (from_token_zero)
sequence
  tag `` text excluding [`<|close|>think<|sep|>`, `<|end_of_msg|>`] `<|close|>think<|sep|>`
  or
    sequence
      tag `<|open|>response<|sep|>` json({ answer: string }) `<|close|>response<|sep|>`
      optional
        tag `<|open|>tools<|sep|>` .. `<|close|>tools<|sep|>`
          tags_with_separator `` at_least_one
            tag `<|open|>call tool="get_weather" index="` .. `<|close|>call<|sep|>`
              sequence
                /[1-9][0-9]*/
                `"<|sep|>`
                or
                  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
                  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|>`
    sequence
      optional `<|open|>response<|sep|><|close|>response<|sep|>`
      tag `<|open|>tools<|sep|>` .. `<|close|>tools<|sep|>`
        tags_with_separator `` at_least_one
          tag `<|open|>call tool="get_weather" index="` .. `<|close|>call<|sep|>`
            sequence
              /[1-9][0-9]*/
              `"<|sep|>`
              or
                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
                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|>`
