From 06bb9281e36efabe5de96a77e5d4c4454838bb50 Mon Sep 17 00:00:00 2001 From: Anne Thompson Date: Tue, 16 Jul 2024 14:03:35 -0700 Subject: [PATCH] Make RequiredActionUpdate a RunUpdate --- src/Custom/Assistants/Streaming/RequiredActionUpdate.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Custom/Assistants/Streaming/RequiredActionUpdate.cs b/src/Custom/Assistants/Streaming/RequiredActionUpdate.cs index cd6db5a9..2c189923 100644 --- a/src/Custom/Assistants/Streaming/RequiredActionUpdate.cs +++ b/src/Custom/Assistants/Streaming/RequiredActionUpdate.cs @@ -11,7 +11,7 @@ namespace OpenAI.Assistants; /// Distinct instances will generated for each required action, meaning that /// parallel function calling will present multiple updates even if the tool calls arrive at the same time. /// -public class RequiredActionUpdate : StreamingUpdate +public class RequiredActionUpdate : RunUpdate { /// public string FunctionName => AsFunctionCall?.FunctionName; @@ -24,13 +24,11 @@ public class RequiredActionUpdate : StreamingUpdate private InternalRequiredFunctionToolCall AsFunctionCall => _requiredAction as InternalRequiredFunctionToolCall; - private readonly ThreadRun _run; private readonly RequiredAction _requiredAction; internal RequiredActionUpdate(ThreadRun run, RequiredAction action) - : base(StreamingUpdateReason.RunRequiresAction) + : base(run, StreamingUpdateReason.RunRequiresAction) { - _run = run; _requiredAction = action; } @@ -39,7 +37,7 @@ internal RequiredActionUpdate(ThreadRun run, RequiredAction action) /// update. /// /// - public ThreadRun GetThreadRun() => _run; + public ThreadRun GetThreadRun() => Value; internal static IEnumerable DeserializeRequiredActionUpdates(JsonElement element) {