@promptbook/node 0.92.0-6 → 0.92.0-8

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
@@ -30,7 +30,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
30
30
  * @generated
31
31
  * @see https://github.com/webgptorg/promptbook
32
32
  */
33
- const PROMPTBOOK_ENGINE_VERSION = '0.92.0-6';
33
+ const PROMPTBOOK_ENGINE_VERSION = '0.92.0-8';
34
34
  /**
35
35
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
36
36
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -4831,18 +4831,26 @@ async function preparePersona(personaDescription, tools, options) {
4831
4831
  }).asPromise();
4832
4832
  const { outputParameters } = result;
4833
4833
  const { modelsRequirements: modelsRequirementsJson } = outputParameters;
4834
- const modelsRequirementsUnchecked = jsonParse(modelsRequirementsJson);
4834
+ let modelsRequirementsUnchecked = jsonParse(modelsRequirementsJson);
4835
4835
  if (isVerbose) {
4836
4836
  console.info(`PERSONA ${personaDescription}`, modelsRequirementsUnchecked);
4837
4837
  }
4838
4838
  if (!Array.isArray(modelsRequirementsUnchecked)) {
4839
- throw new UnexpectedError(spaceTrim((block) => `
4839
+ // <- TODO: Book should have syntax and system to enforce shape of JSON
4840
+ modelsRequirementsUnchecked = [modelsRequirementsUnchecked];
4841
+ /*
4842
+ throw new UnexpectedError(
4843
+ spaceTrim(
4844
+ (block) => `
4840
4845
  Invalid \`modelsRequirements\`:
4841
4846
 
4842
4847
  \`\`\`json
4843
4848
  ${block(JSON.stringify(modelsRequirementsUnchecked, null, 4))}
4844
4849
  \`\`\`
4845
- `));
4850
+ `,
4851
+ ),
4852
+ );
4853
+ */
4846
4854
  }
4847
4855
  const modelsRequirements = modelsRequirementsUnchecked.map((modelRequirements) => ({
4848
4856
  modelVariant: 'CHAT',