@superatomai/sdk-node 0.0.54 → 0.0.55

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/dist/index.mjs CHANGED
@@ -5355,6 +5355,19 @@ var LLM = class {
5355
5355
  // src/userResponse/base-llm.ts
5356
5356
  init_logger();
5357
5357
 
5358
+ // src/utils/datetime.ts
5359
+ function getCurrentDateTimeForPrompt() {
5360
+ return (/* @__PURE__ */ new Date()).toLocaleString("en-US", {
5361
+ weekday: "long",
5362
+ year: "numeric",
5363
+ month: "long",
5364
+ day: "numeric",
5365
+ hour: "2-digit",
5366
+ minute: "2-digit",
5367
+ timeZoneName: "short"
5368
+ });
5369
+ }
5370
+
5358
5371
  // src/userResponse/knowledge-base.ts
5359
5372
  init_logger();
5360
5373
  var getKnowledgeBase = async ({
@@ -5835,7 +5848,8 @@ ${fieldsText}`;
5835
5848
  SCHEMA_DOC: schemaDoc,
5836
5849
  DATABASE_RULES: databaseRules,
5837
5850
  DEFERRED_TOOLS: deferredToolsText,
5838
- EXECUTED_TOOLS: executedToolsText
5851
+ EXECUTED_TOOLS: executedToolsText,
5852
+ CURRENT_DATETIME: getCurrentDateTimeForPrompt()
5839
5853
  });
5840
5854
  logger.debug(`[${this.getProviderName()}] Loaded match-text-components prompts`);
5841
5855
  const systemPromptStr = Array.isArray(prompts.system) ? prompts.system.join("\n") : prompts.system;
@@ -6110,7 +6124,8 @@ ${executedToolsText}`);
6110
6124
  USER_PROMPT: userPrompt,
6111
6125
  CONVERSATION_HISTORY: conversationHistory || "No previous conversation",
6112
6126
  AVAILABLE_TOOLS: availableToolsDoc,
6113
- SCHEMA_DOC: schemaDoc || "No database schema available"
6127
+ SCHEMA_DOC: schemaDoc || "No database schema available",
6128
+ CURRENT_DATETIME: getCurrentDateTimeForPrompt()
6114
6129
  });
6115
6130
  const systemPrompt = Array.isArray(prompts.system) ? prompts.system.join("\n") : prompts.system;
6116
6131
  const userPromptText = Array.isArray(prompts.user) ? prompts.user.join("\n") : prompts.user;
@@ -6177,7 +6192,8 @@ ${executedToolsText}`);
6177
6192
  COMPONENT_PROPS: JSON.stringify(component.props, null, 2),
6178
6193
  CACHED_TEXT_RESPONSE: cachedTextResponse || "No cached text response available",
6179
6194
  SCHEMA_DOC: schemaDoc || "No schema available",
6180
- DATABASE_RULES: databaseRules
6195
+ DATABASE_RULES: databaseRules,
6196
+ CURRENT_DATETIME: getCurrentDateTimeForPrompt()
6181
6197
  });
6182
6198
  const result = await LLM.stream(
6183
6199
  {
@@ -6309,7 +6325,8 @@ ${executedToolsText}`);
6309
6325
  SCHEMA_DOC: schemaDoc,
6310
6326
  DATABASE_RULES: databaseRules,
6311
6327
  KNOWLEDGE_BASE_CONTEXT: knowledgeBaseContext || "No additional knowledge base context available.",
6312
- AVAILABLE_EXTERNAL_TOOLS: availableToolsDoc
6328
+ AVAILABLE_EXTERNAL_TOOLS: availableToolsDoc,
6329
+ CURRENT_DATETIME: getCurrentDateTimeForPrompt()
6313
6330
  });
6314
6331
  const sysPrompt = Array.isArray(prompts.system) ? prompts.system.join("\n") : prompts.system;
6315
6332
  const usrPrompt = Array.isArray(prompts.user) ? prompts.user.join("\n") : prompts.user;
@@ -7080,7 +7097,8 @@ ${errorMsg}
7080
7097
  ORIGINAL_USER_PROMPT: originalUserPrompt,
7081
7098
  COMPONENT_INFO: component_info,
7082
7099
  COMPONENT_DATA: component_data,
7083
- CONVERSATION_HISTORY: conversationHistory || "No previous conversation"
7100
+ CONVERSATION_HISTORY: conversationHistory || "No previous conversation",
7101
+ CURRENT_DATETIME: getCurrentDateTimeForPrompt()
7084
7102
  });
7085
7103
  const result = await LLM.stream(
7086
7104
  {
@@ -10983,7 +11001,8 @@ async function pickComponentWithLLM(prompt, components, anthropicApiKey, groqApi
10983
11001
  AVAILABLE_COMPONENTS: availableComponentsText,
10984
11002
  SCHEMA_DOC: schemaDoc || "No database schema available",
10985
11003
  DATABASE_RULES: databaseRules,
10986
- AVAILABLE_TOOLS: availableToolsText
11004
+ AVAILABLE_TOOLS: availableToolsText,
11005
+ CURRENT_DATETIME: getCurrentDateTimeForPrompt()
10987
11006
  });
10988
11007
  logger.debug("[DASH_COMP_REQ] Loaded dash-comp-picker prompts with schema and tools");
10989
11008
  const { apiKey, model } = getApiKeyAndModel(
@@ -11132,7 +11151,8 @@ async function createFilterWithLLM(prompt, components, existingComponents, anthr
11132
11151
  EXISTING_COMPONENTS: formatExistingComponentsForPrompt(existingComponents),
11133
11152
  SCHEMA_DOC: schemaDoc || "No database schema available",
11134
11153
  DATABASE_RULES: databaseRules,
11135
- AVAILABLE_TOOLS: formatToolsForPrompt(tools)
11154
+ AVAILABLE_TOOLS: formatToolsForPrompt(tools),
11155
+ CURRENT_DATETIME: getCurrentDateTimeForPrompt()
11136
11156
  });
11137
11157
  logger.debug("[DASH_COMP_REQ:FILTER] Loaded dash-filter-picker prompts");
11138
11158
  const { apiKey, model } = getApiKeyAndModel(