Skip to content

Conversation

Alessan-git
Copy link
Contributor

Summary

This pull request introduces Equatable conformance for the ModelConfiguration and ModelConfiguration.Identifier types.

Changes

  • Added extension ModelConfiguration: Equatable (no custom implementation needed).
  • Added extension ModelConfiguration.Identifier: Equatable with a custom == operator implementation.

Motivation

This ensures efficient equality checks, improving code readability and maintainability.
Simplifies code such as:

if await newSelectedConfiguration != modelContainer.configuration {
    try await LLMModelFactory.shared.loadContainer(configuration: configuration)
}

Copy link
Collaborator

@davidkoski davidkoski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, thank you!

@davidkoski davidkoski merged commit 651ec4a into ml-explore:main Mar 18, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants