Conversation
There was a problem hiding this comment.
Pull Request Overview
Adds support for the new gpt-4.1 and gpt-4.5 model variants by mapping them to the existing o200k_base encoding and updating the README to reflect those additions.
- Introduce exact and prefix-based mappings for
gpt-4.1andgpt-4.5inencoding.go - Update documentation tables in
README.mdto list the new models under available encodings and models
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| encoding.go | Added "gpt-4.1" and "gpt-4.5" entries to both MODEL_TO_ENCODING and MODEL_PREFIX_TO_ENCODING maps |
| README.md | Expanded tables and prose to include gpt-4.1 and gpt-4.5 in the available encodings/models sections |
Comments suppressed due to low confidence (3)
encoding.go:25
- Add or update unit tests to cover the new mappings for
gpt-4.5andgpt-4.1so that encoding lookups for these models are validated.
"gpt-4.5": MODEL_O200K_BASE,
encoding.go:72
- The inline comment example still references
gpt-4o-.... Update it togpt-4.5-...to match this mapping.
"gpt-4.5-": MODEL_O200K_BASE, // e.g., gpt-4o-2024-05-13, etc.
encoding.go:73
- The inline comment example still references
gpt-4o-.... Update it togpt-4.1-...to reflect this prefix mapping correctly.
"gpt-4.1-": MODEL_O200K_BASE, // e.g., gpt-4o-2024-05-13, etc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
gpt-4.1andgpt-4.5. These models currently cause errors when used with this library.