mirror of
https://github.com/microsoft/semantic-kernel.git
synced 2026-10-12 02:19:06 +00:00
.Net: Add experimental attributes to packages (#3709)
### Motivation and Context Adding the experimental attribute to packages and classes in the .NET SDK of Semantic Kernel to mark things that won't be ready be v1.0.0 of Semantic Kernel. ### Contribution Checklist - [ ] The code builds clean without any errors or warnings - [ ] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [ ] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄 --------- Co-authored-by: Mark Wallace <[email protected]>
This commit is contained in:
co-authored by
Mark Wallace
parent
e0259c9e2c
commit
d2ddddeb94
@@ -52,7 +52,7 @@ jobs:
|
||||
- { dotnet: "6.0-jammy", os: "ubuntu", configuration: Debug }
|
||||
- { dotnet: "7.0-jammy", os: "ubuntu", configuration: Release }
|
||||
- {
|
||||
dotnet: "8.0-preview-jammy",
|
||||
dotnet: "8.0-jammy",
|
||||
os: "ubuntu",
|
||||
configuration: Release,
|
||||
}
|
||||
@@ -63,7 +63,7 @@ jobs:
|
||||
configuration: Debug,
|
||||
integration-tests: true,
|
||||
}
|
||||
- { dotnet: "8.0-preview", os: "windows", configuration: Release }
|
||||
- { dotnet: "8.0", os: "windows", configuration: Release }
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
@@ -84,7 +84,7 @@ jobs:
|
||||
|
||||
- name: Run Unit Tests
|
||||
run: |
|
||||
export UT_PROJECTS=$(find ./dotnet -type f -name "*.UnitTests.csproj" | grep -v -E "(Planners.Core.UnitTests.csproj|Experimental.Orchestration.Flow.UnitTests.csproj)" | tr '\n' ' ')
|
||||
export UT_PROJECTS=$(find ./dotnet -type f -name "*.UnitTests.csproj" | grep -v -E "(Planners.Core.UnitTests.csproj|Experimental.Orchestration.Flow.UnitTests.csproj)" | tr '\n' ' ')
|
||||
for project in $UT_PROJECTS; do
|
||||
dotnet test -c ${{ matrix.configuration }} $project --no-build -v Normal --logger trx
|
||||
done
|
||||
|
||||
@@ -22,14 +22,14 @@ jobs:
|
||||
- { os: ubuntu-latest, dotnet: '6.0', configuration: Debug }
|
||||
- { os: ubuntu-latest, dotnet: '6.0', configuration: Release }
|
||||
- { os: ubuntu-latest, dotnet: '7.0', configuration: Release }
|
||||
- { os: ubuntu-latest, dotnet: '8.0-preview', configuration: Release }
|
||||
|
||||
- { os: ubuntu-latest, dotnet: '8.0', configuration: Release }
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
clean: true
|
||||
|
||||
|
||||
- name: Find solutions
|
||||
shell: bash
|
||||
run: echo "solutions=$(find ./ -type f -name "*.sln" | tr '\n' ' ')" >> $GITHUB_ENV
|
||||
@@ -43,7 +43,7 @@ jobs:
|
||||
for solution in ${{ env.solutions }}; do
|
||||
docker run --rm -v $(pwd):/app -w /app -e GITHUB_ACTIONS='true' mcr.microsoft.com/dotnet/sdk:${{ matrix.dotnet }} /bin/sh -c "dotnet build -c ${{ matrix.configuration }} /app/$solution"
|
||||
done
|
||||
|
||||
|
||||
- name: Find test projects
|
||||
shell: bash
|
||||
run: echo "testprojects=$(find ./dotnet -type f -name "*UnitTests.csproj" | tr '\n' ' ')" >> $GITHUB_ENV
|
||||
|
||||
@@ -27,18 +27,18 @@ jobs:
|
||||
include:
|
||||
#- { dotnet: '6.0', configuration: Release, os: ubuntu-latest }
|
||||
- { dotnet: '7.0', configuration: Release, os: ubuntu-latest }
|
||||
#- { dotnet: '8.0-preview', configuration: Release, os: ubuntu-latest }
|
||||
|
||||
#- { dotnet: '8.0', configuration: Release, os: ubuntu-latest }
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
NUGET_CERT_REVOCATION_MODE: offline
|
||||
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
if: github.event_name == 'pull_request'
|
||||
@@ -65,7 +65,7 @@ jobs:
|
||||
csproj_files+=("$(find "$dir" -maxdepth 1 -name "*.csproj" -print -quit)")
|
||||
break
|
||||
fi
|
||||
|
||||
|
||||
dir=$(echo ${dir%/*})
|
||||
done
|
||||
done
|
||||
|
||||
Vendored
+2
-1
@@ -71,7 +71,8 @@
|
||||
"**/Thumbs.db": true
|
||||
},
|
||||
"cSpell.words": [
|
||||
"Partitioner"
|
||||
"Partitioner",
|
||||
"SKEXP"
|
||||
],
|
||||
"[java]": {
|
||||
"editor.formatOnSave": false,
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
# Experiments
|
||||
|
||||
The following capabilities are marked experimental in the .NET SDK. Once the APIs for these features are stable, the experimental attribute will be removed. In the meantime, these features are subject to change.
|
||||
|
||||
You can use the following diagnostic IDs to ignore warnings or errors for a particular experimental feature. For example, to ignore warnings for the embedding services, add `SKEXP0001` to your list of ignored warnings in your .NET project file as well as the ID for the embedding service you want to use. For example:
|
||||
|
||||
```xml
|
||||
<PropertyGroup>
|
||||
<NoWarn>SKEXP0001,SKEXP0011</NoWarn>
|
||||
</PropertyGroup>
|
||||
```
|
||||
|
||||
## Core
|
||||
|
||||
- SKEXP0001: Embedding services
|
||||
- SKEXP0002: Image services
|
||||
- SKEXP0003: Memory connectors
|
||||
|
||||
## OpenAI and Azure OpenAI services
|
||||
|
||||
- SKEXP0010: Azure OpenAI with your data service
|
||||
- SKEXP0011: OpenAI embedding service
|
||||
- SKEXP0012: OpenAI image service
|
||||
|
||||
## Memory connectors
|
||||
|
||||
- SKEXP0020: Hugging Face AI connector
|
||||
- SKEXP0021: Azure AI Search memory connector
|
||||
- SKEXP0022: Chroma memory connector
|
||||
- SKEXP0023: DuckDB memory connector
|
||||
- SKEXP0024: Kusto memory connector
|
||||
- SKEXP0025: Milvus memory connector
|
||||
- SKEXP0026: Qdrant memory connector
|
||||
- SKEXP0027: Redis memory connector
|
||||
- SKEXP0028: Sqlite memory connector
|
||||
- SKEXP0029: Weaviate memory connector
|
||||
- SKEXP0030: MongoDB memory connector
|
||||
- SKEXP0031: Pinecone memory connector
|
||||
- SKEXP0032: Postgres memory connector
|
||||
|
||||
## Functions
|
||||
|
||||
- SKEXP0040: GRPC functions
|
||||
- SKEXP0041: Markdown functions
|
||||
|
||||
## Out-of-the-box plugins
|
||||
|
||||
- SKEXP0050: Core plugins
|
||||
- SKEXP0051: Document plugins
|
||||
- SKEXP0052: Memory plugins
|
||||
- SKEXP0053: Microsoft 365 plugins
|
||||
- SKEXP0054: Web plugins
|
||||
- SKEXP0055: Text chunkcer plugin
|
||||
|
||||
## Planners
|
||||
|
||||
- SKEXP0060: Handlebars planner
|
||||
- SKEXP0061: OpenAI Stepwise planner
|
||||
|
||||
## Experiments
|
||||
|
||||
- SKEXP0101: Experiment with Assistants
|
||||
- SKEXP0102: Experiment with Flow Orchestration
|
||||
@@ -9,7 +9,7 @@
|
||||
<OutputType>Exe</OutputType>
|
||||
<IsPackable>false</IsPackable>
|
||||
<!-- Suppress: "Declare types in namespaces", "Require ConfigureAwait", "Experimental" -->
|
||||
<NoWarn>CA1050;CA1707;CA2007;VSTHRD111;CS1591;SKEXP0001</NoWarn>
|
||||
<NoWarn>CA1050,CA1707,CA2007,VSTHRD111,CS1591,SKEXP0001,SKEXP0002,SKEXP0003,SKEXP0010,SKEXP0011,,SKEXP0012,SKEXP0020,SKEXP0021,SKEXP0022,SKEXP0023,SKEXP0024,SKEXP0025,SKEXP0026,SKEXP0027,SKEXP0028,SKEXP0029,SKEXP0030,SKEXP0031,SKEXP0032,SKEXP0040,SKEXP0041,SKEXP0050,SKEXP0051,SKEXP0052,SKEXP0053,SKEXP0054,SKEXP0055,SKEXP0060,SKEXP0061,SKEXP0101,SKEXP0102</NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Remove="Example12_SequentialPlanner.cs" />
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<ImplicitUsings>disable</ImplicitUsings>
|
||||
<IsPackable>false</IsPackable>
|
||||
<!-- Suppress: "Declare types in namespaces", "Require ConfigureAwait" -->
|
||||
<NoWarn>CA1050;CA1707;CA2007;VSTHRD111</NoWarn>
|
||||
<NoWarn>CA1050;CA1707;CA2007;VSTHRD111,SKEXP0050,SKEXP0054,SKEXP0060</NoWarn>
|
||||
<UserSecretsId>5ee045b0-aea3-4f08-8d31-32d1a6f8fed0</UserSecretsId>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<PackageReference Include="Azure.Monitor.OpenTelemetry.Exporter" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\Connectors\Connectors.AI.OpenAI\Connectors.AI.OpenAI.csproj" />
|
||||
<ProjectReference Include="..\..\src\Planners\Planners.Handlebars\Planners.Handlebars.csproj" />
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
// This assembly is currently experimental.
|
||||
[assembly: Experimental("SKEXP0020")]
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
@@ -14,6 +15,7 @@ namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI;
|
||||
/// <summary>
|
||||
/// Streaming chat result update.
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0010")]
|
||||
public sealed class StreamingChatWithDataContent : StreamingContent
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
|
||||
+2
@@ -2,6 +2,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -27,6 +28,7 @@ namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.ChatCompletionWithData;
|
||||
/// Azure OpenAI Chat Completion with data client.
|
||||
/// More information: <see href="https://learn.microsoft.com/en-us/azure/ai-services/openai/use-your-data-quickstart"/>
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0010")]
|
||||
public sealed class AzureOpenAIChatCompletionWithData : IChatCompletion, ITextCompletion
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
+3
@@ -1,11 +1,14 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.ChatCompletionWithData;
|
||||
|
||||
/// <summary>
|
||||
/// Required configuration for Azure OpenAI chat completion with data.
|
||||
/// More information: <see href="https://learn.microsoft.com/en-us/azure/ai-services/openai/use-your-data-quickstart"/>
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0010")]
|
||||
public class AzureOpenAIChatCompletionWithDataConfig
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
+1
@@ -7,6 +7,7 @@ using System.Text.Json.Serialization;
|
||||
|
||||
namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.ChatCompletionWithData;
|
||||
|
||||
[Experimental("SKEXP0010")]
|
||||
[SuppressMessage("Performance", "CA1812:Avoid uninstantiated internal classes", Justification = "Used for JSON deserialization")]
|
||||
internal sealed class ChatWithDataChoice
|
||||
{
|
||||
|
||||
+2
@@ -1,9 +1,11 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.ChatCompletionWithData;
|
||||
|
||||
[Experimental("SKEXP0010")]
|
||||
internal sealed class ChatWithDataMessage
|
||||
{
|
||||
[JsonPropertyName("role")]
|
||||
|
||||
+2
@@ -1,12 +1,14 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.ChatCompletionWithData;
|
||||
|
||||
/// <summary>
|
||||
/// Represents result of a chat completion with data.
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0010")]
|
||||
public class ChatWithDataModelResult
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
+2
@@ -2,10 +2,12 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.ChatCompletionWithData;
|
||||
|
||||
[Experimental("SKEXP0010")]
|
||||
internal sealed class ChatWithDataRequest
|
||||
{
|
||||
[JsonPropertyName("temperature")]
|
||||
|
||||
+2
@@ -2,12 +2,14 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.ChatCompletionWithData;
|
||||
|
||||
#pragma warning disable CA1812 // Avoid uninstantiated internal classes
|
||||
|
||||
[Experimental("SKEXP0010")]
|
||||
internal sealed class ChatWithDataResponse
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
|
||||
+2
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -10,6 +11,7 @@ using Microsoft.SemanticKernel.AI.TextCompletion;
|
||||
|
||||
namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.ChatCompletionWithData;
|
||||
|
||||
[Experimental("SKEXP0010")]
|
||||
internal sealed class ChatWithDataResult : IChatResult, ITextResult
|
||||
{
|
||||
public ModelResult ModelResult { get; }
|
||||
|
||||
+2
@@ -1,9 +1,11 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.ChatCompletionWithData;
|
||||
|
||||
[Experimental("SKEXP0010")]
|
||||
internal sealed class ChatWithDataSource
|
||||
{
|
||||
[JsonPropertyName("type")]
|
||||
|
||||
+2
@@ -1,9 +1,11 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.ChatCompletionWithData;
|
||||
|
||||
[Experimental("SKEXP0010")]
|
||||
internal sealed class ChatWithDataSourceParameters
|
||||
{
|
||||
[JsonPropertyName("endpoint")]
|
||||
|
||||
+3
@@ -1,7 +1,10 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.ChatCompletionWithData;
|
||||
|
||||
[Experimental("SKEXP0010")]
|
||||
internal enum ChatWithDataSourceType
|
||||
{
|
||||
AzureCognitiveSearch
|
||||
|
||||
+1
@@ -7,6 +7,7 @@ using System.Text.Json.Serialization;
|
||||
|
||||
namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.ChatCompletionWithData;
|
||||
|
||||
[Experimental("SKEXP0010")]
|
||||
[SuppressMessage("Performance", "CA1812:Avoid uninstantiated internal classes", Justification = "Used for JSON deserialization")]
|
||||
internal sealed class ChatWithDataStreamingChoice
|
||||
{
|
||||
|
||||
+2
@@ -1,9 +1,11 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.ChatCompletionWithData;
|
||||
|
||||
[Experimental("SKEXP0010")]
|
||||
internal sealed class ChatWithDataStreamingDelta
|
||||
{
|
||||
[JsonPropertyName("role")]
|
||||
|
||||
+1
@@ -5,6 +5,7 @@ using System.Text.Json.Serialization;
|
||||
|
||||
namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.ChatCompletionWithData;
|
||||
|
||||
[Experimental("SKEXP0010")]
|
||||
[SuppressMessage("Performance", "CA1812:Avoid uninstantiated internal classes", Justification = "Used for JSON deserialization")]
|
||||
internal sealed class ChatWithDataStreamingMessage
|
||||
{
|
||||
|
||||
+1
@@ -7,6 +7,7 @@ using System.Text.Json.Serialization;
|
||||
|
||||
namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.ChatCompletionWithData;
|
||||
|
||||
[Experimental("SKEXP0010")]
|
||||
[SuppressMessage("Performance", "CA1812:Avoid uninstantiated internal classes", Justification = "Used for JSON deserialization")]
|
||||
internal sealed class ChatWithDataStreamingResponse
|
||||
{
|
||||
|
||||
+2
@@ -2,6 +2,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
@@ -11,6 +12,7 @@ using Microsoft.SemanticKernel.AI.ChatCompletion;
|
||||
|
||||
namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.ChatCompletionWithData;
|
||||
|
||||
[Experimental("SKEXP0010")]
|
||||
internal sealed class ChatWithDataStreamingResult
|
||||
{
|
||||
public ModelResult ModelResult { get; }
|
||||
|
||||
+3
@@ -2,6 +2,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
@@ -43,6 +44,7 @@ internal sealed class OpenAIImageGenerationClientCore
|
||||
/// <param name="requestBody">Request payload</param>
|
||||
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
|
||||
/// <returns>List of text embeddings</returns>
|
||||
[Experimental("SKEXP0011")]
|
||||
internal async Task<IList<ReadOnlyMemory<float>>> ExecuteTextEmbeddingRequestAsync(
|
||||
string url,
|
||||
string requestBody,
|
||||
@@ -65,6 +67,7 @@ internal sealed class OpenAIImageGenerationClientCore
|
||||
/// <param name="extractResponseFunc">Function to invoke to extract the desired portion of the image generation response.</param>
|
||||
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
|
||||
/// <returns>List of image URLs</returns>
|
||||
[Experimental("SKEXP0012")]
|
||||
internal async Task<IList<string>> ExecuteImageGenerationRequestAsync(
|
||||
string url,
|
||||
string requestBody,
|
||||
|
||||
+2
@@ -2,6 +2,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Text.Json;
|
||||
@@ -17,6 +18,7 @@ namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.ImageGeneration;
|
||||
/// Azure OpenAI Image generation
|
||||
/// <see herf="https://learn.microsoft.com/en-us/azure/cognitive-services/openai/reference#image-generation" />
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0012")]
|
||||
public sealed class AzureOpenAIImageGeneration : IImageGeneration
|
||||
{
|
||||
private readonly OpenAIImageGenerationClientCore _core;
|
||||
|
||||
+2
@@ -1,5 +1,6 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.ImageGeneration;
|
||||
@@ -7,6 +8,7 @@ namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.ImageGeneration;
|
||||
/// <summary>
|
||||
/// Image generation response
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0012")]
|
||||
public class AzureOpenAIImageGenerationResponse
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
+3
@@ -1,11 +1,14 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.ImageGeneration;
|
||||
|
||||
/// <summary>
|
||||
/// Azure OpenAI image generation response status
|
||||
/// <see herf="https://learn.microsoft.com/en-us/azure/cognitive-services/openai/reference#image-generation" />
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0012")]
|
||||
public static class AzureOpenAIImageOperationStatus
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.ImageGeneration;
|
||||
@@ -7,6 +8,7 @@ namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.ImageGeneration;
|
||||
/// <summary>
|
||||
/// Image generation request
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0012")]
|
||||
public sealed class ImageGenerationRequest
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.ImageGeneration;
|
||||
/// <summary>
|
||||
/// Image generation response
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0012")]
|
||||
public class ImageGenerationResponse
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Net.Http;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
@@ -14,6 +15,7 @@ namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.ImageGeneration;
|
||||
/// <summary>
|
||||
/// A class for generating images using OpenAI's API.
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0012")]
|
||||
public sealed class OpenAIImageGeneration : IImageGeneration
|
||||
{
|
||||
private readonly OpenAIImageGenerationClientCore _core;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Net.Http;
|
||||
using Azure.Core;
|
||||
using Microsoft.SemanticKernel.Connectors.AI.OpenAI.TextEmbedding;
|
||||
@@ -23,6 +24,7 @@ public static class OpenAIMemoryBuilderExtensions
|
||||
/// <param name="modelId">Model identifier</param>
|
||||
/// <param name="httpClient">Custom <see cref="HttpClient"/> for HTTP requests.</param>
|
||||
/// <returns>Self instance</returns>
|
||||
[Experimental("SKEXP0011")]
|
||||
public static MemoryBuilder WithAzureOpenAITextEmbeddingGeneration(
|
||||
this MemoryBuilder builder,
|
||||
string deploymentName,
|
||||
@@ -52,6 +54,7 @@ public static class OpenAIMemoryBuilderExtensions
|
||||
/// <param name="modelId">Model identifier</param>
|
||||
/// <param name="httpClient">Custom <see cref="HttpClient"/> for HTTP requests.</param>
|
||||
/// <returns>Self instance</returns>
|
||||
[Experimental("SKEXP0011")]
|
||||
public static MemoryBuilder WithAzureOpenAITextEmbeddingGeneration(
|
||||
this MemoryBuilder builder,
|
||||
string deploymentName,
|
||||
@@ -80,6 +83,7 @@ public static class OpenAIMemoryBuilderExtensions
|
||||
/// <param name="orgId">OpenAI organization id. This is usually optional unless your account belongs to multiple organizations.</param>
|
||||
/// <param name="httpClient">Custom <see cref="HttpClient"/> for HTTP requests.</param>
|
||||
/// <returns>Self instance</returns>
|
||||
[Experimental("SKEXP0011")]
|
||||
public static MemoryBuilder WithOpenAITextEmbeddingGeneration(
|
||||
this MemoryBuilder builder,
|
||||
string modelId,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Net.Http;
|
||||
using Azure;
|
||||
using Azure.AI.OpenAI;
|
||||
@@ -349,6 +350,7 @@ public static class OpenAIServiceCollectionExtensions
|
||||
/// <param name="modelId">Model identifier, see https://learn.microsoft.com/azure/cognitive-services/openai/quickstart</param>
|
||||
/// <param name="httpClient">The HttpClient to use with this service.</param>
|
||||
/// <returns>The same instance as <paramref name="builder"/>.</returns>
|
||||
[Experimental("SKEXP0011")]
|
||||
public static KernelBuilder WithAzureOpenAITextEmbeddingGeneration(
|
||||
this KernelBuilder builder,
|
||||
string deploymentName,
|
||||
@@ -386,6 +388,7 @@ public static class OpenAIServiceCollectionExtensions
|
||||
/// <param name="serviceId">A local identifier for the given AI service</param>
|
||||
/// <param name="modelId">Model identifier, see https://learn.microsoft.com/azure/cognitive-services/openai/quickstart</param>
|
||||
/// <returns>The same instance as <paramref name="services"/>.</returns>
|
||||
[Experimental("SKEXP0011")]
|
||||
public static IServiceCollection AddAzureOpenAITextEmbeddingGeneration(
|
||||
this IServiceCollection services,
|
||||
string deploymentName,
|
||||
@@ -420,6 +423,7 @@ public static class OpenAIServiceCollectionExtensions
|
||||
/// <param name="modelId">Model identifier, see https://learn.microsoft.com/azure/cognitive-services/openai/quickstart</param>
|
||||
/// <param name="httpClient">The HttpClient to use with this service.</param>
|
||||
/// <returns>The same instance as <paramref name="builder"/>.</returns>
|
||||
[Experimental("SKEXP0011")]
|
||||
public static KernelBuilder WithAzureOpenAITextEmbeddingGeneration(
|
||||
this KernelBuilder builder,
|
||||
string deploymentName,
|
||||
@@ -457,6 +461,7 @@ public static class OpenAIServiceCollectionExtensions
|
||||
/// <param name="serviceId">A local identifier for the given AI service</param>
|
||||
/// <param name="modelId">Model identifier, see https://learn.microsoft.com/azure/cognitive-services/openai/quickstart</param>
|
||||
/// <returns>The same instance as <paramref name="services"/>.</returns>
|
||||
[Experimental("SKEXP0011")]
|
||||
public static IServiceCollection AddAzureOpenAITextEmbeddingGeneration(
|
||||
this IServiceCollection services,
|
||||
string deploymentName,
|
||||
@@ -489,6 +494,7 @@ public static class OpenAIServiceCollectionExtensions
|
||||
/// <param name="serviceId">A local identifier for the given AI service</param>
|
||||
/// <param name="modelId">Model identifier, see https://learn.microsoft.com/azure/cognitive-services/openai/quickstart</param>
|
||||
/// <returns>The same instance as <paramref name="builder"/>.</returns>
|
||||
[Experimental("SKEXP0011")]
|
||||
public static KernelBuilder WithAzureOpenAITextEmbeddingGeneration(
|
||||
this KernelBuilder builder,
|
||||
string deploymentName,
|
||||
@@ -520,6 +526,7 @@ public static class OpenAIServiceCollectionExtensions
|
||||
/// <param name="serviceId">A local identifier for the given AI service</param>
|
||||
/// <param name="modelId">Model identifier, see https://learn.microsoft.com/azure/cognitive-services/openai/quickstart</param>
|
||||
/// <returns>The same instance as <paramref name="services"/>.</returns>
|
||||
[Experimental("SKEXP0011")]
|
||||
public static IServiceCollection AddAzureOpenAITextEmbeddingGeneration(
|
||||
this IServiceCollection services,
|
||||
string deploymentName,
|
||||
@@ -549,6 +556,7 @@ public static class OpenAIServiceCollectionExtensions
|
||||
/// <param name="serviceId">A local identifier for the given AI service</param>
|
||||
/// <param name="httpClient">The HttpClient to use with this service.</param>
|
||||
/// <returns>The same instance as <paramref name="builder"/>.</returns>
|
||||
[Experimental("SKEXP0011")]
|
||||
public static KernelBuilder WithOpenAITextEmbeddingGeneration(
|
||||
this KernelBuilder builder,
|
||||
string modelId,
|
||||
@@ -582,6 +590,7 @@ public static class OpenAIServiceCollectionExtensions
|
||||
/// <param name="orgId">OpenAI organization id. This is usually optional unless your account belongs to multiple organizations.</param>
|
||||
/// <param name="serviceId">A local identifier for the given AI service</param>
|
||||
/// <returns>The same instance as <paramref name="services"/>.</returns>
|
||||
[Experimental("SKEXP0011")]
|
||||
public static IServiceCollection AddOpenAITextEmbeddingGeneration(
|
||||
this IServiceCollection services,
|
||||
string modelId,
|
||||
@@ -610,6 +619,7 @@ public static class OpenAIServiceCollectionExtensions
|
||||
/// <param name="openAIClient">Custom <see cref="OpenAIClient"/>.</param>
|
||||
/// <param name="serviceId">A local identifier for the given AI service</param>
|
||||
/// <returns>The same instance as <paramref name="builder"/>.</returns>
|
||||
[Experimental("SKEXP0011")]
|
||||
public static KernelBuilder WithOpenAITextEmbeddingGeneration(
|
||||
this KernelBuilder builder,
|
||||
string modelId,
|
||||
@@ -638,6 +648,7 @@ public static class OpenAIServiceCollectionExtensions
|
||||
/// <param name="openAIClient">Custom <see cref="OpenAIClient"/>.</param>
|
||||
/// <param name="serviceId">A local identifier for the given AI service</param>
|
||||
/// <returns>The same instance as <paramref name="services"/>.</returns>
|
||||
[Experimental("SKEXP0011")]
|
||||
public static IServiceCollection AddOpenAITextEmbeddingGeneration(this IServiceCollection services,
|
||||
string modelId,
|
||||
OpenAIClient openAIClient,
|
||||
@@ -893,6 +904,7 @@ public static class OpenAIServiceCollectionExtensions
|
||||
/// <remarks>
|
||||
/// More information: <see href="https://learn.microsoft.com/en-us/azure/ai-services/openai/use-your-data-quickstart"/>
|
||||
/// </remarks>
|
||||
[Experimental("SKEXP0010")]
|
||||
public static KernelBuilder WithAzureOpenAIChatCompletion(
|
||||
this KernelBuilder builder,
|
||||
AzureOpenAIChatCompletionWithDataConfig config,
|
||||
@@ -923,6 +935,7 @@ public static class OpenAIServiceCollectionExtensions
|
||||
/// <remarks>
|
||||
/// More information: <see href="https://learn.microsoft.com/en-us/azure/ai-services/openai/use-your-data-quickstart"/>
|
||||
/// </remarks>
|
||||
[Experimental("SKEXP0010")]
|
||||
public static IServiceCollection AddAzureOpenAIChatCompletion(
|
||||
this IServiceCollection services,
|
||||
AzureOpenAIChatCompletionWithDataConfig config,
|
||||
@@ -1079,6 +1092,7 @@ public static class OpenAIServiceCollectionExtensions
|
||||
/// <param name="maxRetryCount">Maximum number of attempts to retrieve the image generation operation result.</param>
|
||||
/// <param name="httpClient">The HttpClient to use with this service.</param>
|
||||
/// <returns>The same instance as <paramref name="builder"/>.</returns>
|
||||
[Experimental("SKEXP0012")]
|
||||
public static KernelBuilder WithAzureOpenAIImageGeneration(
|
||||
this KernelBuilder builder,
|
||||
string endpoint,
|
||||
@@ -1112,6 +1126,7 @@ public static class OpenAIServiceCollectionExtensions
|
||||
/// <param name="serviceId">A local identifier for the given AI service</param>
|
||||
/// <param name="maxRetryCount">Maximum number of attempts to retrieve the image generation operation result.</param>
|
||||
/// <returns>The same instance as <paramref name="services"/>.</returns>
|
||||
[Experimental("SKEXP0012")]
|
||||
public static IServiceCollection AddAzureOpenAIImageGeneration(
|
||||
this IServiceCollection services,
|
||||
string endpoint,
|
||||
@@ -1141,6 +1156,7 @@ public static class OpenAIServiceCollectionExtensions
|
||||
/// <param name="serviceId">A local identifier for the given AI service</param>
|
||||
/// <param name="httpClient">The HttpClient to use with this service.</param>
|
||||
/// <returns>The same instance as <paramref name="builder"/>.</returns>
|
||||
[Experimental("SKEXP0012")]
|
||||
public static KernelBuilder WithOpenAIImageGeneration(
|
||||
this KernelBuilder builder,
|
||||
string apiKey,
|
||||
@@ -1170,6 +1186,7 @@ public static class OpenAIServiceCollectionExtensions
|
||||
/// <param name="orgId">OpenAI organization id. This is usually optional unless your account belongs to multiple organizations.</param>
|
||||
/// <param name="serviceId">A local identifier for the given AI service</param>
|
||||
/// <returns>The same instance as <paramref name="services"/>.</returns>
|
||||
[Experimental("SKEXP0012")]
|
||||
public static IServiceCollection AddOpenAIImageGeneration(this IServiceCollection services,
|
||||
string apiKey,
|
||||
string? orgId = null,
|
||||
|
||||
+2
@@ -2,6 +2,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -16,6 +17,7 @@ namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.TextEmbedding;
|
||||
/// <summary>
|
||||
/// Azure OpenAI text embedding service.
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0011")]
|
||||
public sealed class AzureOpenAITextEmbeddingGeneration : ITextEmbeddingGeneration
|
||||
{
|
||||
private readonly AzureOpenAIClientCore _core;
|
||||
|
||||
+2
@@ -2,6 +2,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -15,6 +16,7 @@ namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.TextEmbedding;
|
||||
/// <summary>
|
||||
/// OpenAI text embedding service.
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0011")]
|
||||
public sealed class OpenAITextEmbeddingGeneration : ITextEmbeddingGeneration
|
||||
{
|
||||
private readonly OpenAIClientCore _core;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.TextEmbedding;
|
||||
@@ -8,6 +9,7 @@ namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.TextEmbedding;
|
||||
/// <summary>
|
||||
/// A request to create embedding vector representing input text
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0011")]
|
||||
public abstract class TextEmbeddingRequest
|
||||
{
|
||||
/// <summary>
|
||||
@@ -20,6 +22,7 @@ public abstract class TextEmbeddingRequest
|
||||
/// <summary>
|
||||
/// An OpenAI embedding request
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0011")]
|
||||
public sealed class OpenAITextEmbeddingRequest : TextEmbeddingRequest
|
||||
{
|
||||
/// <summary>
|
||||
@@ -32,6 +35,7 @@ public sealed class OpenAITextEmbeddingRequest : TextEmbeddingRequest
|
||||
/// <summary>
|
||||
/// An Azure OpenAI embedding request
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0011")]
|
||||
public sealed class AzureOpenAITextEmbeddingRequest : TextEmbeddingRequest
|
||||
{
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json.Serialization;
|
||||
using Microsoft.SemanticKernel.Text;
|
||||
|
||||
@@ -10,6 +11,7 @@ namespace Microsoft.SemanticKernel.Connectors.AI.OpenAI.TextEmbedding;
|
||||
/// <summary>
|
||||
/// A response from an embedding request
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0011")]
|
||||
public sealed class TextEmbeddingResponse
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
// This assembly is currently experimental.
|
||||
[assembly: Experimental("SKEXP0021")]
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
// This assembly is currently experimental.
|
||||
[assembly: Experimental("SKEXP0022")]
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
// This assembly is currently experimental.
|
||||
[assembly: Experimental("SKEXP0023")]
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
// This assembly is currently experimental.
|
||||
[assembly: Experimental("SKEXP0024")]
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
// This assembly is currently experimental.
|
||||
[assembly: Experimental("SKEXP0025")]
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
// This assembly is currently experimental.
|
||||
[assembly: Experimental("SKEXP0030")]
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
// This assembly is currently experimental.
|
||||
[assembly: Experimental("SKEXP0031")]
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
// This assembly is currently experimental.
|
||||
[assembly: Experimental("SKEXP0032")]
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
// This assembly is currently experimental.
|
||||
[assembly: Experimental("SKEXP0026")]
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
// This assembly is currently experimental.
|
||||
[assembly: Experimental("SKEXP0027")]
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
// This assembly is currently experimental.
|
||||
[assembly: Experimental("SKEXP0028")]
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
// This assembly is currently experimental.
|
||||
[assembly: Experimental("SKEXP0029")]
|
||||
@@ -9,7 +9,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>disable</ImplicitUsings>
|
||||
<IsPackable>false</IsPackable>
|
||||
<NoWarn>CA2007,VSTHRD111</NoWarn>
|
||||
<NoWarn>CA2007,VSTHRD111,SKEXP0001,SKEXP0002,SKEXP0003,SKEXP0010,SKEXP0011,SKEXP0012,SKEXP0020,SKEXP0021,SKEXP0022,SKEXP0023,SKEXP0024,SKEXP0025,SKEXP0026,SKEXP0027,SKEXP0028,SKEXP0029,SKEXP0030,SKEXP0031,SKEXP0032,SKEXP0052</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<AssemblyName>SemanticKernel.Experimental.Assistants.UnitTests</AssemblyName>
|
||||
<RootNamespace>SemanticKernel.Experimental.Assistants.UnitTests</RootNamespace>
|
||||
@@ -8,7 +8,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>disable</ImplicitUsings>
|
||||
<IsPackable>false</IsPackable>
|
||||
<NoWarn>CS1591;SKEXP0001</NoWarn>
|
||||
<NoWarn>CS1591;SKEXP0101</NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Assistants\Experimental.Assistants.csproj" />
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
// This assembly is currently experimental.
|
||||
[assembly: Experimental("SKEXP0001")]
|
||||
[assembly: Experimental("SKEXP0101")]
|
||||
|
||||
@@ -10,8 +10,6 @@ using Microsoft.SemanticKernel.AI;
|
||||
using Microsoft.SemanticKernel.AI.ChatCompletion;
|
||||
using Microsoft.SemanticKernel.Connectors.AI.OpenAI;
|
||||
|
||||
#pragma warning disable SKEXP0001
|
||||
|
||||
namespace SemanticKernel.Experimental.Orchestration.Flow.IntegrationTests;
|
||||
|
||||
public sealed class CollectEmailPlugin
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
<RollForward>LatestMajor</RollForward>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
<IsPackable>false</IsPackable>
|
||||
<NoWarn>CA2007,VSTHRD111,SKEXP0001</NoWarn>
|
||||
<NoWarn>CA2007,VSTHRD111,SKEXP0102</NoWarn>
|
||||
<UserSecretsId>b7762d10-e29b-4bb1-8b74-b6d69a667dd4</UserSecretsId>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -14,8 +14,6 @@ using xRetry;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
#pragma warning disable SKEXP0001
|
||||
|
||||
namespace SemanticKernel.Experimental.Orchestration.Flow.IntegrationTests;
|
||||
|
||||
public sealed class FlowOrchestratorTests : IDisposable
|
||||
|
||||
@@ -4,8 +4,6 @@ using Microsoft.SemanticKernel.AI.ChatCompletion;
|
||||
using Microsoft.SemanticKernel.Experimental.Orchestration.Execution;
|
||||
using Xunit;
|
||||
|
||||
#pragma warning disable SKEXP0001
|
||||
|
||||
namespace SemanticKernel.Experimental.Orchestration.Flow.UnitTests;
|
||||
|
||||
public class ChatHistorySerializerTest
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>disable</ImplicitUsings>
|
||||
<IsPackable>false</IsPackable>
|
||||
<NoWarn>CA2007,VSTHRD111,SKEXP0001</NoWarn>
|
||||
<NoWarn>CA2007,VSTHRD111,SKEXP0102</NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" />
|
||||
|
||||
@@ -8,8 +8,6 @@ using Microsoft.SemanticKernel.Experimental.Orchestration;
|
||||
using Microsoft.SemanticKernel.Experimental.Orchestration.Abstractions;
|
||||
using Xunit;
|
||||
|
||||
#pragma warning disable SKEXP0001
|
||||
|
||||
namespace SemanticKernel.Experimental.Orchestration.Flow.UnitTests;
|
||||
|
||||
public class FlowExtensionsTests
|
||||
|
||||
@@ -5,8 +5,6 @@ using System.Linq;
|
||||
using Microsoft.SemanticKernel.Experimental.Orchestration;
|
||||
using Xunit;
|
||||
|
||||
#pragma warning disable SKEXP0001
|
||||
|
||||
namespace SemanticKernel.Experimental.Orchestration.Flow.UnitTests;
|
||||
|
||||
public class FlowSerializerTests
|
||||
|
||||
@@ -4,8 +4,6 @@ using System;
|
||||
using Microsoft.SemanticKernel.Experimental.Orchestration;
|
||||
using Xunit;
|
||||
|
||||
#pragma warning disable SKEXP0001
|
||||
|
||||
namespace SemanticKernel.Experimental.Orchestration.Flow.UnitTests;
|
||||
|
||||
public class FlowValidatorTests
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
// This assembly is currently experimental.
|
||||
[assembly: Experimental("SKEXP0001")]
|
||||
[assembly: Experimental("SKEXP0102")]
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
// This assembly is currently experimental.
|
||||
[assembly: Experimental("SKEXP0041")]
|
||||
@@ -8,6 +8,8 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(RepoRoot)/dotnet/nuget/nuget-package.props" />
|
||||
<Import Project="$(RepoRoot)/dotnet/src/InternalUtilities/src/InternalUtilities.props" />
|
||||
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- NuGet Package Settings -->
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>disable</ImplicitUsings>
|
||||
<IsPackable>false</IsPackable>
|
||||
<NoWarn>CA2007,VSTHRD111</NoWarn>
|
||||
<NoWarn>CA2007,VSTHRD111,SKEXP0040,SKEXP0041</NoWarn>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(RepoRoot)/dotnet/src/InternalUtilities/test/TestInternalUtilities.props" />
|
||||
<ItemGroup>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<RollForward>LatestMajor</RollForward>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
<IsPackable>false</IsPackable>
|
||||
<NoWarn>CA2007,VSTHRD111</NoWarn>
|
||||
<NoWarn>CA2007,VSTHRD111,SKEXP0001,SKEXP0002,SKEXP0003,SKEXP0010,SKEXP0011,SKEXP0012,SKEXP0020,SKEXP0021,SKEXP0022,SKEXP0023,SKEXP0024,SKEXP0025,SKEXP0026,SKEXP0027,SKEXP0028,SKEXP0029,SKEXP0030,SKEXP0031,SKEXP0032,SKEXP0060</NoWarn>
|
||||
<UserSecretsId>b7762d10-e29b-4bb1-8b74-b6d69a667dd4</UserSecretsId>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
@@ -58,7 +58,7 @@
|
||||
<ProjectReference Include="..\Plugins\Plugins.Web\Plugins.Web.csproj" />
|
||||
<ProjectReference Include="..\SemanticKernel.Core\SemanticKernel.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<!-- Use newest available compiler to handle newer source-generating libraries used in the examples. -->
|
||||
<!-- This can be removed once we no longer target the .NET 6 SDK in CI. -->
|
||||
|
||||
+5
-5
@@ -160,7 +160,7 @@ public sealed class HandlebarsTemplateEngineExtensionsTests
|
||||
// Act
|
||||
var result = HandlebarsTemplateEngineExtensions.Render(kernel, template, arguments);
|
||||
|
||||
// Assert
|
||||
// Assert
|
||||
Assert.Equal("Foo Bar", result);
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ public sealed class HandlebarsTemplateEngineExtensionsTests
|
||||
// Act
|
||||
var result = HandlebarsTemplateEngineExtensions.Render(kernel, template, arguments);
|
||||
|
||||
// Assert
|
||||
// Assert
|
||||
Assert.Equal("BazBar", result);
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ public sealed class HandlebarsTemplateEngineExtensionsTests
|
||||
// Act
|
||||
var result = HandlebarsTemplateEngineExtensions.Render(kernel, template, variables);
|
||||
|
||||
// Assert
|
||||
// Assert
|
||||
Assert.Equal("BazBar", result);
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ public sealed class HandlebarsTemplateEngineExtensionsTests
|
||||
var arguments = new Dictionary<string, object?>();
|
||||
kernel.ImportPluginFromObject(new Foo(), "Foo");
|
||||
|
||||
// Assert
|
||||
// Assert
|
||||
Assert.Throws<KernelException>(() => HandlebarsTemplateEngineExtensions.Render(kernel, template, arguments));
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ public sealed class HandlebarsTemplateEngineExtensionsTests
|
||||
var arguments = new Dictionary<string, object?>();
|
||||
kernel.ImportPluginFromObject(new Foo(), "Foo");
|
||||
|
||||
// Assert
|
||||
// Assert
|
||||
Assert.Throws<HandlebarsRuntimeException>(() => HandlebarsTemplateEngineExtensions.Render(kernel, template, arguments));
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<IsPackable>false</IsPackable>
|
||||
<NoWarn>CA2007,VSTHRD111</NoWarn>
|
||||
<NoWarn>CA2007,VSTHRD111,SKEXP0060</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
// This assembly is currently experimental.
|
||||
[assembly: Experimental("SKEXP0060")]
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
// This assembly is currently experimental.
|
||||
[assembly: Experimental("SKEXP0061")]
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
// This assembly is currently experimental.
|
||||
[assembly: Experimental("SKEXP0050")]
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
// This assembly is currently experimental.
|
||||
[assembly: Experimental("SKEXP0051")]
|
||||
@@ -8,6 +8,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(RepoRoot)/dotnet/nuget/nuget-package.props" />
|
||||
<Import Project="$(RepoRoot)/dotnet/src/InternalUtilities/src/InternalUtilities.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- NuGet Package Settings -->
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
// This assembly is currently experimental.
|
||||
[assembly: Experimental("SKEXP0052")]
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
// This assembly is currently experimental.
|
||||
[assembly: Experimental("SKEXP0053")]
|
||||
@@ -1,162 +0,0 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.// This was copied from https://github.com/dotnet/runtime/blob/39b9607807f29e48cae4652cd74735182b31182e/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/NullableAttributes.cs
|
||||
// and updated to have the scope of the attributes be internal.
|
||||
|
||||
namespace System.Diagnostics.CodeAnalysis;
|
||||
|
||||
#if !NETCOREAPP
|
||||
|
||||
/// <summary>Specifies that null is allowed as an input even if the corresponding type disallows it.</summary>
|
||||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)]
|
||||
internal sealed class AllowNullAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Specifies that null is disallowed as an input even if the corresponding type allows it.</summary>
|
||||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)]
|
||||
internal sealed class DisallowNullAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Specifies that an output may be null even if the corresponding type disallows it.</summary>
|
||||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false)]
|
||||
internal sealed class MaybeNullAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Specifies that an output will not be null even if the corresponding type allows it.</summary>
|
||||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false)]
|
||||
internal sealed class NotNullAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Specifies that when a method returns <see cref="ReturnValue"/>, the parameter may be null even if the corresponding type disallows it.</summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
|
||||
internal sealed class MaybeNullWhenAttribute : Attribute
|
||||
{
|
||||
/// <summary>Initializes the attribute with the specified return value condition.</summary>
|
||||
/// <param name="returnValue">
|
||||
/// The return value condition. If the method returns this value, the associated parameter may be null.
|
||||
/// </param>
|
||||
public MaybeNullWhenAttribute(bool returnValue) => this.ReturnValue = returnValue;
|
||||
|
||||
/// <summary>Gets the return value condition.</summary>
|
||||
public bool ReturnValue { get; }
|
||||
}
|
||||
|
||||
/// <summary>Specifies that when a method returns <see cref="ReturnValue"/>, the parameter will not be null even if the corresponding type allows it.</summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
|
||||
internal sealed class NotNullWhenAttribute : Attribute
|
||||
{
|
||||
/// <summary>Initializes the attribute with the specified return value condition.</summary>
|
||||
/// <param name="returnValue">
|
||||
/// The return value condition. If the method returns this value, the associated parameter will not be null.
|
||||
/// </param>
|
||||
public NotNullWhenAttribute(bool returnValue) => this.ReturnValue = returnValue;
|
||||
|
||||
/// <summary>Gets the return value condition.</summary>
|
||||
public bool ReturnValue { get; }
|
||||
}
|
||||
|
||||
/// <summary>Specifies that the output will be non-null if the named parameter is non-null.</summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
|
||||
internal sealed class NotNullIfNotNullAttribute : Attribute
|
||||
{
|
||||
/// <summary>Initializes the attribute with the associated parameter name.</summary>
|
||||
/// <param name="parameterName">
|
||||
/// The associated parameter name. The output will be non-null if the argument to the parameter specified is non-null.
|
||||
/// </param>
|
||||
public NotNullIfNotNullAttribute(string parameterName) => this.ParameterName = parameterName;
|
||||
|
||||
/// <summary>Gets the associated parameter name.</summary>
|
||||
public string ParameterName { get; }
|
||||
}
|
||||
|
||||
/// <summary>Applied to a method that will never return under any circumstance.</summary>
|
||||
[AttributeUsage(AttributeTargets.Method, Inherited = false)]
|
||||
internal sealed class DoesNotReturnAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Specifies that the method will not return if the associated Boolean parameter is passed the specified value.</summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
|
||||
internal sealed class DoesNotReturnIfAttribute : Attribute
|
||||
{
|
||||
/// <summary>Initializes the attribute with the specified parameter value.</summary>
|
||||
/// <param name="parameterValue">
|
||||
/// The condition parameter value. Code after the method will be considered unreachable by diagnostics if the argument to
|
||||
/// the associated parameter matches this value.
|
||||
/// </param>
|
||||
public DoesNotReturnIfAttribute(bool parameterValue) => this.ParameterValue = parameterValue;
|
||||
|
||||
/// <summary>Gets the condition parameter value.</summary>
|
||||
public bool ParameterValue { get; }
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if !NETCOREAPP || NETCOREAPP3_1
|
||||
|
||||
/// <summary>Specifies that the method or property will ensure that the listed field and property members have not-null values.</summary>
|
||||
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
|
||||
internal sealed class MemberNotNullAttribute : Attribute
|
||||
{
|
||||
/// <summary>Initializes the attribute with a field or property member.</summary>
|
||||
/// <param name="member">
|
||||
/// The field or property member that is promised to be not-null.
|
||||
/// </param>
|
||||
[SuppressMessage("Design", "CA1019:Define accessors for attribute arguments")]
|
||||
public MemberNotNullAttribute(string member) => this.Members = new[] { member };
|
||||
|
||||
/// <summary>Initializes the attribute with the list of field and property members.</summary>
|
||||
/// <param name="members">
|
||||
/// The list of field and property members that are promised to be not-null.
|
||||
/// </param>
|
||||
public MemberNotNullAttribute(params string[] members) => this.Members = members;
|
||||
|
||||
/// <summary>Gets field or property member names.</summary>
|
||||
public string[] Members { get; }
|
||||
}
|
||||
|
||||
/// <summary>Specifies that the method or property will ensure that the listed field and property members have not-null values when returning with the specified return value condition.</summary>
|
||||
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
|
||||
internal sealed class MemberNotNullWhenAttribute : Attribute
|
||||
{
|
||||
/// <summary>Initializes the attribute with the specified return value condition and a field or property member.</summary>
|
||||
/// <param name="returnValue">
|
||||
/// The return value condition. If the method returns this value, the associated parameter will not be null.
|
||||
/// </param>
|
||||
/// <param name="member">
|
||||
/// The field or property member that is promised to be not-null.
|
||||
/// </param>
|
||||
[SuppressMessage("Design", "CA1019:Define accessors for attribute arguments")]
|
||||
public MemberNotNullWhenAttribute(bool returnValue, string member)
|
||||
{
|
||||
this.ReturnValue = returnValue;
|
||||
this.Members = new[] { member };
|
||||
}
|
||||
|
||||
/// <summary>Initializes the attribute with the specified return value condition and list of field and property members.</summary>
|
||||
/// <param name="returnValue">
|
||||
/// The return value condition. If the method returns this value, the associated parameter will not be null.
|
||||
/// </param>
|
||||
/// <param name="members">
|
||||
/// The list of field and property members that are promised to be not-null.
|
||||
/// </param>
|
||||
public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
|
||||
{
|
||||
this.ReturnValue = returnValue;
|
||||
this.Members = members;
|
||||
}
|
||||
|
||||
/// <summary>Gets the return value condition.</summary>
|
||||
public bool ReturnValue { get; }
|
||||
|
||||
/// <summary>Gets field or property member names.</summary>
|
||||
public string[] Members { get; }
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -8,6 +8,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(RepoRoot)/dotnet/nuget/nuget-package.props" />
|
||||
<Import Project="$(RepoRoot)/dotnet/src/InternalUtilities/src/InternalUtilities.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- NuGet Package Settings -->
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>disable</ImplicitUsings>
|
||||
<IsPackable>false</IsPackable>
|
||||
<NoWarn>CA2007,VSTHRD111</NoWarn>
|
||||
<NoWarn>CA2007,VSTHRD111,SKEXP0001,SKEXP0002,SKEXP0003,SKEXP0050,SKEXP0051,SKEXP0052,SKEXP0053,SKEXP0054</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(RepoRoot)/dotnet/src/InternalUtilities/test/TestInternalUtilities.props" />
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
// This assembly is currently experimental.
|
||||
[assembly: Experimental("SKEXP0054")]
|
||||
+3
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -10,6 +11,7 @@ namespace Microsoft.SemanticKernel.AI.Embeddings;
|
||||
/// <summary>
|
||||
/// Provides a collection of static methods for operating on <see cref="IEmbeddingGeneration{TValue,TEmbedding}"/> objects.
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0001")]
|
||||
public static class EmbeddingGenerationExtensions
|
||||
{
|
||||
/// <summary>
|
||||
@@ -22,6 +24,7 @@ public static class EmbeddingGenerationExtensions
|
||||
/// <param name="kernel">The <see cref="Kernel"/> containing services, plugins, and other state for use throughout the operation.</param>
|
||||
/// <param name="cancellationToken">Cancellation token</param>
|
||||
/// <returns>A list of embedding structs representing the input <paramref name="value"/>.</returns>
|
||||
[Experimental("SKEXP0001")]
|
||||
public static async Task<ReadOnlyMemory<TEmbedding>> GenerateEmbeddingAsync<TValue, TEmbedding>(
|
||||
this IEmbeddingGeneration<TValue, TEmbedding> generator,
|
||||
TValue value,
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.SemanticKernel.Services;
|
||||
@@ -13,6 +14,7 @@ namespace Microsoft.SemanticKernel.AI.Embeddings;
|
||||
/// </summary>
|
||||
/// <typeparam name="TValue">The type from which embeddings will be generated.</typeparam>
|
||||
/// <typeparam name="TEmbedding">The numeric type of the embedding data.</typeparam>
|
||||
[Experimental("SKEXP0001")]
|
||||
public interface IEmbeddingGeneration<TValue, TEmbedding> : IAIService
|
||||
where TEmbedding : unmanaged
|
||||
{
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Microsoft.SemanticKernel.AI.Embeddings;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a generator of text embeddings of type <c>float</c>.
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0001")]
|
||||
public interface ITextEmbeddingGeneration : IEmbeddingGeneration<string, float>
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.SemanticKernel.Services;
|
||||
@@ -9,6 +10,7 @@ namespace Microsoft.SemanticKernel.AI.ImageGeneration;
|
||||
/// <summary>
|
||||
/// Interface for image generation services
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0002")]
|
||||
public interface IImageGeneration : IAIService
|
||||
{
|
||||
/// <summary>
|
||||
@@ -20,6 +22,7 @@ public interface IImageGeneration : IAIService
|
||||
/// <param name="kernel">The <see cref="Kernel"/> containing services, plugins, and other state for use throughout the operation.</param>
|
||||
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
|
||||
/// <returns>Generated image in base64 format or image URL</returns>
|
||||
[Experimental("SKEXP0002")]
|
||||
public Task<string> GenerateImageAsync(
|
||||
string description,
|
||||
int width,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Microsoft.SemanticKernel.Memory;
|
||||
@@ -8,6 +9,7 @@ namespace Microsoft.SemanticKernel.Memory;
|
||||
/// <summary>
|
||||
/// A base class for data entries.
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0003")]
|
||||
public class DataEntryBase
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -10,6 +11,7 @@ namespace Microsoft.SemanticKernel.Memory;
|
||||
/// <summary>
|
||||
/// An interface for storing and retrieving indexed <see cref="MemoryRecord"/> objects in a data store.
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0003")]
|
||||
public interface IMemoryStore
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -9,6 +10,7 @@ namespace Microsoft.SemanticKernel.Memory;
|
||||
/// <summary>
|
||||
/// An interface for semantic memory that creates and recalls memories associated with text.
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0003")]
|
||||
public interface ISemanticTextMemory
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json.Serialization;
|
||||
using Microsoft.SemanticKernel.Text;
|
||||
|
||||
@@ -9,6 +10,7 @@ namespace Microsoft.SemanticKernel.Memory;
|
||||
/// <summary>
|
||||
/// Copy of metadata associated with a memory entry.
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0003")]
|
||||
public class MemoryQueryResult
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using Microsoft.SemanticKernel.Text;
|
||||
@@ -10,6 +11,7 @@ namespace Microsoft.SemanticKernel.Memory;
|
||||
/// <summary>
|
||||
/// IMPORTANT: this is a storage schema. Changing the fields will invalidate existing metadata stored in persistent vector DBs.
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0003")]
|
||||
public class MemoryRecord : DataEntryBase
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Microsoft.SemanticKernel.Memory;
|
||||
@@ -8,6 +9,7 @@ namespace Microsoft.SemanticKernel.Memory;
|
||||
/// <summary>
|
||||
/// Class representing the metadata associated with a Semantic Kernel memory.
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0003")]
|
||||
public class MemoryRecordMetadata : ICloneable
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -10,6 +11,7 @@ namespace Microsoft.SemanticKernel.Memory;
|
||||
/// <summary>
|
||||
/// Implementation of <see cref="ISemanticTextMemory"/> that stores nothing.
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0003")]
|
||||
public sealed class NullMemory : ISemanticTextMemory
|
||||
{
|
||||
private static readonly Task<string> s_emptyStringTask = Task.FromResult(string.Empty);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
@@ -14,6 +15,7 @@ namespace Microsoft.SemanticKernel.Memory;
|
||||
/// Implementation of <see cref="ISemanticTextMemory"/>. Provides methods to save, retrieve, and search for text information
|
||||
/// in a semantic memory store.
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0003")]
|
||||
public sealed class SemanticTextMemory : ISemanticTextMemory
|
||||
{
|
||||
private readonly ITextEmbeddingGeneration _embeddingGenerator;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
@@ -13,6 +14,7 @@ namespace Microsoft.SemanticKernel.Text;
|
||||
/// For plain text, split looking at new lines first, then periods, and so on.
|
||||
/// For markdown, split looking at punctuation first, and so on.
|
||||
/// </summary>
|
||||
[Experimental("SKEXP0055")]
|
||||
public static class TextChunker
|
||||
{
|
||||
/// <summary>
|
||||
@@ -33,6 +35,7 @@ public static class TextChunker
|
||||
/// <param name="maxTokensPerLine">Maximum number of tokens per line.</param>
|
||||
/// <param name="tokenCounter">Function to count tokens in a string. If not supplied, the default counter will be used.</param>
|
||||
/// <returns>List of lines.</returns>
|
||||
[Experimental("SKEXP0055")]
|
||||
public static List<string> SplitPlainTextLines(string text, int maxTokensPerLine, TokenCounter? tokenCounter = null) =>
|
||||
InternalSplitLines(text, maxTokensPerLine, trim: true, s_plaintextSplitOptions, tokenCounter);
|
||||
|
||||
@@ -43,6 +46,7 @@ public static class TextChunker
|
||||
/// <param name="maxTokensPerLine">Maximum number of tokens per line.</param>
|
||||
/// <param name="tokenCounter">Function to count tokens in a string. If not supplied, the default counter will be used.</param>
|
||||
/// <returns>List of lines.</returns>
|
||||
[Experimental("SKEXP0055")]
|
||||
public static List<string> SplitMarkDownLines(string text, int maxTokensPerLine, TokenCounter? tokenCounter = null) =>
|
||||
InternalSplitLines(text, maxTokensPerLine, trim: true, s_markdownSplitOptions, tokenCounter);
|
||||
|
||||
@@ -55,6 +59,7 @@ public static class TextChunker
|
||||
/// <param name="chunkHeader">Text to be prepended to each individual chunk.</param>
|
||||
/// <param name="tokenCounter">Function to count tokens in a string. If not supplied, the default counter will be used.</param>
|
||||
/// <returns>List of paragraphs.</returns>
|
||||
[Experimental("SKEXP0055")]
|
||||
public static List<string> SplitPlainTextParagraphs(List<string> lines, int maxTokensPerParagraph, int overlapTokens = 0, string? chunkHeader = null, TokenCounter? tokenCounter = null) =>
|
||||
InternalSplitTextParagraphs(lines, maxTokensPerParagraph, overlapTokens, chunkHeader, static (text, maxTokens, tokenCounter) => InternalSplitLines(text, maxTokens, trim: false, s_plaintextSplitOptions, tokenCounter), tokenCounter);
|
||||
|
||||
@@ -67,9 +72,11 @@ public static class TextChunker
|
||||
/// <param name="chunkHeader">Text to be prepended to each individual chunk.</param>
|
||||
/// <param name="tokenCounter">Function to count tokens in a string. If not supplied, the default counter will be used.</param>
|
||||
/// <returns>List of paragraphs.</returns>
|
||||
[Experimental("SKEXP0055")]
|
||||
public static List<string> SplitMarkdownParagraphs(List<string> lines, int maxTokensPerParagraph, int overlapTokens = 0, string? chunkHeader = null, TokenCounter? tokenCounter = null) =>
|
||||
InternalSplitTextParagraphs(lines, maxTokensPerParagraph, overlapTokens, chunkHeader, static (text, maxTokens, tokenCounter) => InternalSplitLines(text, maxTokens, trim: false, s_markdownSplitOptions, tokenCounter), tokenCounter);
|
||||
|
||||
[Experimental("SKEXP0055")]
|
||||
private static List<string> InternalSplitTextParagraphs(List<string> lines, int maxTokensPerParagraph, int overlapTokens, string? chunkHeader, Func<string, int, TokenCounter?, List<string>> longLinesSplitter, TokenCounter? tokenCounter)
|
||||
{
|
||||
if (maxTokensPerParagraph <= 0)
|
||||
@@ -99,6 +106,7 @@ public static class TextChunker
|
||||
return processedParagraphs;
|
||||
}
|
||||
|
||||
[Experimental("SKEXP0055")]
|
||||
private static List<string> BuildParagraph(IEnumerable<string> truncatedLines, int maxTokensPerParagraph, TokenCounter? tokenCounter)
|
||||
{
|
||||
StringBuilder paragraphBuilder = new();
|
||||
@@ -139,6 +147,7 @@ public static class TextChunker
|
||||
return paragraphs;
|
||||
}
|
||||
|
||||
[Experimental("SKEXP0055")]
|
||||
private static List<string> ProcessParagraphs(List<string> paragraphs, int adjustedMaxTokensPerParagraph, int overlapTokens, string? chunkHeader, Func<string, int, TokenCounter?, List<string>> longLinesSplitter, TokenCounter? tokenCounter)
|
||||
{
|
||||
// distribute text more evenly in the last paragraphs when the last paragraph is too short.
|
||||
@@ -203,6 +212,7 @@ public static class TextChunker
|
||||
return processedParagraphs;
|
||||
}
|
||||
|
||||
[Experimental("SKEXP0055")]
|
||||
private static List<string> InternalSplitLines(string text, int maxTokensPerLine, bool trim, string?[] splitOptions, TokenCounter? tokenCounter)
|
||||
{
|
||||
var result = new List<string>();
|
||||
@@ -223,6 +233,7 @@ public static class TextChunker
|
||||
return result;
|
||||
}
|
||||
|
||||
[Experimental("SKEXP0055")]
|
||||
private static (List<string>, bool) Split(List<string> input, int maxTokens, ReadOnlySpan<char> separators, bool trim, TokenCounter? tokenCounter)
|
||||
{
|
||||
bool inputWasSplit = false;
|
||||
@@ -237,6 +248,7 @@ public static class TextChunker
|
||||
return (result, inputWasSplit);
|
||||
}
|
||||
|
||||
[Experimental("SKEXP0055")]
|
||||
private static (List<string>, bool) Split(ReadOnlySpan<char> input, string? inputString, int maxTokens, ReadOnlySpan<char> separators, bool trim, TokenCounter? tokenCounter)
|
||||
{
|
||||
Debug.Assert(inputString is null || input.SequenceEqual(inputString.AsSpan()));
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
<PropertyGroup>
|
||||
<RootNamespace>SemanticKernel.UnitTests</RootNamespace>
|
||||
<AssemblyName>SemanticKernel.UnitTests</AssemblyName>
|
||||
<TargetFrameworks>net6.0</TargetFrameworks> <!-- ;net48 -->
|
||||
<TargetFrameworks>net6.0</TargetFrameworks> <!-- ;net48 -->
|
||||
<RollForward>LatestMajor</RollForward>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
<IsPackable>false</IsPackable>
|
||||
<NoWarn>CA2007,VSTHRD111</NoWarn>
|
||||
<NoWarn>CA2007,VSTHRD111,SKEXP0001,SKEXP0002,SKEXP0003,SKEXP0055</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(RepoRoot)/dotnet/src/InternalUtilities/test/TestInternalUtilities.props" />
|
||||
|
||||
Reference in New Issue
Block a user