Skip to content

Commit 76e3e8c

Browse files
com.openai.unity 8.8.6 (#428)
- Fix Realtime.UpdateSessionRequests failing to update session due to extra client secret data
1 parent afabc94 commit 76e3e8c

File tree

5 files changed

+4
-4
lines changed

5 files changed

+4
-4
lines changed

Runtime/Realtime/SessionConfiguration.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public SessionConfiguration(
4646
maxResponseOutputTokens,
4747
expiresAfter)
4848
{
49-
5049
}
5150

5251
[Obsolete("Use new ctor overload")]
@@ -222,7 +221,7 @@ internal SessionConfiguration(
222221
/// </summary>
223222
[Preserve]
224223
[JsonProperty("client_secret", DefaultValueHandling = DefaultValueHandling.Ignore)]
225-
public ClientSecret ClientSecret { get; private set; }
224+
public ClientSecret ClientSecret { get; internal set; }
226225

227226
/// <summary>
228227
/// The set of modalities the model can respond with.

Runtime/Realtime/UpdateSessionRequest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public sealed class UpdateSessionRequest : BaseRealtimeEvent, IClientEvent
2020
public UpdateSessionRequest(SessionConfiguration configuration)
2121
{
2222
Configuration = configuration;
23+
Configuration.ClientSecret = null;
2324
}
2425

2526
/// <inheritdoc />

Samples~/Realtime/RealtimeBehaviour.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,6 @@ private void ServerResponseEvent(IServerEvent serverEvent)
363363
if (conversationItemCreated.Item.Role is Role.Assistant or Role.User)
364364
{
365365
var newContent = AddNewTextMessageContent(conversationItemCreated.Item.Role);
366-
367366
var textContent = conversationItemCreated.Item.Content.FirstOrDefault(realtimeContent
368367
=> realtimeContent.Type is RealtimeContentType.InputText or RealtimeContentType.Text);
369368

Tests/TestFixture_13_Realtime.cs

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "OpenAI",
44
"description": "A OpenAI package for the Unity to use though their RESTful API.\n\nIndependently developed, this is not an official library and I am not affiliated with OpenAI.\n\nAn OpenAI API account is required.",
55
"keywords": [],
6-
"version": "8.8.5",
6+
"version": "8.8.6",
77
"unity": "2021.3",
88
"documentationUrl": "https://github.com/RageAgainstThePixel/com.openai.unity#documentation",
99
"changelogUrl": "https://github.com/RageAgainstThePixel/com.openai.unity/releases",

0 commit comments

Comments
 (0)