Skip to content

Commit f54ebab

Browse files
OpenAI-DotNet 8.8.6 (#504)
- Fix Realtime.UpdateSessionRequests failing to update session due to extra client secret data ## OpenAI-DotNet-Proxy 8.8.6 - Fix unimplemented routePrefix in OpenAIProxyStartup.CreateWebApplication
1 parent 85bdd3c commit f54ebab

File tree

8 files changed

+17
-6
lines changed

8 files changed

+17
-6
lines changed

OpenAI-DotNet-Proxy/OpenAI-DotNet-Proxy.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222
<IncludeSymbols>true</IncludeSymbols>
2323
<SignAssembly>false</SignAssembly>
2424
<ImplicitUsings>false</ImplicitUsings>
25-
<Version>8.8.2</Version>
25+
<Version>8.8.6</Version>
2626
<PackageReleaseNotes>
27+
Version 8.8.6
28+
- Fix unimplemented routePrefix in OpenAIProxyStartup.CreateWebApplication
2729
Version 8.8.2
2830
- Updated forwarded request headers
2931
Version 8.8.0

OpenAI-DotNet-Proxy/Proxy/OpenAIProxy.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ namespace OpenAI.Proxy
1717
/// </summary>
1818
public class OpenAIProxy
1919
{
20+
private string routePrefix = "";
2021
private OpenAIClient openAIClient;
2122
private IAuthenticationFilter authenticationFilter;
2223

@@ -46,7 +47,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
4647
app.UseEndpoints(endpoints =>
4748
{
4849
endpoints.MapGet("/health", HealthEndpoint);
49-
endpoints.MapOpenAIEndpoints(openAIClient, authenticationFilter);
50+
endpoints.MapOpenAIEndpoints(openAIClient, authenticationFilter, routePrefix);
5051
});
5152
}
5253

@@ -92,7 +93,10 @@ public static WebApplication CreateWebApplication<T>(string[] args, OpenAIClient
9293
builder.Services.AddSingleton(openAIClient);
9394
builder.Services.AddSingleton<IAuthenticationFilter, T>();
9495
var app = builder.Build();
95-
var startup = new OpenAIProxy();
96+
var startup = new OpenAIProxy
97+
{
98+
routePrefix = routePrefix
99+
};
96100
startup.Configure(app, app.Environment);
97101
return app;
98102
}

OpenAI-DotNet-Tests-Proxy/Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public partial class Program
1515
{
1616
private const string TestUserToken = "aAbBcCdDeE123456789";
1717

18+
// ReSharper disable once ClassNeverInstantiated.Local
1819
private class AuthenticationFilter : AbstractAuthenticationFilter
1920
{
2021
/// <inheritdoc />

OpenAI-DotNet-Tests/TestFixture_13_Realtime.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public async Task Test_01_01_RealtimeSession()
5959
await session.SendAsync(new ConversationItemCreateRequest("Hello!"), cts.Token);
6060
await session.SendAsync(new CreateResponseRequest(), cts.Token);
6161
await session.SendAsync(new InputAudioBufferAppendRequest(new ReadOnlyMemory<byte>(new byte[1024 * 4])), cts.Token);
62+
await session.SendAsync(new UpdateSessionRequest(new SessionConfiguration(model: Model.Transcribe_GPT_4o_Mini, instructions: "You are a fearsome dinosaur. Rawr!", tools: tools)), cts.Token);
6263
await session.SendAsync(new ConversationItemCreateRequest("Goodbye!"), cts.Token);
6364
await session.SendAsync(new CreateResponseRequest(), cts.Token);
6465

OpenAI-DotNet/OpenAI-DotNet.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ More context [on Roger Pincombe's blog](https://rogerpincombe.com/openai-dotnet-
2929
<AssemblyOriginatorKeyFile>OpenAI-DotNet.pfx</AssemblyOriginatorKeyFile>
3030
<IncludeSymbols>true</IncludeSymbols>
3131
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
32-
<Version>8.8.4</Version>
32+
<Version>8.8.6</Version>
3333
<PackageReleaseNotes>
34+
Version 8.8.6
35+
- Fix Realtime.UpdateSessionRequests failing to update session due to extra client secret data
3436
Version 8.8.4
3537
- Fix RealtimeSessionConfiguration and CreateResponseRequest model parameter overriding prompt settings
3638
- Fix Threads.MessageResponse.Status not being properly set to Completed

OpenAI-DotNet/OpenAIClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ private void Dispose(bool disposing)
118118
internal static JsonSerializerOptions JsonSerializationOptions { get; } = new()
119119
{
120120
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
121+
ReferenceHandler = ReferenceHandler.IgnoreCycles,
121122
Converters =
122123
{
123124
new JsonStringEnumConverterFactory(),
@@ -129,7 +130,6 @@ private void Dispose(bool disposing)
129130
new FilterConverter(),
130131
new ToolConverter(),
131132
},
132-
ReferenceHandler = ReferenceHandler.IgnoreCycles
133133
};
134134

135135
/// <summary>

OpenAI-DotNet/Realtime/SessionConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ internal SessionConfiguration(
180180
[JsonInclude]
181181
[JsonPropertyName("client_secret")]
182182
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
183-
public ClientSecret ClientSecret { get; private set; }
183+
public ClientSecret ClientSecret { get; internal set; }
184184

185185
/// <summary>
186186
/// The set of modalities the model can respond with.

OpenAI-DotNet/Realtime/UpdateSessionRequest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public UpdateSessionRequest() { }
1919
public UpdateSessionRequest(SessionConfiguration configuration)
2020
{
2121
Configuration = configuration;
22+
Configuration.ClientSecret = null;
2223
}
2324

2425
/// <inheritdoc />

0 commit comments

Comments
 (0)