Add empty tool calls to streaming processors

3335dbf1a75dd0ffeaede2239c64fb5b85425f31

Cohee <18619528+Cohee1207@users.noreply.github.com>

3 files changed, +4 -3Ignore whitespace
public/scripts/kai-settings.js+1 -1
@@ -188,7 +188,7 @@ export async function generateKoboldWithStreaming(generate_data, signal) {
188188 if (data?.token) {
189189 text += data.token;
190190 }
191191 yield { text, swipes: [], toolCalls: [] };
192192 }
193193 };
194194}
public/scripts/nai-settings.js+1 -1
@@ -746,7 +746,7 @@ export async function generateNovelWithStreaming(generate_data, signal) {
746746 text += data.token;
747747 }
748748
749749 yield { text, swipes: [], logprobs: parseNovelAILogprobs(data.logprobs), toolCalls: [] };
750750 }
751751 };
752752}
public/scripts/textgen-settings.js+2 -1
@@ -916,6 +916,7 @@ async function generateTextGenWithStreaming(generate_data, signal) {
916916 /** @type {import('./logprobs.js').TokenLogprobs | null} */
917917 let logprobs = null;
918918 const swipes = [];
919+ const toolCalls = [];
919920 while (true) {
920921 const { done, value } = await reader.read();
921922 if (done) return;
@@ -934,7 +935,7 @@ async function generateTextGenWithStreaming(generate_data, signal) {
934935 logprobs = parseTextgenLogprobs(newText, data.choices?.[0]?.logprobs || data?.completion_probabilities);
935936 }
936937
937938 yield { text, swipes, logprobs, toolCalls };
938939 }
939940 };
940941}