Skip to content

Commit 6b6770a

Browse files
Python: Naming updates (#12233)
<!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> This pull request introduces several updates across multiple files to standardize naming conventions, improve consistency in method calls, and modernize data model definitions. The primary changes include renaming key classes and methods, replacing deprecated fields with updated ones, and ensuring uniformity in collection management operations. * Replaced `VectorStoreRecordDataField`, `VectorStoreRecordKeyField`, and `VectorStoreRecordVectorField` with `VectorStoreDataField`, `VectorStoreKeyField`, and `VectorStoreVectorField` respectively across all relevant files. [[1]](diffhunk://#diff-df5224582cd487ed94306045bd09dcd32ccbd9b3f82a63184d037ebe02d34b17R16-R19) [[2]](diffhunk://#diff-bff31c838fdfdb680d4dbdd3a24764dfd8a316b89b7d2ea466234edb98b68e9dL10-L18) [[3]](diffhunk://#diff-af84e00363a79d8bd2f3b72976ecc95c0744fcdf89930ac9b058bfd27b27b83eL18-R18) [[4]](diffhunk://#diff-c7a1b7cdeb95d9cdf398adc0cead91e30fcee1c6abff046f2933f0ac361d3982L30-R36) [[5]](diffhunk://#diff-4c45e261749985abb60b9bd147b2bd2cb91fdfda869190da1f56c89032667eefL11-R14) * Updated data models in `semantic_caching.py`, `store_chat_history_in_cosmosdb.py`, and other files to use the new field types for consistency. [[1]](diffhunk://#diff-df5224582cd487ed94306045bd09dcd32ccbd9b3f82a63184d037ebe02d34b17L35-R37) [[2]](diffhunk://#diff-bff31c838fdfdb680d4dbdd3a24764dfd8a316b89b7d2ea466234edb98b68e9dL42-R44) [[3]](diffhunk://#diff-af84e00363a79d8bd2f3b72976ecc95c0744fcdf89930ac9b058bfd27b27b83eL63-R80) * Renamed `create_collection_if_not_exists` to `ensure_collection_exists` and `delete_collection` to `ensure_collection_deleted` for clarity and consistency. [[1]](diffhunk://#diff-df5224582cd487ed94306045bd09dcd32ccbd9b3f82a63184d037ebe02d34b17L68-R68) [[2]](diffhunk://#diff-bff31c838fdfdb680d4dbdd3a24764dfd8a316b89b7d2ea466234edb98b68e9dL194-R194) [[3]](diffhunk://#diff-3ad17b6faefe0a6ac2fff5b863169e5aac7ab99c49d4f376ba46f2d0d181b642L67-R67) * Updated method calls in various files to reflect these changes. [[1]](diffhunk://#diff-df5224582cd487ed94306045bd09dcd32ccbd9b3f82a63184d037ebe02d34b17L89-R89) [[2]](diffhunk://#diff-c7a1b7cdeb95d9cdf398adc0cead91e30fcee1c6abff046f2933f0ac361d3982L150-R149) * Renamed `AzureCosmosDBNoSQLStore` to `CosmosNoSqlStore` and `AzureCosmosDBNoSQLCollection` to `CosmosNoSqlCollection`. Similar updates were made to MongoDB-related classes. [[1]](diffhunk://#diff-bff31c838fdfdb680d4dbdd3a24764dfd8a316b89b7d2ea466234edb98b68e9dL178-R178) [[2]](diffhunk://#diff-c7a1b7cdeb95d9cdf398adc0cead91e30fcee1c6abff046f2933f0ac361d3982L16-R18) * Replaced `data_model_type` with `record_type` in collection initialization across multiple files for uniformity. [[1]](diffhunk://#diff-df5224582cd487ed94306045bd09dcd32ccbd9b3f82a63184d037ebe02d34b17L53-R53) [[2]](diffhunk://#diff-bff31c838fdfdb680d4dbdd3a24764dfd8a316b89b7d2ea466234edb98b68e9dL67-R69) [[3]](diffhunk://#diff-c7a1b7cdeb95d9cdf398adc0cead91e30fcee1c6abff046f2933f0ac361d3982L99-R123) * Consolidated imports for improved readability and maintainability. [[1]](diffhunk://#diff-df5224582cd487ed94306045bd09dcd32ccbd9b3f82a63184d037ebe02d34b17R16-R19) [[2]](diffhunk://#diff-af84e00363a79d8bd2f3b72976ecc95c0744fcdf89930ac9b058bfd27b27b83eL18-R18) * Adjusted default values and annotations in data models to align with the updated field types. [[1]](diffhunk://#diff-4c45e261749985abb60b9bd147b2bd2cb91fdfda869190da1f56c89032667eefL47-R58) [[2]](diffhunk://#diff-4c45e261749985abb60b9bd147b2bd2cb91fdfda869190da1f56c89032667eefL72-R71) These changes collectively enhance the maintainability and readability of the codebase while ensuring alignment with modern conventions. <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> Closes: #11938 <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄
1 parent ff6fbb7 commit 6b6770a

2 files changed

Lines changed: 709 additions & 710 deletions

File tree

0 commit comments

Comments
 (0)