uezo / ChatdollKit

ChatdollKit enables you to make your 3D model into a chatbot
Apache License 2.0
693 stars 74 forks source link

json error during skill usage #238

Open Canterlotdayo opened 1 year ago

Canterlotdayo commented 1 year ago

From time to time, this error occurs when using a skill (e.g. weather).

Error occured in processing request: Unexpected character encountered while parsing value: 何. Path '', line 0, position 0. at Newtonsoft.Json.JsonTextReader.ParseValue () [0x002ac] in /root/repo/Src/Newtonsoft.Json/JsonTextReader.cs:1817 at Newtonsoft.Json.JsonTextReader.Read () [0x0004c] in /root/repo/Src/Newtonsoft.Json/JsonTextReader.cs:429 at Newtonsoft.Json.JsonReader.ReadAndMoveToContent () [0x00000] in /root/repo/Src/Newtonsoft.Json/JsonReader.cs:1240 at Newtonsoft.Json.JsonReader.ReadForType (Newtonsoft.Json.Serialization.JsonContract contract, System.Boolean hasConverter) [0x0004a] in /root/repo/Src/Newtonsoft.Json/JsonReader.cs:1197 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Boolean checkAdditionalContent) [0x000db] in /root/repo/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs:202 at Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00046] in /root/repo/Src/Newtonsoft.Json/JsonSerializer.cs:904 at Newtonsoft.Json.JsonSerializer.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00000] in /root/repo/Src/Newtonsoft.Json/JsonSerializer.cs:883 at Newtonsoft.Json.JsonConvert.DeserializeObject (System.String value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) [0x0002d] in /root/repo/Src/Newtonsoft.Json/JsonConvert.cs:831 at Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value, Newtonsoft.Json.JsonSerializerSettings settings) [0x00000] in /root/repo/Src/Newtonsoft.Json/JsonConvert.cs:787 at Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value) [0x00000] in /root/repo/Src/Newtonsoft.Json/JsonConvert.cs:720 at ChatdollKit.Examples.ChatGPT.ChatGPTEmotionSkill.UpdateResponse (ChatdollKit.Dialog.Response response, System.String chatGPTResponseText) [0x00006] in C:\Users\Florian\assistant\Assets\ChatdollKit\Examples\ChatGPT\ChatGPTEmotionSkill.cs:21 at ChatdollKit.Examples.ChatGPT.ChatGPTSkill.ProcessAsync (ChatdollKit.Dialog.Request request, ChatdollKit.Dialog.Processor.State state, ChatdollKit.Dialog.Processor.User user, System.Threading.CancellationToken token) [0x00270] in C:\Users\Florian\assistant\Assets\ChatdollKit\Examples\ChatGPT\ChatGPTSkill.cs:128 at Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask2[TStateMachine,T].GetResult (System.Int16 token) [0x00000] in C:\Users\Florian\assistant\Assets\Plugins\UniTask\Runtime\CompilerServices\StateMachineRunner.cs:342 at ChatdollKit.Dialog.Processor.LocalRequestProcessor.ProcessRequestAsync (ChatdollKit.Dialog.Request request, System.Threading.CancellationToken token) [0x005e8] in C:\Users\Florian\assistant\Assets\ChatdollKit\Scripts\Dialog\Processor\LocalRequestProcessor.cs:122 UnityEngine.Debug:LogError (object) ChatdollKit.Dialog.Processor.LocalRequestProcessor/d21:MoveNext () (at Assets/ChatdollKit/Scripts/Dialog/Processor/LocalRequestProcessor.cs:165) Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask`2<ChatdollKit.Dialog.Processor.LocalRequestProcessor/d21, ChatdollKit.Dialog.Response>:Run () (at Assets/Plugins/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:313)`

uezo commented 1 year ago

Maybe the response from ChatGPT is not JSON. I recommend ChatGPTStreamSkill instead.