praisonai 1.0.9 → 1.0.10

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.
@@ -15,7 +15,7 @@ export declare class PraisonAIAgents {
15
15
  private simpleImpl;
16
16
  private taskImpl;
17
17
  constructor(config: any);
18
- start(): Promise<any[]>;
18
+ start(): Promise<string[]>;
19
19
  chat(): Promise<string[]>;
20
20
  }
21
21
  export { Task } from './types';
@@ -67,22 +67,23 @@ class PraisonAIAgents {
67
67
  this.taskImpl = null;
68
68
  // Auto-detect mode based on tasks type
69
69
  if (Array.isArray(config.tasks) && config.tasks.length > 0) {
70
- const firstTask = config.tasks[0];
71
- if (firstTask instanceof types_2.Task) {
72
- this.taskImpl = new types_1.PraisonAIAgents({
70
+ // If tasks are strings, use simple mode
71
+ if (typeof config.tasks[0] === 'string') {
72
+ this.simpleImpl = new simple_1.PraisonAIAgents({
73
73
  agents: config.agents,
74
74
  tasks: config.tasks,
75
75
  verbose: config.verbose,
76
- process: config.process,
77
- manager_llm: config.manager_llm
76
+ process: config.process
78
77
  });
79
78
  }
80
79
  else {
81
- this.simpleImpl = new simple_1.PraisonAIAgents({
80
+ // Otherwise, use task mode
81
+ this.taskImpl = new types_1.PraisonAIAgents({
82
82
  agents: config.agents,
83
83
  tasks: config.tasks,
84
84
  verbose: config.verbose,
85
- process: config.process
85
+ process: config.process,
86
+ manager_llm: config.manager_llm
86
87
  });
87
88
  }
88
89
  }
@@ -91,12 +92,12 @@ class PraisonAIAgents {
91
92
  }
92
93
  }
93
94
  async start() {
94
- if (this.taskImpl) {
95
- return this.taskImpl.start();
96
- }
97
- else if (this.simpleImpl) {
95
+ if (this.simpleImpl) {
98
96
  return this.simpleImpl.start();
99
97
  }
98
+ else if (this.taskImpl) {
99
+ return this.taskImpl.start();
100
+ }
100
101
  throw new Error('No implementation available');
101
102
  }
102
103
  async chat() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "praisonai",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
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",