From 98b776459eb58f4aa65995a436491c20d0a3b4b7 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 6 Dec 2023 20:59:45 -0500 Subject: [PATCH] add missing extension from docs --- OpenAI-DotNet/Threads/ThreadExtensions.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/OpenAI-DotNet/Threads/ThreadExtensions.cs b/OpenAI-DotNet/Threads/ThreadExtensions.cs index 8d84470f..025197d9 100644 --- a/OpenAI-DotNet/Threads/ThreadExtensions.cs +++ b/OpenAI-DotNet/Threads/ThreadExtensions.cs @@ -224,6 +224,16 @@ public static async Task> ListRunsAsync(this ThreadRes public static async Task UpdateAsync(this RunResponse run, CancellationToken cancellationToken = default) => await run.Client.ThreadsEndpoint.RetrieveRunAsync(run.ThreadId, run.Id, cancellationToken).ConfigureAwait(false); + /// + /// Retrieves a run. + /// + /// The thread that was run. + /// The id of the run to retrieve. + /// Optional, . + /// . + public static async Task RetrieveRunAsync(this ThreadResponse thread, string runId, CancellationToken cancellationToken = default) + => await thread.Client.ThreadsEndpoint.RetrieveRunAsync(thread.Id, runId, cancellationToken); + /// /// Modifies a run. ///