okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221Merge f-q4-intake (37e91bfdb): tools/qwen4_intake.py, the tokenizer refuses an unknown pre-tokenizer, the server's tool-call parser follows the chat template (serve/toolformat.py), packaging/make_model_release.py dry run (Qwen4 prep)97a50dc24

main
5.7 KiB284 linesraw
1{
2 "tools": [
3  {
4   "name": "get_weather",
5   "parameters": {
6    "type": "object",
7    "properties": {
8     "city": {
9      "type": "string"
10     },
11     "days": {
12      "type": "integer"
13     }
14    }
15   }
16  },
17  {
18   "name": "write_file",
19   "parameters": {
20    "type": "object",
21    "properties": {
22     "path": {
23      "type": "string"
24     },
25     "content": {
26      "type": "string"
27     }
28    }
29   }
30  }
31 ],
32 "xml": [
33  {
34   "name": "text only",
35   "input": "Hello there.\nNothing to call.",
36   "thinking": false,
37   "events": [
38    [
39     "content",
40     "Hello there.\nNothing to call.",
41     null,
42     null
43    ]
44   ]
45  },
46  {
47   "name": "one call",
48   "input": "<tool_call>\n<function=get_weather>\n<parameter=city>\nParis\n</parameter>\n<parameter=days>\n3\n</parameter>\n</function>\n</tool_call>",
49   "thinking": false,
50   "events": [
51    [
52     "tool_call",
53     "",
54     "get_weather",
55     {
56      "city": "Paris",
57      "days": 3
58     }
59    ]
60   ]
61  },
62  {
63   "name": "text then call",
64   "input": "Let me check.\n\n<tool_call>\n<function=get_weather>\n<parameter=city>\nRome\n</parameter>\n</function>\n</tool_call>",
65   "thinking": false,
66   "events": [
67    [
68     "content",
69     "Let me check.",
70     null,
71     null
72    ],
73    [
74     "tool_call",
75     "",
76     "get_weather",
77     {
78      "city": "Rome"
79     }
80    ]
81   ]
82  },
83  {
84   "name": "two calls",
85   "input": "<tool_call>\n<function=get_weather>\n<parameter=city>\nA\n</parameter>\n</function>\n</tool_call>\n<tool_call>\n<function=write_file>\n<parameter=path>\nx.txt\n</parameter>\n<parameter=content>\nline1\nline2\n</parameter>\n</function>\n</tool_call>",
86   "thinking": false,
87   "events": [
88    [
89     "tool_call",
90     "",
91     "get_weather",
92     {
93      "city": "A"
94     }
95    ],
96    [
97     "tool_call",
98     "",
99     "write_file",
100     {
101      "path": "x.txt",
102      "content": "line1\nline2"
103     }
104    ]
105   ]
106  },
107  {
108   "name": "thinking then call",
109   "input": "I should look it up.</think>\n\n<tool_call>\n<function=get_weather>\n<parameter=city>\nOslo\n</parameter>\n</function>\n</tool_call>",
110   "thinking": true,
111   "events": [
112    [
113     "reasoning",
114     "I should look it up.",
115     null,
116     null
117    ],
118    [
119     "tool_call",
120     "",
121     "get_weather",
122     {
123      "city": "Oslo"
124     }
125    ]
126   ]
127  },
128  {
129   "name": "undeclared tool stays text",
130   "input": "<tool_call>\n<function=launch_missiles>\n<parameter=x>\n1\n</parameter>\n</function>\n</tool_call>",
131   "thinking": false,
132   "events": [
133    [
134     "content",
135     "<tool_call>\n<function=launch_missiles>\n<parameter=x>\n1\n</parameter>\n</function>\n</tool_call>",
136     null,
137     null
138    ]
139   ]
140  }
141 ],
142 "json": [
143  {
144   "name": "json one call",
145   "input": "<tool_call>\n{\"name\": \"get_weather\", \"arguments\": {\"city\": \"Paris\", \"days\": 3}}\n</tool_call>",
146   "thinking": false,
147   "events": [
148    [
149     "tool_call",
150     "",
151     "get_weather",
152     {
153      "city": "Paris",
154      "days": 3
155     }
156    ]
157   ]
158  },
159  {
160   "name": "json text then call",
161   "input": "Let me check.\n\n<tool_call>\n{\"name\": \"get_weather\", \"arguments\": {\"city\": \"Rome\"}}\n</tool_call>",
162   "thinking": false,
163   "events": [
164    [
165     "content",
166     "Let me check.",
167     null,
168     null
169    ],
170    [
171     "tool_call",
172     "",
173     "get_weather",
174     {
175      "city": "Rome"
176     }
177    ]
178   ]
179  },
180  {
181   "name": "json two calls",
182   "input": "<tool_call>\n{\"name\": \"get_weather\", \"arguments\": {\"city\": \"A\"}}\n</tool_call>\n<tool_call>\n{\"name\": \"write_file\", \"arguments\": {\"path\": \"x.txt\", \"content\": \"line1\\nline2\"}}\n</tool_call>",
183   "thinking": false,
184   "events": [
185    [
186     "tool_call",
187     "",
188     "get_weather",
189     {
190      "city": "A"
191     }
192    ],
193    [
194     "tool_call",
195     "",
196     "write_file",
197     {
198      "path": "x.txt",
199      "content": "line1\nline2"
200     }
201    ]
202   ]
203  },
204  {
205   "name": "json arguments as a string",
206   "input": "<tool_call>\n{\"name\": \"get_weather\", \"arguments\": \"{\\\"city\\\": \\\"Oslo\\\"}\"}\n</tool_call>",
207   "thinking": false,
208   "events": [
209    [
210     "tool_call",
211     "",
212     "get_weather",
213     {
214      "city": "Oslo"
215     }
216    ]
217   ]
218  },
219  {
220   "name": "json parameters key",
221   "input": "<tool_call>\n{\"name\": \"get_weather\", \"parameters\": {\"city\": \"Kyiv\"}}\n</tool_call>",
222   "thinking": false,
223   "events": [
224    [
225     "tool_call",
226     "",
227     "get_weather",
228     {
229      "city": "Kyiv"
230     }
231    ]
232   ]
233  },
234  {
235   "name": "json thinking then call",
236   "input": "I should look it up.</think>\n\n<tool_call>\n{\"name\": \"get_weather\", \"arguments\": {\"city\": \"Oslo\"}}\n</tool_call>",
237   "thinking": true,
238   "events": [
239    [
240     "reasoning",
241     "I should look it up.",
242     null,
243     null
244    ],
245    [
246     "tool_call",
247     "",
248     "get_weather",
249     {
250      "city": "Oslo"
251     }
252    ]
253   ]
254  },
255  {
256   "name": "json undeclared tool stays text",
257   "input": "<tool_call>\n{\"name\": \"launch_missiles\", \"arguments\": {}}\n</tool_call>",
258   "thinking": false,
259   "events": [
260    [
261     "content",
262     "<tool_call>\n{\"name\": \"launch_missiles\", \"arguments\": {}}\n</tool_call>",
263     null,
264     null
265    ]
266   ]
267  },
268  {
269   "name": "json in a fence",
270   "input": "<tool_call>\n```json\n{\"name\": \"get_weather\", \"arguments\": {\"city\": \"Lima\"}}\n```\n</tool_call>",
271   "thinking": false,
272   "events": [
273    [
274     "tool_call",
275     "",
276     "get_weather",
277     {
278      "city": "Lima"
279     }
280    ]
281   ]
282  }
283 ]
284}