mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Make relevant object disposable and improve exception handling.
This commit is contained in:
+2
-2
@@ -94,11 +94,11 @@ internal sealed class InvokeAzureAgentExecutor(InvokeAzureAgent model, ResponseA
|
||||
{
|
||||
try
|
||||
{
|
||||
JsonDocument jsonDocument = JsonDocument.Parse(lastMessageText);
|
||||
using JsonDocument jsonDocument = JsonDocument.Parse(lastMessageText);
|
||||
Dictionary<string, object?> objectProperties = jsonDocument.ParseRecord(VariableType.RecordType);
|
||||
await this.AssignAsync(this.AgentOutput?.ResponseObject?.Path, objectProperties.ToFormula(), context).ConfigureAwait(false);
|
||||
}
|
||||
catch
|
||||
catch (JsonException)
|
||||
{
|
||||
// Not valid json, skip assignment.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user