Skip to content

Commit 970bfae

Browse files
authored
Merge pull request #16 from tinyhumansai/code-tool-dialect
Add code-style tool-call dialect (Python / TypeScript)
2 parents c95f872 + 369cd3d commit 970bfae

23 files changed

Lines changed: 2257 additions & 19 deletions

File tree

‎Cargo.lock‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ exclude = ["worktrees"]
1414
# true`, so the version the release workflow bumps is written in exactly one
1515
# place and every crate moves together.
1616
[workspace.package]
17-
version = "0.3.0"
17+
version = "0.4.0"
1818
edition = "2024"
1919
rust-version = "1.88"
2020
license = "GPL-3.0-only"

‎crates/tinytools-agent/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ readme = "README.md"
1414
regex = { workspace = true }
1515
serde = { workspace = true }
1616
serde_json = { workspace = true }
17-
tinytools = { path = "../tinytools", version = "0.3.0" }
17+
tinytools = { path = "../tinytools", version = "0.4.0" }
1818
tracing = { workspace = true, optional = true }
1919

2020
[features]

‎crates/tinytools-agent/README.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ and the unknown-tool policy remain the consuming harness's or host's.
1818
| `repair` | `json::recover_object` (relaxed / damaged JSON), `name::resolve` (damaged tool names against the offered set), `args` (aliases, envelopes, schema-guided coercion) |
1919
| `stream` | `StreamScrubber`: the same grammars applied to a live text stream, releasing safe text and completed calls as they arrive |
2020
| `render` | the catalogue, the protocol block for each dialect, the `<tool_result>` envelope and transcript replay |
21-
| `dialect` | `ToolDialect` binding one rendering to one parser: `XmlDialect`, `PFormatDialect`, `NativeDialect` |
21+
| `codecall` | `parse_calls(body, &registry)`: Python / TypeScript function calls, and `render_code_signature` for the catalogue |
22+
| `dialect` | `ToolDialect` binding one rendering to one parser: `XmlDialect`, `PFormatDialect`, `CodeDialect`, `NativeDialect` |
2223
| `types` | `ParsedToolCall`, `CallSource`, `ParseOptions`, `ParseOutcome`, `ParseDiagnostic` |
2324

2425
## Grammars
@@ -33,6 +34,7 @@ and the unknown-tool policy remain the consuming harness's or host's.
3334
| `Glm` | `tool/param>value` lines | GLM |
3435
| `BareJson` | the whole response is one object / `tool_calls` envelope | Minimax gateways, `llama3.2:3b` under `tool_choice: required` |
3536
| `PFormat` | `name[0\|value]` inside a tag, registry-gated | any prompted model |
37+
| `Code` | `name(arg="value")` / `name({arg: "value"})` inside a tag, registry-gated; literals only, all-or-nothing per body | any code-trained model |
3638

3739
Adding a grammar is one file under `src/parse/grammar/` and one entry in
3840
`GRAMMARS`; batch parsing, streaming, and every dialect pick it up.

0 commit comments

Comments
 (0)