@promptbook/wizard 0.111.0-1 → 0.111.0-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/esm/index.es.js CHANGED
@@ -38,7 +38,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
38
38
  * @generated
39
39
  * @see https://github.com/webgptorg/promptbook
40
40
  */
41
- const PROMPTBOOK_ENGINE_VERSION = '0.111.0-1';
41
+ const PROMPTBOOK_ENGINE_VERSION = '0.111.0-2';
42
42
  /**
43
43
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
44
44
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -31922,7 +31922,6 @@ class RemoteAgent extends Agent {
31922
31922
  doneReading = !!done;
31923
31923
  if (value) {
31924
31924
  const textChunk = decoder.decode(value, { stream: true });
31925
- let sawToolCalls = false;
31926
31925
  let hasNonEmptyText = false;
31927
31926
  const textLines = [];
31928
31927
  const lines = textChunk.split(/\r?\n/);
@@ -31948,7 +31947,6 @@ class RemoteAgent extends Agent {
31948
31947
  rawResponse: {},
31949
31948
  toolCalls: getActiveToolCalls(),
31950
31949
  });
31951
- sawToolCalls = true;
31952
31950
  isToolCallLine = true;
31953
31951
  }
31954
31952
  }
@@ -31958,22 +31956,16 @@ class RemoteAgent extends Agent {
31958
31956
  }
31959
31957
  if (!isToolCallLine) {
31960
31958
  textLines.push(line);
31961
- if (line.length > 0) {
31959
+ if (trimmedLine.length > 0) {
31962
31960
  hasNonEmptyText = true;
31963
31961
  }
31964
31962
  }
31965
31963
  }
31966
- if (sawToolCalls) {
31967
- if (!hasNonEmptyText) {
31968
- continue;
31969
- }
31970
- const textChunkWithoutToolCalls = textLines.join('\n');
31971
- content += textChunkWithoutToolCalls;
31972
- }
31973
- else {
31974
- // console.debug('RemoteAgent chunk:', textChunk);
31975
- content += textChunk;
31964
+ if (!hasNonEmptyText) {
31965
+ continue;
31976
31966
  }
31967
+ const textChunkWithoutToolCalls = textLines.join('\n');
31968
+ content += textChunkWithoutToolCalls;
31977
31969
  if (!hasReceivedModelOutput && content.trim().length > 0) {
31978
31970
  hasReceivedModelOutput = true;
31979
31971
  preparationToolCalls.length = 0;