mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
* Implement CosmosDB actor state storage. * Fix. * Minor fixes. * Fixes. * Make CosmosDB initialization be lazy. * Remove unnecessary read from write path. * Throw on empty writes. * Add arg validation for read. * Add CosmosIdSanitizer. * Fix. * Fix. * Simplify doc IDs. * Update comment. * fb * Make LazyCosmosContainer internal and add tests. * Make test constants public and remove IVT. * Use source generated JSON context for future nativeAOT support. * Re-add dropped comments.
21 lines
808 B
C#
21 lines
808 B
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
using Microsoft.Extensions.AI.Agents.Runtime.Storage.CosmosDB.Tests;
|
|
|
|
var builder = DistributedApplication.CreateBuilder(args);
|
|
var cosmosDb = builder.AddAzureCosmosDB(CosmosDBTestConstants.TestCosmosDbName);
|
|
|
|
if (CosmosDBTestConstants.UseEmulatorForTesting)
|
|
{
|
|
cosmosDb.RunAsEmulator(emulator => emulator.WithLifetime(ContainerLifetime.Persistent));
|
|
}
|
|
else
|
|
{
|
|
var cosmosDbResource = builder.AddParameterFromConfiguration("CosmosDbName", "CosmosDb:Name");
|
|
var cosmosDbResourceGroup = builder.AddParameterFromConfiguration("CosmosDbResourceGroup", "CosmosDb:ResourceGroup");
|
|
cosmosDb.RunAsExisting(cosmosDbResource, cosmosDbResourceGroup);
|
|
}
|
|
|
|
cosmosDb.AddCosmosDatabase(CosmosDBTestConstants.TestCosmosDbDatabaseName);
|
|
|
|
builder.Build().Run();
|