Skip to content

docs(api): add cached_tokens/reasoning_tokens to get_session() llm_token_usage example#2328

Merged
qin-ctx merged 2 commits into
volcengine:mainfrom
r266-tech:docs-api-sessions-llm-token-cached-reasoning-2305
Jun 4, 2026
Merged

docs(api): add cached_tokens/reasoning_tokens to get_session() llm_token_usage example#2328
qin-ctx merged 2 commits into
volcengine:mainfrom
r266-tech:docs-api-sessions-llm-token-cached-reasoning-2305

Conversation

@r266-tech
Copy link
Copy Markdown
Contributor

#2305 added cached_tokens and reasoning_tokens to the llm_token_usage mapping on SessionMeta (default dict + from_dict in openviking/session/session.py), which is serialized via to_dict() and returned by get_session(). The get_session() Response Example in docs/{en,zh}/api/05-sessions.md still lists only prompt_tokens / completion_tokens / total_tokens, so the documented response shape is now incomplete.

This adds the two keys to the example (EN + ZH mirror) so the fields are discoverable — they let callers attribute prompt-cache savings (cached_tokens) and reasoning cost (reasoning_tokens) when reading get_session() output for LLM cost accounting.

Docs-only, scoped strictly to the get_session() llm_token_usage example block.

@github-actions
Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis ❌

2305 - Not compliant

Non-compliant requirements:

  • ov 增加处理的的reasoning、cache token统计
  • 评测结果统计 所有token消耗和打印
  • 增加api_key 控制不同的配置
  • 增加飞书的卡片消息识别
⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🏅 Score: 100
🧪 No relevant tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

@github-actions
Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

@qin-ctx qin-ctx merged commit 53aa0ca into volcengine:main Jun 4, 2026
3 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in OpenViking project Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants