mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Samples fixes (#5169)
This commit is contained in:
committed by
GitHub
Unverified
parent
30a2bc3dcb
commit
79afda1a6c
@@ -246,7 +246,7 @@ internal static class AgentsSamples
|
||||
ExpectedOutputDescription =
|
||||
[
|
||||
"The output should contain information about both the current time and the weather in Seattle.",
|
||||
"The weather information should reference the plugin result: cloudy with a high of 15°C.",
|
||||
"The weather information should be similar to: cloudy with a high of 15°C. Exact phrasing may vary.",
|
||||
"The output should not contain error messages or stack traces.",
|
||||
],
|
||||
},
|
||||
@@ -521,7 +521,7 @@ internal static class AgentsSamples
|
||||
OptionalEnvironmentVariables = ["AZURE_AI_MODEL_DEPLOYMENT_NAME"],
|
||||
ExpectedOutputDescription =
|
||||
[
|
||||
"The output should demonstrate server-side conversation sessions with non-streaming and streaming turns.",
|
||||
"The output should contain multiple joke responses showing a multi-turn conversation.",
|
||||
"The output should not contain error messages or stack traces.",
|
||||
],
|
||||
},
|
||||
|
||||
+1
-1
@@ -168,7 +168,7 @@ public sealed class FileSystemJsonCheckpointStore : JsonCheckpointStore, IDispos
|
||||
string filePath = Path.Combine(this.Directory.FullName, fileName);
|
||||
|
||||
if (!this.CheckpointIndex.Contains(key) ||
|
||||
!File.Exists(fileName))
|
||||
!File.Exists(filePath))
|
||||
{
|
||||
throw new KeyNotFoundException($"Checkpoint '{key.CheckpointId}' not found in store at '{this.Directory.FullName}'.");
|
||||
}
|
||||
|
||||
+19
@@ -178,4 +178,23 @@ public sealed class FileSystemJsonCheckpointStoreTests
|
||||
Func<Task> createCheckpointAction = async () => await store.CreateCheckpointAsync(runId, TestData);
|
||||
await createCheckpointAction.Should().NotThrowAsync();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task RetrieveCheckpointAsync_ShouldReturnPersistedDataAsync()
|
||||
{
|
||||
// Arrange
|
||||
using TempDirectory tempDirectory = new();
|
||||
using FileSystemJsonCheckpointStore store = new(tempDirectory);
|
||||
|
||||
string sessionId = Guid.NewGuid().ToString("N");
|
||||
JsonElement originalData = JsonSerializer.SerializeToElement(new { name = "test", value = 42 });
|
||||
|
||||
// Act
|
||||
CheckpointInfo checkpoint = await store.CreateCheckpointAsync(sessionId, originalData);
|
||||
JsonElement retrieved = await store.RetrieveCheckpointAsync(sessionId, checkpoint);
|
||||
|
||||
// Assert
|
||||
retrieved.GetProperty("name").GetString().Should().Be("test");
|
||||
retrieved.GetProperty("value").GetInt32().Should().Be(42);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user