Giter Site home page Giter Site logo

Comments (4)

StephenHodgson avatar StephenHodgson commented on June 12, 2024

Please provide full stack trace and example file

from com.openai.unity.

Chinayuesir avatar Chinayuesir commented on June 12, 2024

2023 中文测试中文测试文测试.docx
I provide a minmum example.

Here is the full stack:

ArgumentException: The output byte buffer is too small to contain the encoded data, encoding 'Unicode (UTF-8)' fallback 'System.Text.EncoderReplacementFallback'.
Parameter name: bytes
System.Text.Encoding.ThrowBytesOverflow () (at <17d9ce77f27a4bd2afb5ba32c9bea976>:0)
System.Text.Encoding.ThrowBytesOverflow (System.Text.EncoderNLS encoder, System.Boolean nothingEncoded) (at <17d9ce77f27a4bd2afb5ba32c9bea976>:0)
System.Text.UTF8Encoding.GetBytes (System.Char* chars, System.Int32 charCount, System.Byte* bytes, System.Int32 byteCount, System.Text.EncoderNLS baseEncoder) (at <17d9ce77f27a4bd2afb5ba32c9bea976>:0)
System.Text.UTF8Encoding.GetBytes (System.Char* chars, System.Int32 charCount, System.Byte* bytes, System.Int32 byteCount) (at <17d9ce77f27a4bd2afb5ba32c9bea976>:0)
UnityEngine.WWWTranscoder.SevenBitClean (System.String s, System.Text.Encoding e) (at <b3175cf5e68b4630a894aa95aa711ad1>:0)
UnityEngine.WWWForm.get_data () (at <b3175cf5e68b4630a894aa95aa711ad1>:0)
UnityEngine.Networking.UnityWebRequest.SetupPost (UnityEngine.Networking.UnityWebRequest request, UnityEngine.WWWForm formData) (at <b3175cf5e68b4630a894aa95aa711ad1>:0)
UnityEngine.Networking.UnityWebRequest.Post (System.String uri, UnityEngine.WWWForm formData) (at <b3175cf5e68b4630a894aa95aa711ad1>:0)
Utilities.WebRequestRest.Rest.PostAsync (System.String query, UnityEngine.WWWForm formData, Utilities.WebRequestRest.RestParameters parameters, System.Threading.CancellationToken cancellationToken) (at ./Library/PackageCache/[email protected]/Runtime/Rest.cs:157)
OpenAI.Files.FilesEndpoint.UploadFileAsync (OpenAI.Files.FileUploadRequest request, System.IProgress`1[T] uploadProgress, System.Threading.CancellationToken cancellationToken) (at ./Library/PackageCache/[email protected]/Runtime/Files/FilesEndpoint.cs:87)
OpenAI.Files.FilesEndpoint.UploadFileAsync (System.String filePath, System.String purpose, System.IProgress`1[T] uploadProgress, System.Threading.CancellationToken cancellationToken) (at ./Library/PackageCache/[email protected]/Runtime/Files/FilesEndpoint.cs:68)
TeamFlow.Utilities.OpenAIUtility.UploadFileAsync (System.String filePath, System.Action`1[T] callback) (at Assets/Scripts/TeamFlow/Utilities/OpenAIUtility.cs:178)
Cysharp.Threading.Tasks.UniTaskCompletionSourceCore`1[TResult].GetResult (System.Int16 token) (at Assets/Plugins/UniTask/Runtime/UniTaskCompletionSource.cs:244)
Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask`2[TStateMachine,T].GetResult (System.Int16 token) (at Assets/Plugins/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:342)
Cysharp.Threading.Tasks.UniTask`1+Awaiter[T].GetResult () (at Assets/Plugins/UniTask/Runtime/UniTask.cs:653)
TeamFlow.TeamFlowFile.UploadFile () (at Assets/Scripts/TeamFlow/Nodes/Architecture/TeamFlowFile.cs:42)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) (at <17d9ce77f27a4bd2afb5ba32c9bea976>:0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at <f7237cf7abef49bfbb552d7eb076e422>:0)
UnityEngine.UnitySynchronizationContext.Exec () (at <f7237cf7abef49bfbb552d7eb076e422>:0)
UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at <f7237cf7abef49bfbb552d7eb076e422>:0)

By the way,I find if I shorten the filename,this issue cannot happen.

from com.openai.unity.

Chinayuesir avatar Chinayuesir commented on June 12, 2024

If the file whose name includes Chinese and is uploaded successfully,it will cause garbled text.
Now i am trying to find the solution.

from com.openai.unity.

StephenHodgson avatar StephenHodgson commented on June 12, 2024

Yeah this seems to be an issue with the web request uploader itself.

I wonder if it helps to change the encoding of the file.

from com.openai.unity.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.