You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
privatevoidUploadImage(stringimagePath,OpenAIFileClientfileClient,AssistantClientassistantClient){if(!File.Exists(imagePath)){Console.WriteLine("File not found: "+imagePath);return;}try{pictureOfUploadingFile=fileClient.UploadFile(imagePath,FileUploadPurpose.Vision);if(pictureOfUploadingFile!=null&&!string.IsNullOrEmpty(pictureOfUploadingFile.Id)){Console.WriteLine($"File uploaded successfully! File ID: {pictureOfUploadingFile.Id}");Console.WriteLine($"File Status: {pictureOfUploadingFile.Status}");Console.WriteLine($"Assistant has recieved the image");//ImageAssistant(pictureOfUploadingFile, assistantClient);}else{Console.WriteLine("File upload failed. The returned file object is null or incomplete.");}}catch(Exceptionex){Debug.LogError($"An error occurred while uploading the file: {ex.Message}");}}
OS
winOS11
.NET version
9.0.101
Library version
2.1.0
The text was updated successfully, but these errors were encountered:
Service
OpenAI
Describe the bug
I'm woring on a Unity project and trying to upload image using UploadFile, the image path is valid, but get the error: boundary
ArgumentException: boundary
System.Net.Http.MultipartContent..ctor (System.String subtype, System.String boundary) (at <6b7f3b30be4840f3b4c58acaa59bfe22>:0)
System.Net.Http.MultipartFormDataContent..ctor (System.String boundary) (at <6b7f3b30be4840f3b4c58acaa59bfe22>:0)
OpenAI.MultipartFormDataBinaryContent..ctor () (at <46f589334efd4b3886de60af8a780085>:0)
OpenAI.Files.InternalFileUploadOptions.ToMultipartContent (System.IO.Stream file, System.String filename) (at <46f589334efd4b3886de60af8a780085>:0)
OpenAI.Files.OpenAIFileClient.UploadFile (System.IO.Stream file, System.String filename, OpenAI.Files.FileUploadPurpose purpose, System.Threading.CancellationToken cancellationToken) (at <46f589334efd4b3886de60af8a780085>:0)
OpenAI.Files.OpenAIFileClient.UploadFile (System.String filePath, OpenAI.Files.FileUploadPurpose purpose) (at <46f589334efd4b3886de60af8a780085>:0)
OAVision.UploadImage (System.String imagePath, OpenAI.Files.OpenAIFileClient fileClient, OpenAI.Assistants.AssistantClient assistantClient) (at Assets/Scripts/OAVision.cs:48)
OAVision.SendImageToOpenAI (System.String imagePath) (at Assets/Scripts/OAVision.cs:35)
WebcamManager.OnStoppedPhotoMode (UnityEngine.Windows.WebCam.PhotoCapture+PhotoCaptureResult result) (at Assets/Scripts/WebcamManager.cs:44)
UnityEngine.Windows.WebCam.PhotoCapture.InvokeOnPhotoModeStoppedDelegate (UnityEngine.Windows.WebCam.PhotoCapture+OnPhotoModeStoppedCallback callback, System.Int64 hResult) (at :0)
Steps to reproduce
N/A
Code snippets
OS
winOS11
.NET version
9.0.101
Library version
2.1.0
The text was updated successfully, but these errors were encountered: