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

Add Encoding.truncateText #84

Merged
merged 2 commits into from
May 22, 2023
Merged

Add Encoding.truncateText #84

merged 2 commits into from
May 22, 2023

Conversation

nomisRev
Copy link
Contributor

Introduces an improved version of Encoding.truncateText introduced in #81. This method truncates the text to a certain amount of tokens.

This method should be used with caution as extremely small maxTokens might result in impossible to truncate text, and it might also reduce reliability your prompts.

@xebia-functional/team-ai

@nomisRev nomisRev merged commit 62070bc into main May 22, 2023
@nomisRev nomisRev deleted the truncateText branch May 22, 2023 10:42
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