Skip to content

Commit 78b3018

Browse files
committed
add to chat history only if the response is not null
1 parent 7f5297a commit 78b3018

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Runtime/LLMClient.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ public async Task<string> Chat(string question, Callback<string> callback = null
317317
result = await PostRequest<ChatResult, string>(json, "completion", ChatContent, callback);
318318
}
319319

320-
if (addToHistory)
320+
if (addToHistory && result != null)
321321
{
322322
lock (chatAddLock) {
323323
AddPlayerMessage(question);

0 commit comments

Comments
 (0)