@saltcorn/agents 0.2.2 → 0.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saltcorn/agents",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "AI agents for Saltcorn",
5
5
  "main": "index.js",
6
6
  "dependencies": {
@@ -14,7 +14,7 @@ class RetrievalByEmbedding {
14
14
  }
15
15
 
16
16
  get toolName() {
17
- return `search_${this.table_name.replaceAll(" ", "")}`;
17
+ return `search_${this.vec_field.split(".")[0].replaceAll(" ", "")}`;
18
18
  }
19
19
 
20
20
  systemPrompt() {
@@ -118,7 +118,7 @@ class RetrievalByEmbedding {
118
118
 
119
119
  provideTools() {
120
120
  if (this.mode !== "Tool") return [];
121
- const table0 = Table.findOne(this.vec_field.split["."][0]);
121
+ const table0 = Table.findOne(this.vec_field.split(".")[0]);
122
122
  const table_docs = this.doc_relation
123
123
  ? Table.findOne(table0.getField(this.doc_relation).reftable_name)
124
124
  : table0;
@@ -190,7 +190,7 @@ class RetrievalByEmbedding {
190
190
  },
191
191
  function: {
192
192
  name: this.toolName,
193
- description: `Search the ${table_docs.name``} archive${
193
+ description: `Search the ${table_docs.name} archive${
194
194
  table_docs.description ? ` (${table_docs.description})` : ""
195
195
  } for information related to a search phrase or a question. The relevant documents will be returned`,
196
196
  parameters: {