@promptbook/wizard 0.104.0-5 โ†’ 0.104.0-7

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
@@ -36,7 +36,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
36
36
  * @generated
37
37
  * @see https://github.com/webgptorg/promptbook
38
38
  */
39
- const PROMPTBOOK_ENGINE_VERSION = '0.104.0-5';
39
+ const PROMPTBOOK_ENGINE_VERSION = '0.104.0-7';
40
40
  /**
41
41
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
42
42
  * Note: [๐Ÿ’ž] Ignore a discrepancy between file name and entity name
@@ -46,6 +46,8 @@ const PROMPTBOOK_ENGINE_VERSION = '0.104.0-5';
46
46
  * Core Promptbook server configuration.
47
47
  *
48
48
  * This server is also used for auto-federation in the Agents Server.
49
+ *
50
+ * @public exported from `@promptbook/core`
49
51
  */
50
52
  const CORE_SERVER = {
51
53
  title: 'Promptbook Core',
@@ -6242,13 +6244,14 @@ class OpenAiCompatibleExecutionTools {
6242
6244
  const modelName = currentModelRequirements.modelName || this.getDefaultImageGenerationModel().modelName;
6243
6245
  const modelSettings = {
6244
6246
  model: modelName,
6245
- // size: currentModelRequirements.size,
6246
- // quality: currentModelRequirements.quality,
6247
- // style: currentModelRequirements.style,
6247
+ size: currentModelRequirements.size,
6248
+ quality: currentModelRequirements.quality,
6249
+ style: currentModelRequirements.style,
6248
6250
  };
6249
6251
  const rawPromptContent = templateParameters(content, { ...parameters, modelName });
6250
6252
  const rawRequest = {
6251
6253
  ...modelSettings,
6254
+ size: modelSettings.size || '1024x1024',
6252
6255
  prompt: rawPromptContent,
6253
6256
  user: (_a = this.options.userId) === null || _a === void 0 ? void 0 : _a.toString(),
6254
6257
  response_format: 'url', // TODO: [๐Ÿง ] Maybe allow b64_json
@@ -17531,44 +17534,6 @@ function normalizeTo_camelCase(text, _isFirstLetterCapital = false) {
17531
17534
  * TODO: [๐ŸŒบ] Use some intermediate util splitWords
17532
17535
  */
17533
17536
 
17534
- /**
17535
- * Generates a gravatar URL based on agent name for fallback avatar
17536
- *
17537
- * @param agentName The agent name to generate avatar for
17538
- * @returns Gravatar URL
17539
- *
17540
- * @private - [๐Ÿคน] The fact that profile image is Gravatar is just implementation detail which should be hidden for consumer
17541
- */
17542
- function generateGravatarUrl(agentName) {
17543
- // Use a default name if none provided
17544
- const safeName = agentName || 'Anonymous Agent';
17545
- // Create a simple hash from the name for consistent avatar
17546
- let hash = 0;
17547
- for (let i = 0; i < safeName.length; i++) {
17548
- const char = safeName.charCodeAt(i);
17549
- hash = (hash << 5) - hash + char;
17550
- hash = hash & hash; // Convert to 32bit integer
17551
- }
17552
- const avatarId = Math.abs(hash).toString();
17553
- return `https://www.gravatar.com/avatar/${avatarId}?default=robohash&size=200&rating=x`;
17554
- }
17555
-
17556
- /**
17557
- * Generates an image for the agent to use as profile image
17558
- *
17559
- * @param agentName The agent name to generate avatar for
17560
- * @returns The placeholder profile image URL for the agent
17561
- *
17562
- * @public exported from `@promptbook/core`
17563
- */
17564
- function generatePlaceholderAgentProfileImageUrl(agentName) {
17565
- // Note: [๐Ÿคน] The fact that profile image is Gravatar is just implementation detail which should be hidden for consumer
17566
- return generateGravatarUrl(agentName);
17567
- }
17568
- /**
17569
- * TODO: [๐Ÿคน] Figure out best placeholder image generator https://i.pravatar.cc/1000?u=568
17570
- */
17571
-
17572
17537
  /**
17573
17538
  * Computes SHA-256 hash of the given object
17574
17539
  *
@@ -17993,10 +17958,6 @@ function parseAgentSource(agentSource) {
17993
17958
  const metaType = normalizeTo_camelCase(metaTypeRaw);
17994
17959
  meta[metaType] = spaceTrim$2(commitment.content.substring(metaTypeRaw.length));
17995
17960
  }
17996
- // Generate gravatar fallback if no meta image specified
17997
- if (!meta.image) {
17998
- meta.image = generatePlaceholderAgentProfileImageUrl(parseResult.agentName || '!!');
17999
- }
18000
17961
  // Generate fullname fallback if no meta fullname specified
18001
17962
  if (!meta.fullname) {
18002
17963
  meta.fullname = parseResult.agentName || createDefaultAgentName(agentSource);
@@ -21356,11 +21317,7 @@ const modelCommandParser = {
21356
21317
  // TODO: [๐Ÿšœ] DRY
21357
21318
  if ($taskJson.modelRequirements[command.key] !== undefined) {
21358
21319
  if ($taskJson.modelRequirements[command.key] === command.value) {
21359
- console.warn(`Multiple commands \`MODEL ${{
21360
- modelName: 'NAME',
21361
- modelVariant: 'VARIANT',
21362
- maxTokens: '???',
21363
- }[command.key]} ${command.value}\` in the task "${$taskJson.title || $taskJson.name}"`);
21320
+ console.warn(`Multiple commands \`MODEL ${command.key} ${command.value}\` in the task "${$taskJson.title || $taskJson.name}"`);
21364
21321
  // <- TODO: [๐Ÿฎ] Some standard way how to transform errors into warnings and how to handle non-critical fails during the tasks
21365
21322
  }
21366
21323
  else {