@saltcorn/agents 0.6.1 → 0.6.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/agent-view.js CHANGED
@@ -629,7 +629,9 @@ const run = async (
629
629
  if(res.run_id && (!$runidin.val() || $runidin.val()=="undefined"))
630
630
  $runidin.val(res.run_id);
631
631
  const wrapSegment = (html, who) => '<div class="interaction-segment"><span class="badge bg-secondary">'+who+'</span>'+html+'</div>'
632
- $("#copilotinteractions").append(wrapSegment('<p>'+$("textarea[name=userinput]").val()+'</p>'+fileBadge, "You"))
632
+ const user_input = $("textarea[name=userinput]").val()
633
+ if(user_input)
634
+ $("#copilotinteractions").append(wrapSegment('<p>'+user_input+'</p>'+fileBadge, "You"))
633
635
  $("textarea[name=userinput]").val("")
634
636
  $('form.agent-view div.next_response_scratch').html("")
635
637
  window['stream scratch ${viewname} ${rndid}'] = []
@@ -806,6 +808,7 @@ const interact = async (table_id, viewname, config, body, { req, res }) => {
806
808
  db.getTenantSchema(),
807
809
  {
808
810
  error: e?.message || e,
811
+ page_load_tag: req?.headers?.["page-load-tag"],
809
812
  },
810
813
  [req.user.id],
811
814
  );
package/common.js CHANGED
@@ -242,13 +242,14 @@ const process_interaction = async (
242
242
  db.getTenantSchema(),
243
243
  {
244
244
  eval_js: `processCopilotResponse({response: ${JSON.stringify(resp)}, run_id: ${run.id}})`,
245
+ page_load_tag: req?.headers?.["page-load-tag"],
245
246
  },
246
247
  [req.user.id],
247
248
  );
248
249
  else responses.push(resp);
249
250
  await addToContext(run, {
250
- html_interactions: [resp],
251
- });
251
+ html_interactions: [resp],
252
+ });
252
253
  };
253
254
  if (answer && typeof answer === "object" && answer.image_calls) {
254
255
  for (const image_call of answer.image_calls) {
@@ -359,7 +360,7 @@ const process_interaction = async (
359
360
  req,
360
361
  });
361
362
  if (rendered)
362
- add_responses(
363
+ add_response(
363
364
  wrapSegment(
364
365
  wrapCard(
365
366
  tool.skill.skill_label ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saltcorn/agents",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "AI agents for Saltcorn",
5
5
  "main": "index.js",
6
6
  "dependencies": {
@@ -10,6 +10,10 @@ const { interpolate } = require("@saltcorn/data/utils");
10
10
  class RetrievalByEmbedding {
11
11
  static skill_name = "Retrieval by embedding";
12
12
 
13
+ get skill_label() {
14
+ return `Searching...`;
15
+ }
16
+
13
17
  constructor(cfg) {
14
18
  Object.assign(this, cfg);
15
19
  }