Skip to content

Commit a9a644f

Browse files
authored
Merge branch 'main' into feature_agent_filters
2 parents bca9e8c + d2bc3a8 commit a9a644f

File tree

6 files changed

+29
-11
lines changed

6 files changed

+29
-11
lines changed

dotnet/Directory.Packages.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<PackageVersion Include="JsonSchema.Net" Version="5.4.2" />
1919
<PackageVersion Include="Microsoft.Azure.Functions.Worker" Version="1.20.1" />
2020
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.1.0" />
21-
<PackageVersion Include="Microsoft.Azure.Kusto.Data" Version="11.3.5" />
21+
<PackageVersion Include="Microsoft.Azure.Kusto.Data" Version="12.2.2" />
2222
<PackageVersion Include="Microsoft.Azure.WebJobs.Extensions.OpenApi" Version="1.5.1" />
2323
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
2424
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />

dotnet/src/Connectors/Connectors.Memory.Kusto/KustoMemoryStore.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ protected virtual void Dispose(bool disposing)
358358
/// <param name="collectionName">Kusto table name.</param>
359359
/// <param name="normalized">Boolean flag that indicates if table name normalization is needed.</param>
360360
private static string GetTableName(string collectionName, bool normalized = true)
361-
=> normalized ? CslSyntaxGenerator.NormalizeTableName(collectionName) : collectionName;
361+
=> normalized ? CslSyntaxGenerator.NormalizeName(collectionName) : collectionName;
362362

363363
/// <summary>
364364
/// Converts Kusto table name to collection name.

dotnet/src/Connectors/Connectors.OpenAI/AzureSdk/ClientCore.cs

+12-1
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,18 @@ internal async IAsyncEnumerable<OpenAIStreamingChatMessageContent> GetStreamingC
693693
OpenAIFunctionToolCall.TrackStreamingToolingUpdate(update.ToolCallUpdate, ref toolCallIdsByIndex, ref functionNamesByIndex, ref functionArgumentBuildersByIndex);
694694
}
695695

696-
var openAIStreamingChatMessageContent = new OpenAIStreamingChatMessageContent(update, update.ChoiceIndex ?? 0, this.DeploymentOrModelName, metadata) { AuthorName = streamedName };
696+
AuthorRole? role = null;
697+
if (streamedRole.HasValue)
698+
{
699+
role = new AuthorRole(streamedRole.Value.ToString());
700+
}
701+
702+
OpenAIStreamingChatMessageContent openAIStreamingChatMessageContent =
703+
new(update, update.ChoiceIndex ?? 0, this.DeploymentOrModelName, metadata)
704+
{
705+
AuthorName = streamedName,
706+
Role = role,
707+
};
697708

698709
if (update.ToolCallUpdate is StreamingFunctionToolCallUpdate functionCallUpdate)
699710
{

dotnet/src/Connectors/Connectors.UnitTests/Memory/Kusto/KustoMemoryStoreTests.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public class KustoMemoryStoreTests
2525
private const string DatabaseName = "FakeDb";
2626
private readonly Mock<ICslQueryProvider> _cslQueryProviderMock;
2727
private readonly Mock<ICslAdminProvider> _cslAdminProviderMock;
28+
private readonly string _normalisedCollectionName = CslSyntaxGenerator.NormalizeName(CollectionName);
2829

2930
public KustoMemoryStoreTests()
3031
{
@@ -145,7 +146,7 @@ public async Task ItCanUpsertAsync()
145146
// Assert
146147
this._cslAdminProviderMock.Verify(client => client.ExecuteControlCommandAsync(
147148
DatabaseName,
148-
It.Is<string>(s => s.StartsWith($".ingest inline into table {CollectionName}", StringComparison.Ordinal) && s.Contains(actualMemoryRecordKey, StringComparison.Ordinal)),
149+
It.Is<string>(s => s.StartsWith($".ingest inline into table {this._normalisedCollectionName}", StringComparison.Ordinal) && s.Contains(actualMemoryRecordKey, StringComparison.Ordinal)),
149150
It.IsAny<ClientRequestProperties>()), Times.Once());
150151
Assert.Equal(expectedMemoryRecord.Key, actualMemoryRecordKey);
151152
}
@@ -171,7 +172,7 @@ public async Task ItCanUpsertBatchAsyncAsync()
171172
.Verify(client => client.ExecuteControlCommandAsync(
172173
DatabaseName,
173174
It.Is<string>(s =>
174-
s.StartsWith($".ingest inline into table {CollectionName}", StringComparison.Ordinal) &&
175+
s.StartsWith($".ingest inline into table {this._normalisedCollectionName}", StringComparison.Ordinal) &&
175176
batchUpsertMemoryRecords.All(r => s.Contains(r.Key, StringComparison.Ordinal))),
176177
It.IsAny<ClientRequestProperties>()
177178
), Times.Once());
@@ -306,7 +307,7 @@ public async Task ItCanRemoveAsync()
306307
this._cslAdminProviderMock
307308
.Verify(client => client.ExecuteControlCommandAsync(
308309
DatabaseName,
309-
It.Is<string>(s => s.Replace(" ", " ").StartsWith($".delete table {CollectionName}") && s.Contains(MemoryRecordKey)), // Replace double spaces with single space to account for the fact that the query is formatted with double spaces and to be future proof
310+
It.Is<string>(s => s.Replace(" ", " ").StartsWith($".delete table {this._normalisedCollectionName}") && s.Contains(MemoryRecordKey)), // Replace double spaces with single space to account for the fact that the query is formatted with double spaces and to be future proof
310311
It.IsAny<ClientRequestProperties>()
311312
), Times.Once());
312313
}
@@ -325,7 +326,7 @@ public async Task ItCanRemoveBatchAsync()
325326
this._cslAdminProviderMock
326327
.Verify(client => client.ExecuteControlCommandAsync(
327328
DatabaseName,
328-
It.Is<string>(s => s.Replace(" ", " ").StartsWith($".delete table {CollectionName}") && memoryRecordKeys.All(r => s.Contains(r, StringComparison.OrdinalIgnoreCase))),
329+
It.Is<string>(s => s.Replace(" ", " ").StartsWith($".delete table {this._normalisedCollectionName}") && memoryRecordKeys.All(r => s.Contains(r, StringComparison.OrdinalIgnoreCase))),
329330
It.IsAny<ClientRequestProperties>()
330331
), Times.Once());
331332
}

dotnet/src/IntegrationTests/Connectors/OpenAI/OpenAICompletionTests.cs

+5
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ public async Task AzureOpenAIStreamingTestAsync(bool useChatModel, string prompt
128128
// Act
129129
await foreach (var content in target.InvokeStreamingAsync<StreamingKernelContent>(plugins["ChatPlugin"]["Chat"], new() { [InputParameterName] = prompt }))
130130
{
131+
if (content is StreamingChatMessageContent messageContent)
132+
{
133+
Assert.NotNull(messageContent.Role);
134+
}
135+
131136
fullResult.Append(content);
132137
}
133138

python/poetry.lock

+5-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)