Skip to content

Commit 09a96c2

Browse files
authored
Remove a few unnecessary internal setters (#611)
### Motivation and Context Minor cleanup. ### Description These are unnecessary. As I was reviewing through the code I happened to notice they were unused or had greater than required visibility. Also removed a few unnecessary `public` visibility annotations from an interface (they were nops and were inconsistent with the rest of the interface), as well as a few initializers that were initializing to the default value and thus were duplicative.
1 parent bf823c5 commit 09a96c2

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

dotnet/src/SemanticKernel.Abstractions/Orchestration/ISKFunction.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ public interface ISKFunction
3434
/// IMPORTANT: native functions might use semantic functions internally,
3535
/// so when this property is False, executing the function might still involve AI calls.
3636
/// </summary>
37-
public bool IsSemantic { get; }
37+
bool IsSemantic { get; }
3838

3939
/// <summary>
4040
/// AI service settings
4141
/// </summary>
42-
public CompleteRequestSettings RequestSettings { get; }
42+
CompleteRequestSettings RequestSettings { get; }
4343

4444
/// <summary>
4545
/// Returns a description of the function, including parameters.

dotnet/src/SemanticKernel.Abstractions/Orchestration/SKContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public SKContext Fail(string errorDescription, Exception? exception = null)
7878
/// <summary>
7979
/// Semantic memory
8080
/// </summary>
81-
public ISemanticTextMemory Memory { get; internal set; }
81+
public ISemanticTextMemory Memory { get; }
8282

8383
/// <summary>
8484
/// Read only skills collection

dotnet/src/SemanticKernel/AI/Embeddings/EmbeddingReadOnlySpan.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ public EmbeddingReadOnlySpan(EmbeddingSpan<TEmbedding> span, bool isNormalized =
6464
/// <summary>
6565
/// Gets the underlying <see cref="ReadOnlySpan{T}"/> of unmanaged data.
6666
/// </summary>
67-
public ReadOnlySpan<TEmbedding> ReadOnlySpan { get; internal set; }
67+
public ReadOnlySpan<TEmbedding> ReadOnlySpan { get; }
6868

6969
/// <summary>
7070
/// True if the data was specified to be normalized at construction.
7171
/// </summary>
72-
public bool IsNormalized { get; internal set; }
72+
public bool IsNormalized { get; }
7373

7474
/// <summary>
7575
/// Calculates the dot product of this vector with another.

dotnet/src/SemanticKernel/AI/Embeddings/EmbeddingSpan.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public EmbeddingSpan(TEmbedding[] vector)
3636
/// <summary>
3737
/// Gets the underlying <see cref="Span{T}"/> of unmanaged data.
3838
/// </summary>
39-
public Span<TEmbedding> Span { get; internal set; }
39+
public Span<TEmbedding> Span { get; }
4040

4141
/// <summary>
4242
/// Normalizes the underlying vector in-place, such that the Euclidean length is 1.

dotnet/src/SemanticKernel/Orchestration/Plan.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public sealed class Plan : ISKFunction
5959
/// Gets the next step index.
6060
/// </summary>
6161
[JsonPropertyName("next_step_index")]
62-
public int NextStepIndex { get; internal set; } = 0;
62+
public int NextStepIndex { get; private set; }
6363

6464
#region ISKFunction implementation
6565

@@ -77,11 +77,11 @@ public sealed class Plan : ISKFunction
7777

7878
/// <inheritdoc/>
7979
[JsonIgnore]
80-
public bool IsSemantic { get; internal set; } = false;
80+
public bool IsSemantic { get; private set; }
8181

8282
/// <inheritdoc/>
8383
[JsonIgnore]
84-
public CompleteRequestSettings RequestSettings { get; internal set; } = new();
84+
public CompleteRequestSettings RequestSettings { get; private set; } = new();
8585

8686
#endregion ISKFunction implementation
8787

0 commit comments

Comments
 (0)