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
docs: fix assistant.usage cost field in Go/Java/Rust examples; clarify contextInfo token limit semantics
- Add cost field (with nil/Option guard) to Go, Java, and Rust assistant.usage
snippets so all six languages match the documented field table and the
'functionally equivalent' claim in the intro
- Correct the description of session.metadata.contextInfo parameters:
promptTokenLimit passes 0 to use the runtime default, while
outputTokenLimit passes 0 when the value is unknown (per generated types)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@@ -428,7 +436,7 @@ while let Ok(event) = events.recv().await {
428
436
429
437
### On-demand breakdown with `session.metadata.contextInfo`
430
438
431
-
Events only fire when the context changes. To read the current breakdown at any moment—for example, right after resuming a session—call `session.metadata.contextInfo`. Pass `0` for the token limits to use the model's defaults.
439
+
Events only fire when the context changes. To read the current breakdown at any moment—for example, right after resuming a session—call `session.metadata.contextInfo`. Pass `0` for `promptTokenLimit` to use the runtime default; pass `0` for `outputTokenLimit` if the value is unknown.
432
440
433
441
The result's `contextInfo` is `null` until the session has been initialized (the system prompt and tool metadata have been cached). It breaks the total down into `systemTokens`, `conversationTokens`, and `toolDefinitionsTokens`, alongside the `promptTokenLimit`.
0 commit comments