forked from ravendb/ravendb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RavenDB-23556: Replace HasCriticalChanges method with granular Compar…
…e to provide detailed insights into AI settings changes
- Loading branch information
Showing
11 changed files
with
173 additions
and
56 deletions.
There are no files selected for viewing
40 changes: 38 additions & 2 deletions
40
src/Raven.Client/Documents/Operations/ETL/AI/AbstractLlmSettings.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,47 @@ | ||
using Sparrow.Json; | ||
using System; | ||
using Sparrow.Json; | ||
using Sparrow.Json.Parsing; | ||
|
||
namespace Raven.Client.Documents.Operations.ETL.AI; | ||
|
||
public abstract class AbstractAiSettings : IDynamicJsonValueConvertible | ||
{ | ||
public abstract bool HasSettings(); | ||
public abstract bool HasCriticalChanges(AbstractAiSettings other); | ||
public abstract AiSettingsCompareDifferences Compare(AbstractAiSettings other); | ||
|
||
public abstract DynamicJsonValue ToJson(); | ||
} | ||
|
||
[Flags] | ||
public enum AiSettingsCompareDifferences | ||
{ | ||
None = 0, | ||
|
||
// Changes that affect the mathematical structure of embeddings | ||
EmbeddingDimensions = 1 << 0, | ||
EmbeddingNormalization = 1 << 1, | ||
PoolingStrategy = 1 << 2, | ||
ModelArchitecture = 1 << 3, // Changes in model name/version that affect embedding structure | ||
|
||
// Changes in text preprocessing that affect input | ||
TextPreprocessing = 1 << 4, // e.g. case sensitivity, unicode normalization | ||
TokenizationSettings = 1 << 5, // e.g. special tokens (CLS, SEP, PAD, etc.) | ||
SequenceLimits = 1 << 6, // e.g. maximum tokens | ||
|
||
// Changes in API configuration | ||
EndpointConfiguration = 1 << 7, // Changes in endpoint URLs | ||
AuthenticationSettings = 1 << 8, // Changes in API keys, org IDs etc | ||
|
||
// Changes that could affect embedding generation but cannot be verified by comparing settings | ||
DeploymentConfiguration = 1 << 9, | ||
|
||
// Combinations for common scenarios | ||
EmbeddingStructure = EmbeddingDimensions | EmbeddingNormalization | PoolingStrategy | ModelArchitecture, | ||
InputProcessing = TextPreprocessing | TokenizationSettings | SequenceLimits, | ||
ConnectionConfig = EndpointConfiguration | AuthenticationSettings, | ||
|
||
RequiresEmbeddingsRegeneration = EmbeddingStructure | InputProcessing | DeploymentConfiguration, | ||
|
||
// All changes | ||
All = RequiresEmbeddingsRegeneration | ConnectionConfig | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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