praisonai 1.0.8 → 1.0.9

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.
@@ -9,11 +9,13 @@ export declare class Agent {
9
9
  private taskAgent;
10
10
  constructor(config: ProxyAgentConfig);
11
11
  execute(input: Task | string): Promise<any>;
12
+ chat(prompt: string, previousResult?: string): Promise<string>;
12
13
  }
13
14
  export declare class PraisonAIAgents {
14
15
  private simpleImpl;
15
16
  private taskImpl;
16
17
  constructor(config: any);
17
18
  start(): Promise<any[]>;
19
+ chat(): Promise<string[]>;
18
20
  }
19
21
  export { Task } from './types';
@@ -43,6 +43,22 @@ class Agent {
43
43
  }
44
44
  throw new Error('No agent implementation available');
45
45
  }
46
+ async chat(prompt, previousResult) {
47
+ if (this.simpleAgent) {
48
+ return this.simpleAgent.chat(prompt, previousResult);
49
+ }
50
+ else if (this.taskAgent) {
51
+ // For task agents, we'll use execute but wrap the prompt in a simple task
52
+ const task = new types_2.Task({
53
+ name: 'Chat Task',
54
+ description: prompt,
55
+ expected_output: 'A response to the chat prompt',
56
+ dependencies: []
57
+ });
58
+ return this.taskAgent.execute(task, [previousResult]);
59
+ }
60
+ throw new Error('No agent implementation available');
61
+ }
46
62
  }
47
63
  exports.Agent = Agent;
48
64
  class PraisonAIAgents {
@@ -83,6 +99,16 @@ class PraisonAIAgents {
83
99
  }
84
100
  throw new Error('No implementation available');
85
101
  }
102
+ async chat() {
103
+ if (this.simpleImpl) {
104
+ return this.simpleImpl.chat();
105
+ }
106
+ else if (this.taskImpl) {
107
+ // For task-based implementation, start() is equivalent to chat()
108
+ return this.taskImpl.start();
109
+ }
110
+ throw new Error('No implementation available');
111
+ }
86
112
  }
87
113
  exports.PraisonAIAgents = PraisonAIAgents;
88
114
  var types_3 = require("./types");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "praisonai",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "PraisonAI TypeScript AI Agents Framework - Node.js, npm, and Javascript AI Agents Framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -60,7 +60,7 @@
60
60
  "dotenv": "^16.4.1",
61
61
  "fast-xml-parser": "^4.3.4",
62
62
  "openai": "^4.24.7",
63
- "praisonai": "^1.0.7"
63
+ "praisonai": "^1.0.8"
64
64
  },
65
65
  "engines": {
66
66
  "node": ">=14.0.0"