Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
packages/agent/package.json
: Updated the version from0.1.1
to0.2.0
to reflect the new changes and improvements.Prompt Initialization:
packages/agent/prompts/initialize.md
: Simplified the initialization prompt to make it more concise and focused on using supplied tools to assist the user.packages/agent/src/internal/NestiaChatAgentSystemPrompt.ts
: Updated theINITIALIZE
constant to match the new simplified prompt.Token Usage Tracking:
packages/agent/src/NestiaChatAgent.ts
: Added a new methodgetTokenUsage
to track the token usage of the A.I. chatbot.packages/agent/src/chatgpt/ChatGptAgent.ts
: Implemented thegetTokenUsage
method and initialized theusage_
property to track token usage details. [1] [2]Cost Aggregation:
packages/agent/src/internal/NestiaChatAgentCostAggregator.ts
: Introduced a new module to aggregate token usage costs, updating theINestiaChatTokenUsage
structure based on completion details.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]