fix: correct prompt_cache_retention type to use underscore#1765
Open
fuleinist wants to merge 1 commit intoopenai:masterfrom
Open
fix: correct prompt_cache_retention type to use underscore#1765fuleinist wants to merge 1 commit intoopenai:masterfrom
fuleinist wants to merge 1 commit intoopenai:masterfrom
Conversation
The OpenAI API documentation specifies that the allowed values for prompt_cache_retention are 'in_memory' and '24h' (with underscore, not hyphen). This commit updates the type definitions to match the API documentation. Fixes openai#1756
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.
Summary
This PR fixes a type definition mismatch in the
prompt_cache_retentionparameter.According to the OpenAI API documentation, the allowed values for
prompt_cache_retentionarein_memoryand24h(with underscore, not hyphen).However, the SDK type definition was using
in-memory(with hyphen) instead ofin_memory(with underscore), causing TypeScript errors when developers try to use the documented value.Changes
prompt_cache_retentiontype fromin-memory | 24htoin_memory | 24hin:src/resources/responses/responses.ts(3 occurrences)src/resources/chat/completions/completions.ts(1 occurrence)Testing
The type change allows developers to use the documented
in_memoryvalue without TypeScript errors.Fixes #1756