RimWorld

RimWorld

Rimtalk
Index out of range exception when using deepseek
[RimTalk] Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Warning (string)
RimTalk.Util.Logger:Warning (string)
RimTalk.Error.TalkErrorHandler:ShowGenerationWarning (System.Exception)
RimTalk.Error.TalkErrorHandler:ShowFinalWarning (System.Exception)
RimTalk.Error.TalkErrorHandler/<HandleGenerationException>d__1:MoveNext ()
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<string>:Start<RimTalk.Error.TalkErrorHandler/<HandleGenerationException>d__1> (RimTalk.Error.TalkErrorHandler/<HandleGenerationException>d__1&)
RimTalk.Error.TalkErrorHandler:HandleGenerationException (System.Exception,System.Collections.Generic.List`1<Verse.Pawn>,string)
RimTalk.Service.TalkService/<>c__DisplayClass0_0/<<GenerateTalk>b__1>d:MoveNext ()
System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:InvokeMoveNext (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:Run ()
System.Threading.Tasks.AwaitTaskContinuation:RunOrScheduleAction (System.Action,bool,System.Threading.Tasks.Task&)
System.Threading.Tasks.Task:FinishContinuations ()
System.Threading.Tasks.Task:FinishStageThree ()
System.Threading.Tasks.Task:FinishStageTwo ()
System.Threading.Tasks.Task:Finish (bool)
System.Threading.Tasks.Task:TrySetException (object)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<string>:SetException (System.Exception)
RimTalk.Service.TalkService/<Generate>d__1:MoveNext ()
System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:InvokeMoveNext (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:Run ()
System.Threading.Tasks.AwaitTaskContinuation:RunOrScheduleAction (System.Action,bool,System.Threading.Tasks.Task&)
System.Threading.Tasks.Task:FinishContinuations ()
System.Threading.Tasks.Task:FinishStageThree ()
System.Threading.Tasks.Task`1<string>:TrySetResult (string)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<string>:SetResult (string)
RimTalk.Service.AIService/<Chat>d__7:MoveNext ()
System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:InvokeMoveNext (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:Run ()
System.Threading.Tasks.AwaitTaskContinuation:RunOrScheduleAction (System.Action,bool,System.Threading.Tasks.Task&)
System.Threading.Tasks.Task:FinishContinuations ()
System.Threading.Tasks.Task:FinishStageThree ()
System.Threading.Tasks.Task`1<string>:TrySetResult (string)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<string>:SetResult (string)
RimTalk.AI.OpenAI.OpenAICompatibleClient/<GetChatCompletionAsync>d__8:MoveNext ()
System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:InvokeMoveNext (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:Run ()
System.Threading.Tasks.AwaitTaskContinuation:RunOrScheduleAction (System.Action,bool,System.Threading.Tasks.Task&)
System.Threading.Tasks.Task:FinishContinuations ()
System.Threading.Tasks.Task:FinishStageThree ()
System.Threading.Tasks.Task`1<string>:TrySetResult (string)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<string>:SetResult (string)
RimTalk.AI.OpenAI.OpenAICompatibleClient/<GetResponseFromApiAsync>d__9:MoveNext ()
System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:InvokeMoveNext (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:Run ()
System.Threading.Tasks.AwaitTaskContinuation:RunOrScheduleAction (System.Action,bool,System.Threading.Tasks.Task&)
System.Threading.Tasks.Task:FinishContinuations ()
System.Threading.Tasks.Task:FinishStageThree ()
System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult>:TrySetResult (System.Threading.Tasks.VoidTaskResult)
System.Threading.Tasks.Task/DelayPromise:Complete ()
System.Threading.Tasks.Task/<>c:<Delay>b__247_1 (object)
System.Threading.Timer/Scheduler:TimerCB (object)
System.Threading.QueueUserWorkItemCallback:System.Threading.IThreadPoolWorkItem.ExecuteWorkItem ()
System.Threading.ThreadPoolWorkQueue:Dispatch ()
System.Threading._ThreadPoolWaitCallback:PerformWaitCallback ()

API response like:
{"id":"b1ebb357-57b4-4216-a668-f70830e30be8","object":"chat.completion","created":1757150949,"model":"deepseek-chat","choices":[{"index":0,"message":{"role":"assistant","content":"{\n \"name\": \"伊菲\",\n \"text\": \"达特,你看这个雕塑的线条如何?我觉得还缺少一点灵动感。\"\n}"},"logprobs":null,"finish_reason":"stop"}],"usage":{"prompt_tokens":976,"completion_tokens":33,"total_tokens":1009,"prompt_tokens_details":{"cached_tokens":576},"prompt_cache_hit_tokens":576,"prompt_cache_miss_tokens":400},"system_fingerprint":"fp_08f168e49b_prod0820_fp8_kvcache"}