@promptbook/core 0.111.0-1 → 0.111.0-3

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
@@ -28,7 +28,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
28
28
  * @generated
29
29
  * @see https://github.com/webgptorg/promptbook
30
30
  */
31
- const PROMPTBOOK_ENGINE_VERSION = '0.111.0-1';
31
+ const PROMPTBOOK_ENGINE_VERSION = '0.111.0-3';
32
32
  /**
33
33
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
34
34
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -26897,7 +26897,6 @@ class RemoteAgent extends Agent {
26897
26897
  doneReading = !!done;
26898
26898
  if (value) {
26899
26899
  const textChunk = decoder.decode(value, { stream: true });
26900
- let sawToolCalls = false;
26901
26900
  let hasNonEmptyText = false;
26902
26901
  const textLines = [];
26903
26902
  const lines = textChunk.split(/\r?\n/);
@@ -26923,7 +26922,6 @@ class RemoteAgent extends Agent {
26923
26922
  rawResponse: {},
26924
26923
  toolCalls: getActiveToolCalls(),
26925
26924
  });
26926
- sawToolCalls = true;
26927
26925
  isToolCallLine = true;
26928
26926
  }
26929
26927
  }
@@ -26933,22 +26931,16 @@ class RemoteAgent extends Agent {
26933
26931
  }
26934
26932
  if (!isToolCallLine) {
26935
26933
  textLines.push(line);
26936
- if (line.length > 0) {
26934
+ if (trimmedLine.length > 0) {
26937
26935
  hasNonEmptyText = true;
26938
26936
  }
26939
26937
  }
26940
26938
  }
26941
- if (sawToolCalls) {
26942
- if (!hasNonEmptyText) {
26943
- continue;
26944
- }
26945
- const textChunkWithoutToolCalls = textLines.join('\n');
26946
- content += textChunkWithoutToolCalls;
26947
- }
26948
- else {
26949
- // console.debug('RemoteAgent chunk:', textChunk);
26950
- content += textChunk;
26939
+ if (!hasNonEmptyText) {
26940
+ continue;
26951
26941
  }
26942
+ const textChunkWithoutToolCalls = textLines.join('\n');
26943
+ content += textChunkWithoutToolCalls;
26952
26944
  if (!hasReceivedModelOutput && content.trim().length > 0) {
26953
26945
  hasReceivedModelOutput = true;
26954
26946
  preparationToolCalls.length = 0;