@ai.ntellect/core 0.1.101 → 0.1.102
Sign up to get free protection for your applications and to get access to all the features.
@@ -6,13 +6,9 @@ const injectActions = (actions) => {
|
|
6
6
|
const parameters = action.parameters;
|
7
7
|
const schemaShape = Object.keys(parameters._def.shape()).join(", ");
|
8
8
|
const actionString = `Name: ${action.name}, Description: ${action.description}, Arguments (STRICTLY REQUIRED): { ${schemaShape} } ${action.examples
|
9
|
-
? `
|
10
|
-
.
|
11
|
-
|
12
|
-
? `{ ${Object.keys(e.parameters).join(", ")} }`
|
13
|
-
: ""}`;
|
14
|
-
})
|
15
|
-
.join("\n")}`
|
9
|
+
? `Format examples (MUST RESPECT): ${action.examples.map((example) => {
|
10
|
+
return JSON.stringify(example);
|
11
|
+
})}`
|
16
12
|
: ""}`;
|
17
13
|
return actionString;
|
18
14
|
});
|
package/package.json
CHANGED
package/utils/inject-actions.ts
CHANGED
@@ -9,15 +9,11 @@ export const injectActions = (actions: ActionSchema[]) => {
|
|
9
9
|
action.description
|
10
10
|
}, Arguments (STRICTLY REQUIRED): { ${schemaShape} } ${
|
11
11
|
action.examples
|
12
|
-
? `
|
13
|
-
|
14
|
-
return
|
15
|
-
|
16
|
-
|
17
|
-
: ""
|
18
|
-
}`;
|
19
|
-
})
|
20
|
-
.join("\n")}`
|
12
|
+
? `Format examples (MUST RESPECT): ${action.examples.map(
|
13
|
+
(example: any) => {
|
14
|
+
return JSON.stringify(example);
|
15
|
+
}
|
16
|
+
)}`
|
21
17
|
: ""
|
22
18
|
}`;
|
23
19
|
return actionString;
|