You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cf63f30
Browse filesBrowse the repository at this point in the historyBrowse files
ROB-1707 Holmes Chat API docs: match start_tool_calling and token_count payloads (#2209)
* ROB-1707 Holmes Chat API docs: match start_tool_calling and token_count payloads
start_tool_calling carries `id` and `tool_name`; the description arrives on
tool_calling_result. token_count carries `metadata`. The streaming example now
raises on an HTTP error instead of printing nothing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V2KwgqX5jRzJiSCctf2GZd
* ROB-1707 Document every token_count field the example shows
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V2KwgqX5jRzJiSCctf2GZd
---------
Co-authored-by: Claude <noreply@anthropic.com>
data: {"analysis": "## Investigation Summary\n\nThe pod `frontend-59fbcd7965-drx6w` is stuck ..."}
@@ -301,9 +301,8 @@ Emitted when Holmes begins executing a tool.
301
301
.. code-block:: json
302
302
303
303
{
304
-
"tool_call_id": "call_abc123",
305
304
"tool_name": "kubectl_find_resource",
306
-
"description": "kubectl get pods -n production"
305
+
"id": "call_abc123"
307
306
}
308
307
309
308
.. list-table::
@@ -313,15 +312,14 @@ Emitted when Holmes begins executing a tool.
313
312
* - Field
314
313
- Type
315
314
- Description
316
-
* - ``tool_call_id``
315
+
* - ``id``
317
316
- string
318
-
- Unique identifier for this tool call. Use it to correlate with the corresponding ``tool_calling_result``.
317
+
- Unique identifier for this tool call. Matches the ``tool_call_id`` of the corresponding ``tool_calling_result``.
319
318
* - ``tool_name``
320
319
- string
321
320
- Name of the tool being executed.
322
-
* - ``description``
323
-
- string
324
-
- Human-readable description of what the tool is doing.
321
+
322
+
A human-readable description of the call (for example, the ``kubectl`` command it ran) arrives with the result, in the ``tool_calling_result`` event's ``description`` field.
325
323
326
324
``tool_calling_result``
327
325
"""""""""""""""""""""""
@@ -348,10 +346,13 @@ Emitted when a tool call completes.
348
346
- Description
349
347
* - ``tool_call_id``
350
348
- string
351
-
- Matches the ``tool_call_id`` from the corresponding ``start_tool_calling`` event.
349
+
- Matches the ``id`` from the corresponding ``start_tool_calling`` event.
352
350
* - ``name``
353
351
- string
354
352
- Name of the tool that was called.
353
+
* - ``description``
354
+
- string
355
+
- Human-readable description of the call, such as the command it ran.
355
356
* - ``result``
356
357
- object
357
358
- Result object with a ``status`` field (``"success"``, ``"error"``, ``"no_data"``, or ``"approval_required"``) and either a ``data`` field (on success) or an ``error`` field (on failure).
@@ -437,8 +438,16 @@ Emitted with token usage statistics.
437
438
.. code-block:: json
438
439
439
440
{
440
-
"input_tokens": 1520,
441
-
"output_tokens": 305
441
+
"metadata": {
442
+
"usage": {
443
+
"prompt_tokens": 1520,
444
+
"completion_tokens": 305,
445
+
"total_tokens": 1825,
446
+
"cached_tokens": 0
447
+
},
448
+
"max_tokens": 1000000,
449
+
"max_output_tokens": 120000
450
+
}
442
451
}
443
452
444
453
.. list-table::
@@ -448,12 +457,24 @@ Emitted with token usage statistics.
448
457
* - Field
449
458
- Type
450
459
- Description
451
-
* - ``input_tokens``
460
+
* - ``metadata.usage.prompt_tokens``
461
+
- integer
462
+
- Input tokens of the last LLM call.
463
+
* - ``metadata.usage.completion_tokens``
464
+
- integer
465
+
- Output tokens of the last LLM call.
466
+
* - ``metadata.usage.total_tokens``
467
+
- integer
468
+
- Input plus output tokens of the last LLM call.
469
+
* - ``metadata.usage.cached_tokens``
470
+
- integer
471
+
- Optional. Input tokens of the last LLM call served from the provider's prompt cache.
472
+
* - ``metadata.max_tokens``
452
473
- integer
453
-
- Number of input tokens consumed.
454
-
* - ``output_tokens``
474
+
- Context window of the model.
475
+
* - ``metadata.max_output_tokens``
455
476
- integer
456
-
- Number of output tokens generated.
477
+
- Maximum output tokens of the model.
457
478
458
479
.. _approval-required-event:
459
480
@@ -516,6 +537,7 @@ Consuming the Stream
516
537
},
517
538
stream=True,
518
539
)
540
+
response.raise_for_status()
519
541
520
542
event_type = None
521
543
for line in response.iter_lines(decode_unicode=True):
0 commit comments