Skip to content

Commit

Permalink
OpenAI-DotNet 7.6.1 (#215)
Browse files Browse the repository at this point in the history
- Include Output in Threads.FunctionCall

---------

Co-authored-by: Pizzajongen <[email protected]>
  • Loading branch information
StephenHodgson and Pizzajongen authored Jan 6, 2024
1 parent 5e9cf42 commit 2606b7f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
17 changes: 17 additions & 0 deletions OpenAI-DotNet-Tests/TestFixture_12_Threads.cs
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,23 @@ public async Task Test_07_01_SubmitToolOutput()
// waiting while run in Queued and InProgress
run = await run.WaitForStatusChangeAsync();
Assert.AreEqual(RunStatus.Completed, run.Status);
runStepList = await run.ListRunStepsAsync();

foreach (var runStep in runStepList.Items)
{
Assert.IsNotNull(runStep);
Assert.IsNotNull(runStep.Client);
var retrievedRunStep = await runStep.UpdateAsync();
Assert.IsNotNull(retrievedRunStep);
Console.WriteLine($"[{runStep.Id}] {runStep.Status} {runStep.CreatedAt} -> {(runStep.ExpiresAtUnixTimeSeconds.HasValue ? runStep.ExpiresAt : runStep.CompletedAt)}");
if (runStep.StepDetails.ToolCalls == null) { continue; }

foreach (var runStepToolCall in runStep.StepDetails.ToolCalls)
{
Console.WriteLine($"[{runStep.Id}][{runStepToolCall.Type}][{runStepToolCall.Id}] {runStepToolCall.FunctionCall.Name}: {runStepToolCall.FunctionCall.Output}");
}
}

var messages = await run.ListMessagesAsync();
Assert.IsNotNull(messages);
Assert.IsNotEmpty(messages.Items);
Expand Down
4 changes: 3 additions & 1 deletion OpenAI-DotNet/OpenAI-DotNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ More context [on Roger Pincombe's blog](https://rogerpincombe.com/openai-dotnet-
<AssemblyOriginatorKeyFile>OpenAI-DotNet.pfx</AssemblyOriginatorKeyFile>
<IncludeSymbols>True</IncludeSymbols>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<Version>7.6.0</Version>
<Version>7.6.1</Version>
<PackageReleaseNotes>
Version 7.6.1
- Include Output in Threads.FunctionCall
Version 7.6.0
- Changed License to MIT
- Added OpenAI.Chat logprob parameters
Expand Down
9 changes: 8 additions & 1 deletion OpenAI-DotNet/Threads/FunctionCall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,12 @@ public sealed class FunctionCall
[JsonInclude]
[JsonPropertyName("arguments")]
public string Arguments { get; private set; }

/// <summary>
/// The output of the function. This will be null if the outputs have not been submitted yet.
/// </summary>
[JsonInclude]
[JsonPropertyName("output")]
public string Output { get; private set; }
}
}
}

0 comments on commit 2606b7f

Please sign in to comment.