Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

NestiaChatAgent.getTokenUsage() #1176

Merged
merged 3 commits into from
Jan 7, 2025
Merged

NestiaChatAgent.getTokenUsage() #1176

merged 3 commits into from
Jan 7, 2025

Conversation

samchon
Copy link
Owner

@samchon samchon commented Jan 7, 2025

This pull request introduces several significant changes to the packages/agent module, focusing on improving functionality related to token usage tracking and prompt initialization. The most important changes include updating the package version, modifying the initialization prompt, adding a new method to track token usage, and implementing a cost aggregator for token usage.

Version Update:

Prompt Initialization:

Token Usage Tracking:

Cost Aggregation:

  • packages/agent/src/internal/NestiaChatAgentCostAggregator.ts: Introduced a new module to aggregate token usage costs, updating the INestiaChatTokenUsage structure based on completion details.
  • Various files in packages/agent/src/chatgpt/: Integrated the cost aggregator into different ChatGpt agents to track and aggregate token usage during various operations. [1] [2] [3] [4] [5]

@samchon samchon added the enhancement New feature or request label Jan 7, 2025
@samchon samchon self-assigned this Jan 7, 2025
Copy link
Owner Author

@samchon samchon left a comment

Choose a reason for hiding this comment

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

Working properly.

@samchon samchon merged commit 75a6a20 into master Jan 7, 2025
2 checks passed
@samchon samchon deleted the feat/agent branch January 7, 2025 15:21
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant