Fix type hint for FileChunkingStrategyParam to use StaticFileChunkingStrategyObject #2014
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 PR addresses and resolves the issue referenced in GitHub Issue #2005. The current type hint for
FileChunkingStrategyParamcaused API errors when passing aStaticFileChunkingStrategyParam, resulting in a400error due to a missing parameter ('chunking_strategy.type').Summary of Changes:
StaticFileChunkingStrategyParamwithStaticFileChunkingStrategyObjectin the type alias forFileChunkingStrategyParam.'chunking_strategy.type'parameter.Issue Addressed (#2005):
400 - Missing required parameter: 'chunking_strategy.type') was caused by the incorrect type hint. UsingStaticFileChunkingStrategyObjectaligns with the expected API input and resolves the error.StaticFileChunkingStrategyParamwas passed directly, so this fix aligns the type hinting with the actual API expectations.Concerns & Future Exploration:
AutoFileChunkingStrategyParamlacks astaticfield, whichStaticFileChunkingStrategyObjectincludes. This inconsistency could lead to issues in the future if similar expectations arise forAutoFileChunkingStrategyParam. I plan to further explore this potential gap in the future.Checklist:
chunking_strategyparams onFileclass methods #2005).Thank you for considering this PR! Please feel free to share any feedback or suggestions, and I’ll be happy to address them. 😊