Skip to content

feat: percentage context remaining#470

Open
ShubyM wants to merge 7 commits intoGoogleCloudPlatform:mainfrom
ShubyM:fix/vertex-ai-config
Open

feat: percentage context remaining#470
ShubyM wants to merge 7 commits intoGoogleCloudPlatform:mainfrom
ShubyM:fix/vertex-ai-config

Conversation

@ShubyM
Copy link
Collaborator

@ShubyM ShubyM commented Aug 12, 2025

Screenshot 2025-08-18 at 11 58 26 AM Screenshot 2025-08-18 at 11 55 40 AM Screenshot 2025-08-18 at 11 56 06 AM

@ShubyM ShubyM changed the title [WIP] progres bar with context reminaing [WIP] feat: percentage context remaning Aug 12, 2025
@ShubyM ShubyM marked this pull request as ready for review August 15, 2025 19:50
@ShubyM ShubyM changed the title [WIP] feat: percentage context remaning feat: percentage context remaning Aug 15, 2025
@droot droot changed the title feat: percentage context remaning feat: percentage context remaining Aug 19, 2025

if pct, ok := gollm.ContextPercentRemaining(c.Model, usageMetadata); ok {
// c.addMessage(api.MessageSourceAgent, api.MessageTypeText, fmt.Sprintf("Context remaining: %.1f%%", pct))
c.addMessage(api.MessageSourceAgent, api.MessageTypeUsageMetadata, api.UsageMetadata{ContextPercentRemaining: pct})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it will make more sense to just make this (contextRemaining) an attribute of the session object and update it whenever session's context is being updated. UI has access to the session object and we used that to communicate AgentState attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants