@ai.ntellect/core 0.1.98 → 0.1.100

Sign up to get free protection for your applications and to get access to all the features.
package/dist/types.d.ts CHANGED
@@ -55,7 +55,7 @@ export interface ActionSchema {
55
55
  examples?: {
56
56
  role: string;
57
57
  content: string;
58
- parameters: Record<string, any>;
58
+ parameters?: Record<string, any>;
59
59
  }[];
60
60
  confirmation?: {
61
61
  requireConfirmation: boolean;
@@ -8,7 +8,9 @@ const injectActions = (actions) => {
8
8
  const actionString = `Name: ${action.name}, Description: ${action.description}, Arguments (STRICTLY REQUIRED): { ${schemaShape} } ${action.examples
9
9
  ? `Examples: ${action.examples
10
10
  .map((e) => {
11
- return `Role: ${e.role}, Content: ${e.content}, Parameters: { ${Object.keys(e.parameters).join(", ")} }`;
11
+ return `Role: ${e.role}, Content: ${e.content}, Parameters: ${e.parameters
12
+ ? `{ ${Object.keys(e.parameters).join(", ")} }`
13
+ : ""}`;
12
14
  })
13
15
  .join("\n")}`
14
16
  : ""}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai.ntellect/core",
3
- "version": "0.1.98",
3
+ "version": "0.1.100",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/types.ts CHANGED
@@ -66,7 +66,7 @@ export interface ActionSchema {
66
66
  examples?: {
67
67
  role: string;
68
68
  content: string;
69
- parameters: Record<string, any>;
69
+ parameters?: Record<string, any>;
70
70
  }[];
71
71
  confirmation?: {
72
72
  requireConfirmation: boolean;
@@ -11,9 +11,11 @@ export const injectActions = (actions: ActionSchema[]) => {
11
11
  action.examples
12
12
  ? `Examples: ${action.examples
13
13
  .map((e: any) => {
14
- return `Role: ${e.role}, Content: ${
15
- e.content
16
- }, Parameters: { ${Object.keys(e.parameters).join(", ")} }`;
14
+ return `Role: ${e.role}, Content: ${e.content}, Parameters: ${
15
+ e.parameters
16
+ ? `{ ${Object.keys(e.parameters).join(", ")} }`
17
+ : ""
18
+ }`;
17
19
  })
18
20
  .join("\n")}`
19
21
  : ""