-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add thinking metrics support to GeminiHandler and related components #2800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Introduced thoughtsTokenCount and thinkingBudget in API responses. - Updated GeminiHandler to handle thinking models and their configurations. - Enhanced ChatView, TaskHeader, and related components to display thinking metrics. - Added tests for thinking metrics in ChatView and TaskHeader.
|
| // Create a wrapper component that forces expanded state | ||
| const ExpandedTaskHeader: React.FC<React.ComponentProps<typeof TaskHeader>> = (props) => { | ||
| // Override useState to force expanded state | ||
| React.useState = jest.fn(() => [true, jest.fn()]) as any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid globally overriding React.useState to force expanded state in ExpandedTaskHeader. This can affect other components and tests unpredictably. Consider passing an explicit prop (e.g. 'expanded') or use a more localized mock.
This comment was generated because it violated a code review rule: mrule_oAUXVfj5l9XxF01R.
In this context, it would be more logical to display the total amount of reasoning tokens utilized per task. As I understand it, the thought tokens are not capped at 7.2k per task; instead, there is a limit per response for each individual response. |
What do you do except? Let's only display the thought icon with the tokens next to the API. Nothing is the task. Agree? |

Context
Added support for thinking metrics specifically for the Gemini API Provider across API and UI components.
Implementation
feat:
fix:
Screenshots
@cte @mrubens
How to Test
-Reference: https://colab.research.google.com/drive/17_JFakbGVuvJTbeNeXzan2xcr9l1rl0o
Get in Touch
discord: d_oit
Important
Add thinking metrics support to GeminiHandler and related components, including API and UI updates, and add tests for new functionality.
thoughtsTokenCountandthinkingBudgetto API responses ingemini.ts.GeminiHandlerto handle thinking models and configurations.ChatViewandTaskHeaderto display thinking metrics.ChatView.test.tsxandTaskHeader.test.tsx.this.options.modelMaxThinkingTokensundefined issue ingemini.ts.i18nextandreact-i18nextin__mocks__directory.ChatView.test.tsxandTaskHeader.test.tsx.This description was created by
for 0989f01. You can customize this summary. It will automatically update as commits are pushed.