provide public accessors for ModelConfigurations from registries#219
Merged
davidkoski merged 1 commit intoml-explore:mainfrom Mar 4, 2025
Merged
Conversation
toffaletti
commented
Mar 1, 2025
c115570 to
fd3fa89
Compare
davidkoski
reviewed
Mar 1, 2025
Libraries/Embedders/Models.swift
Outdated
| } | ||
|
|
||
| @MainActor | ||
| public static var models: Dictionary<String, ModelConfiguration>.Values { |
Collaborator
There was a problem hiding this comment.
I don't think we should expose a type like this -- it leaks the implementation.
I wonder if this can be something like some RandomAccessCollection<ModelConfiguration>. If not, it should probably just be [ModelConfiguration] and we rewrap the return values.
Contributor
Author
There was a problem hiding this comment.
https://developer.apple.com/documentation/swift/dictionary/values-swift.struct#conforms-to
I chose Collection as the best of the options.
Contributor
Author
There was a problem hiding this comment.
I need to make it Sendable too
fd3fa89 to
5e3fdd7
Compare
5e3fdd7 to
13c3e64
Compare
davidkoski
approved these changes
Mar 4, 2025
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.
Added public accessors for getting a list of registered ModelConfigurations. Would be nice to standardize these eventually.