Commit e2a5cda
authored
<!--
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
1 parent f88af15 commit e2a5cda
File tree
4 files changed
+383
-35
lines changed- agents
- agents-features/agents-features-opentelemetry/src/jvmTest/kotlin/ai/koog/agents/features/opentelemetry/feature/span
- agents-test/src
- commonMain/kotlin/ai/koog/agents/testing/tools
- jvmTest/kotlin/ai/koog/agents/test
4 files changed
+383
-35
lines changedLines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
445 | 445 | | |
446 | 446 | | |
447 | 447 | | |
448 | | - | |
| 448 | + | |
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
| |||
492 | 492 | | |
493 | 493 | | |
494 | 494 | | |
495 | | - | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
496 | 499 | | |
497 | 500 | | |
498 | 501 | | |
| |||
Lines changed: 91 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
188 | 193 | | |
189 | 194 | | |
190 | 195 | | |
| |||
208 | 213 | | |
209 | 214 | | |
210 | 215 | | |
211 | | - | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
212 | 222 | | |
213 | 223 | | |
214 | 224 | | |
| |||
231 | 241 | | |
232 | 242 | | |
233 | 243 | | |
234 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
235 | 250 | | |
236 | 251 | | |
237 | 252 | | |
| |||
253 | 268 | | |
254 | 269 | | |
255 | 270 | | |
256 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
257 | 277 | | |
258 | 278 | | |
259 | 279 | | |
| |||
278 | 298 | | |
279 | 299 | | |
280 | 300 | | |
281 | | - | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
282 | 307 | | |
283 | 308 | | |
284 | 309 | | |
| |||
306 | 331 | | |
307 | 332 | | |
308 | 333 | | |
309 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
310 | 340 | | |
311 | 341 | | |
312 | 342 | | |
| |||
330 | 360 | | |
331 | 361 | | |
332 | 362 | | |
333 | | - | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
334 | 369 | | |
335 | 370 | | |
336 | 371 | | |
| |||
366 | 401 | | |
367 | 402 | | |
368 | 403 | | |
369 | | - | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
370 | 410 | | |
371 | 411 | | |
372 | 412 | | |
| |||
792 | 832 | | |
793 | 833 | | |
794 | 834 | | |
795 | | - | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
796 | 841 | | |
797 | 842 | | |
798 | 843 | | |
799 | 844 | | |
800 | | - | |
801 | | - | |
802 | | - | |
803 | | - | |
804 | | - | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
805 | 851 | | |
806 | 852 | | |
807 | 853 | | |
808 | 854 | | |
809 | 855 | | |
810 | 856 | | |
811 | 857 | | |
812 | | - | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
813 | 864 | | |
814 | 865 | | |
815 | 866 | | |
| |||
827 | 878 | | |
828 | 879 | | |
829 | 880 | | |
830 | | - | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
831 | 887 | | |
832 | 888 | | |
833 | 889 | | |
834 | 890 | | |
835 | | - | |
836 | | - | |
837 | | - | |
838 | | - | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
839 | 897 | | |
840 | | - | |
841 | 898 | | |
842 | 899 | | |
843 | 900 | | |
844 | 901 | | |
845 | 902 | | |
846 | | - | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
847 | 914 | | |
848 | 915 | | |
849 | 916 | | |
| |||
942 | 1009 | | |
943 | 1010 | | |
944 | 1011 | | |
945 | | - | |
| 1012 | + | |
946 | 1013 | | |
947 | 1014 | | |
948 | 1015 | | |
| |||
Lines changed: 52 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | | - | |
| 42 | + | |
42 | 43 | | |
43 | | - | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
141 | | - | |
| 142 | + | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
| |||
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
150 | | - | |
151 | | - | |
152 | 151 | | |
153 | 152 | | |
154 | 153 | | |
| |||
170 | 169 | | |
171 | 170 | | |
172 | 171 | | |
173 | | - | |
| 172 | + | |
174 | 173 | | |
175 | 174 | | |
176 | 175 | | |
177 | | - | |
| 176 | + | |
178 | 177 | | |
179 | 178 | | |
180 | 179 | | |
181 | | - | |
| 180 | + | |
182 | 181 | | |
183 | 182 | | |
184 | 183 | | |
185 | 184 | | |
186 | | - | |
187 | 185 | | |
188 | 186 | | |
189 | 187 | | |
| |||
193 | 191 | | |
194 | 192 | | |
195 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
196 | 239 | | |
197 | 240 | | |
198 | 241 | | |
| |||
0 commit comments