Commit 3f71de3
committed
feat(ollama): add generateWithUsage() and export Usage/GenerateResult types
Adds generateWithUsage() method to OllamaClient that returns token usage
metadata (prompt_tokens, completion_tokens, total_tokens) alongside content.
The existing generate() method delegates to generateWithUsage() internally,
maintaining full backward compatibility.
Also exports the Usage and GenerateResult interfaces so consumers can
type their metering/billing integrations.1 parent d4f3f66 commit 3f71de3
1 file changed
Lines changed: 25 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
229 | 236 | | |
230 | 237 | | |
231 | 238 | | |
| |||
310 | 317 | | |
311 | 318 | | |
312 | 319 | | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
313 | 329 | | |
314 | 330 | | |
315 | 331 | | |
| |||
336 | 352 | | |
337 | 353 | | |
338 | 354 | | |
339 | | - | |
340 | 355 | | |
341 | 356 | | |
342 | 357 | | |
343 | | - | |
| 358 | + | |
344 | 359 | | |
345 | 360 | | |
346 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
347 | 369 | | |
348 | 370 | | |
349 | 371 | | |
| |||
0 commit comments