Skip to content

KG-381 Add input and total tokens count in internal Mock Test framework#1145

Merged
aozherelyeva merged 1 commit intodevelopfrom
zarechneva/KG-381-input-and-total-tokens-count
Nov 21, 2025
Merged

KG-381 Add input and total tokens count in internal Mock Test framework#1145
aozherelyeva merged 1 commit intodevelopfrom
zarechneva/KG-381-input-and-total-tokens-count

Conversation

@aozherelyeva
Copy link
Copy Markdown
Contributor

@aozherelyeva aozherelyeva commented Nov 18, 2025

Motivation and Context

KG-381 Add input and total tokens count in internal Mock Test framework

  1. The new updateTokenCounts function calculates input, output, and total token counts.
  2. Updated response metadata creation to include token counts where applicable.
  3. Removed unused inputTokensCount variable.
  4. Added tests for token counter in the MockLLM responses.

Breaking Changes

None.


Type of the changes

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tests improvement
  • Refactoring

Checklist

  • The pull request has a description of the proposed change
  • I read the Contributing Guidelines before opening the pull request
  • The pull request uses develop as the base branch
  • Tests for the changes have been added
  • All new and existing tests passed
Additional steps for pull requests adding a new feature
  • An issue describing the proposed change exists
  • The pull request includes a link to the issue
  • The change was discussed and approved in the issue
  • Docs have been added / updated

@aozherelyeva aozherelyeva added enhancement New feature or request tests Add new tests or modify existing labels Nov 18, 2025
@aozherelyeva aozherelyeva force-pushed the zarechneva/KG-381-input-and-total-tokens-count branch from 9233a0d to a4af72d Compare November 18, 2025 14:40
@github-actions
Copy link
Copy Markdown

Qodana for JVM

1191 new problems were found

Inspection name Severity Problems
Check Kotlin and Java source code coverage 🔶 Warning 1180
Missing KDoc for public API declaration 🔶 Warning 11
@@ Code coverage @@
+ 71% total lines covered
16497 lines analyzed, 11871 lines covered
# Calculated according to the filters of your coverage tool

☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

- Introduced `updateTokenCounts` function to calculate input, output, and total token counts.
- Updated response metadata creation to include token counts where applicable.
- Removed unused `inputTokensCount` variable from certain methods.
@aozherelyeva aozherelyeva force-pushed the zarechneva/KG-381-input-and-total-tokens-count branch from a4af72d to 17280bd Compare November 21, 2025 09:19
@github-actions
Copy link
Copy Markdown

Qodana for JVM

1191 new problems were found

Inspection name Severity Problems
Check Kotlin and Java source code coverage 🔶 Warning 1180
Missing KDoc for public API declaration 🔶 Warning 11
@@ Code coverage @@
+ 71% total lines covered
16496 lines analyzed, 11870 lines covered
# Calculated according to the filters of your coverage tool

☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

@aozherelyeva aozherelyeva merged commit e2a5cda into develop Nov 21, 2025
11 checks passed
@aozherelyeva aozherelyeva deleted the zarechneva/KG-381-input-and-total-tokens-count branch November 21, 2025 12:31
kpavlov pushed a commit that referenced this pull request Dec 5, 2025
…rk (#1145)

<!--
Thank you for opening a pull request!

Please add a brief description of the proposed change here.
Also, please tick the appropriate points in the checklist below.
-->

## Motivation and Context
<!-- Why is this change needed? What problem does it solve? -->
[KG-381](https://youtrack.jetbrains.com/issue/KG-381) Add input and
total tokens count in internal Mock Test framework
1. The new `updateTokenCounts` function calculates input, output, and
total token counts.
2. Updated response metadata creation to include token counts where
applicable.
3. Removed unused `inputTokensCount` variable.
4. Added tests for token counter in the MockLLM responses.

## Breaking Changes
<!-- Will users need to update their code or configurations? -->
None.

---

#### Type of the changes
- [x] New feature (non-breaking change which adds functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [x] Tests improvement
- [x] Refactoring

#### Checklist
- [x] The pull request has a description of the proposed change
- [x] I read the [Contributing
Guidelines](https://github.com/JetBrains/koog/blob/main/CONTRIBUTING.md)
before opening the pull request
- [x] The pull request uses **`develop`** as the base branch
- [x] Tests for the changes have been added
- [x] All new and existing tests passed

##### Additional steps for pull requests adding a new feature
- [x] An issue describing the proposed change exists
- [x] The pull request includes a link to the issue
- [x] The change was discussed and approved in the issue
- [x] Docs have been added / updated
vova-jb pushed a commit that referenced this pull request Jan 27, 2026
…rk (#1145)

<!--
Thank you for opening a pull request!

Please add a brief description of the proposed change here.
Also, please tick the appropriate points in the checklist below.
-->

## Motivation and Context
<!-- Why is this change needed? What problem does it solve? -->
[KG-381](https://youtrack.jetbrains.com/issue/KG-381) Add input and
total tokens count in internal Mock Test framework
1. The new `updateTokenCounts` function calculates input, output, and
total token counts.
2. Updated response metadata creation to include token counts where
applicable.
3. Removed unused `inputTokensCount` variable.
4. Added tests for token counter in the MockLLM responses.

## Breaking Changes
<!-- Will users need to update their code or configurations? -->
None.

---

#### Type of the changes
- [x] New feature (non-breaking change which adds functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [x] Tests improvement
- [x] Refactoring

#### Checklist
- [x] The pull request has a description of the proposed change
- [x] I read the [Contributing
Guidelines](https://github.com/JetBrains/koog/blob/main/CONTRIBUTING.md)
before opening the pull request
- [x] The pull request uses **`develop`** as the base branch
- [x] Tests for the changes have been added
- [x] All new and existing tests passed

##### Additional steps for pull requests adding a new feature
- [x] An issue describing the proposed change exists
- [x] The pull request includes a link to the issue
- [x] The change was discussed and approved in the issue
- [x] Docs have been added / updated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request tests Add new tests or modify existing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants