From 2e54704a82039bd3c840b3350dd2a9f4a90b9ace Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 20 Nov 2024 14:48:40 -0500 Subject: [PATCH] com.openai.unity 8.4.3 (#311) - fixed docs - fixed missing samples --- .../com.openai.unity/Documentation~/README.md | 4 ++-- .../Runtime/Realtime/ConversationItem.cs | 1 - OpenAI/Packages/com.openai.unity/package.json | 12 +++++++++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/OpenAI/Packages/com.openai.unity/Documentation~/README.md b/OpenAI/Packages/com.openai.unity/Documentation~/README.md index e374cd39..72e8262a 100644 --- a/OpenAI/Packages/com.openai.unity/Documentation~/README.md +++ b/OpenAI/Packages/com.openai.unity/Documentation~/README.md @@ -437,10 +437,10 @@ var tools = new List }; var options = new Options(Model.GPT4oRealtime, tools: tools); using var session = await api.RealtimeEndpoint.CreateSessionAsync(options); -var responseTask = await session.ReceiveUpdatesAsync(ServerEvents, cancellationTokenSource.Token); +var responseTask = session.ReceiveUpdatesAsync(ServerEvents, cancellationTokenSource.Token); await session.SendAsync(new ConversationItemCreateRequest("Hello!")); await session.SendAsync(new CreateResponseRequest()); -await session.SendAsync(new InputAudioBufferAppendRequest(new ReadOnlyMemory(new byte[1024 * 4])), cts.Token); +await session.SendAsync(new InputAudioBufferAppendRequest(new ReadOnlyMemory(new byte[1024 * 4])), cancellationTokenSource.Token); await session.SendAsync(new ConversationItemCreateRequest("GoodBye!")); await session.SendAsync(new CreateResponseRequest()); await responseTask; diff --git a/OpenAI/Packages/com.openai.unity/Runtime/Realtime/ConversationItem.cs b/OpenAI/Packages/com.openai.unity/Runtime/Realtime/ConversationItem.cs index f089c3c4..bb274fea 100644 --- a/OpenAI/Packages/com.openai.unity/Runtime/Realtime/ConversationItem.cs +++ b/OpenAI/Packages/com.openai.unity/Runtime/Realtime/ConversationItem.cs @@ -4,7 +4,6 @@ using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Linq; using UnityEngine.Scripting; diff --git a/OpenAI/Packages/com.openai.unity/package.json b/OpenAI/Packages/com.openai.unity/package.json index 14bc5cf7..01446dad 100644 --- a/OpenAI/Packages/com.openai.unity/package.json +++ b/OpenAI/Packages/com.openai.unity/package.json @@ -3,7 +3,7 @@ "displayName": "OpenAI", "description": "A OpenAI package for the Unity Game Engine to use GPT-4, GPT-3.5, GPT-3 and Dall-E though their RESTful API (currently in beta).\n\nIndependently developed, this is not an official library and I am not affiliated with OpenAI.\n\nAn OpenAI API account is required.", "keywords": [], - "version": "8.4.2", + "version": "8.4.3", "unity": "2021.3", "documentationUrl": "https://github.com/RageAgainstThePixel/com.openai.unity#documentation", "changelogUrl": "https://github.com/RageAgainstThePixel/com.openai.unity/releases", @@ -26,6 +26,16 @@ "displayName": "Chat", "description": "Contains sample chat behaviour and scene", "path": "Samples~/Chat" + }, + { + "displayName": "Assistant", + "description": "Contains sample assistant behaviour and scene", + "path": "Samples~/Assistant" + }, + { + "displayName": "Realtime", + "description": "Contains sample realtime behaviour and scene", + "path": "Samples~/Realtime" } ], "publishConfig": {