Skip to content
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

Fix a token usage statistical issue in DefaultAiServices #280

Merged
merged 5 commits into from Nov 24, 2023
Merged

Fix a token usage statistical issue in DefaultAiServices #280

merged 5 commits into from Nov 24, 2023

Conversation

jiangsier-xyz
Copy link
Contributor

The statistical logic on token usage is consistent with AiServiceStreamingResponseHandler.

And more:
When it comes to rolling messages in MessageWindowChatMemory/TokenWindowChatMemory, LinkedList offers superior performance. ArrayList moves all the elements when the first element is deleted.

The statistical logic on token usage is consistent with AiServiceStreamingResponseHandler.
…perior performance.

When the first element is deleted, ArrayList moves all the elements.
Copy link
Owner

@langchain4j langchain4j left a comment

Choose a reason for hiding this comment

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

@jiangsier-xyz thank you for fixing this bug!

@langchain4j langchain4j merged commit 7cfa1a5 into langchain4j:main Nov 24, 2023
3 checks passed
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.

None yet

2 participants