-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from Encamina/@rliberoff/improvements_and_new_…
…features Bump version from `8.1.1` to `8.1.2`. This is the new final version for release 8.1.2
- Loading branch information
Showing
23 changed files
with
267 additions
and
44 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Ignore Spelling: Debouncer | ||
|
||
namespace Encamina.Enmarcha.Core; | ||
|
||
/// <summary> | ||
/// Provides mechanisms to prevent multiple bouncing calls to a method or event. | ||
/// </summary> | ||
public static class Debouncer | ||
{ | ||
/// <summary> | ||
/// Debounce a function from being called too frequently. This is often used in scenarios where you want to limit the rate of execution of a particular method or event. | ||
/// </summary> | ||
/// <typeparam name="T">The type of the argument to be passed to the function to be debounced.</typeparam> | ||
/// <param name="function">The function to be debounced.</param> | ||
/// <param name="milliseconds">The number of milliseconds to wait before calling the function again.</param> | ||
/// <returns>A function that can be called to debounce the original function.</returns> | ||
public static Action<T> Debounce<T>(Action<T> function, int milliseconds = 300) | ||
Check warning on line 17 in src/Encamina.Enmarcha.Core/Debouncer.cs GitHub Actions / CI
|
||
{ | ||
var last = 0; | ||
|
||
return arg => | ||
{ | ||
var current = Interlocked.Increment(ref last); | ||
|
||
Task.Delay(milliseconds).ContinueWith(task => | ||
{ | ||
if (current == last) | ||
{ | ||
function(arg); | ||
} | ||
|
||
task.Dispose(); | ||
}); | ||
}; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/Encamina.Enmarcha.Data.AzureAISearch/AzureAISearchOptions.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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
using Encamina.Enmarcha.Core.DataAnnotations; | ||
|
||
namespace Encamina.Enmarcha.Data.AzureAISearch; | ||
|
||
/// <summary> | ||
/// Configuration options for setting up a connection to an Azure AI Search, and use it as a vector database. | ||
/// </summary> | ||
public sealed class AzureAISearchOptions | ||
{ | ||
/// <summary> | ||
/// Gets the Azure AI Search endpoint, , e.g. "https://enmarcha.search.windows.net". | ||
/// </summary> | ||
[Required] | ||
[Uri] | ||
public required Uri Endpoint { get; init; } | ||
|
||
/// <summary> | ||
/// Gets the Azure AI Search key. | ||
/// </summary> | ||
[Required] | ||
public required string Key { get; init; } | ||
} |
12 changes: 12 additions & 0 deletions
12
src/Encamina.Enmarcha.Data.AzureAISearch/Encamina.Enmarcha.Data.AzureAISearch.csproj
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.1</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Encamina.Enmarcha.Core\Encamina.Enmarcha.Core.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
45 changes: 45 additions & 0 deletions
45
src/Encamina.Enmarcha.Data.AzureAISearch/Properties/CompilerFeatureRequiredAttribute.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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#if !NET7_0_OR_GREATER | ||
|
||
namespace System.Runtime.CompilerServices; | ||
|
||
/// <summary> | ||
/// Indicates that compiler support for a particular feature is required for the location where this attribute is applied. | ||
/// </summary> | ||
/// <remarks> | ||
/// Reserved to be used by the compiler for tracking metadata. This class should not be used by developers in source code. | ||
/// </remarks> | ||
[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)] | ||
internal sealed class CompilerFeatureRequiredAttribute : Attribute | ||
{ | ||
/// <summary> | ||
/// The <see cref="FeatureName"/> used for the ref structs C# feature. | ||
/// </summary> | ||
public const string RefStructs = nameof(RefStructs); | ||
|
||
/// <summary> | ||
/// The <see cref="FeatureName"/> used for the required members C# feature. | ||
/// </summary> | ||
public const string RequiredMembers = nameof(RequiredMembers); | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="CompilerFeatureRequiredAttribute"/> class. | ||
/// </summary> | ||
/// <param name="featureName">The name of the required compiler feature.</param> | ||
public CompilerFeatureRequiredAttribute(string featureName) | ||
{ | ||
FeatureName = featureName; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the name of the compiler feature. | ||
/// </summary> | ||
public string FeatureName { get; } | ||
|
||
/// <summary> | ||
/// Gets a value indicating whether the compiler can choose to allow access to the location | ||
/// where this attribute is applied if it does not understand <see cref="FeatureName"/>. | ||
/// </summary> | ||
public bool IsOptional { get; init; } | ||
} | ||
|
||
#endif |
16 changes: 16 additions & 0 deletions
16
src/Encamina.Enmarcha.Data.AzureAISearch/Properties/IsExternalInit.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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#if NETSTANDARD2_1 || NETCOREAPP3_1 || NET45 || NET451 || NET452 || NET46 || NET461 || NET462 || NET47 || NET471 || NET472 || NET48 | ||
|
||
using System.ComponentModel; | ||
|
||
namespace System.Runtime.CompilerServices; | ||
|
||
/// <summary> | ||
/// Reserved to be used by the compiler for tracking metadata. | ||
/// This class should not be used by developers in source code. | ||
/// </summary> | ||
[EditorBrowsable(EditorBrowsableState.Never)] | ||
internal static class IsExternalInit | ||
{ | ||
} | ||
|
||
#endif |
16 changes: 16 additions & 0 deletions
16
src/Encamina.Enmarcha.Data.AzureAISearch/Properties/RequiredMemberAttribute.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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#if !NET7_0_OR_GREATER | ||
|
||
namespace System.Runtime.CompilerServices; | ||
|
||
/// <summary> | ||
/// Specifies that a type has required members or that a member is required. | ||
/// </summary> | ||
/// <remarks> | ||
/// Reserved to be used by the compiler for tracking metadata. This class should not be used by developers in source code. | ||
/// </remarks> | ||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)] | ||
internal sealed class RequiredMemberAttribute : Attribute | ||
{ | ||
} | ||
|
||
#endif |
16 changes: 16 additions & 0 deletions
16
src/Encamina.Enmarcha.Data.AzureAISearch/Properties/SetsRequiredMembersAttribute.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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#if !NET7_0_OR_GREATER | ||
|
||
namespace System.Diagnostics.CodeAnalysis; | ||
|
||
/// <summary> | ||
/// Specifies that this constructor sets all required members for the current type, and callers do not need to set any required members themselves. | ||
/// </summary> | ||
/// <remarks> | ||
/// Reserved to be used by the compiler for tracking metadata. This class should not be used by developers in source code. | ||
/// </remarks> | ||
[AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)] | ||
internal sealed class SetsRequiredMembersAttribute : Attribute | ||
{ | ||
} | ||
|
||
#endif |
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
Oops, something went wrong.