-
-
Notifications
You must be signed in to change notification settings - Fork 505
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #352 from MervinPraison/develop
Update PraisonAI TypeScript SDK with Enhanced Logging, Examples, and …
- Loading branch information
Showing
15 changed files
with
851 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const { Agent } = require('praisonai'); | ||
|
||
const agent = new Agent({ instructions: 'You are a helpful AI assistant' }); | ||
|
||
agent.start('Write a movie script about a robot on Mars') | ||
.then(response => { | ||
console.log(response); | ||
}) | ||
.catch(error => { | ||
console.error('Error:', error); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
const { Agent } = require('praisonai'); | ||
|
||
// Create a simple science explainer agent | ||
const agent = new Agent({ | ||
instructions: "You are a science expert who explains complex phenomena in simple terms.", | ||
name: "ScienceExplainer", | ||
// Create a simple math tutor agent | ||
const agent = new Agent({ | ||
instructions: `You are a friendly math tutor. Help students solve basic math problems. | ||
Keep explanations simple and clear.`, | ||
name: "MathTutor", | ||
verbose: true | ||
}); | ||
|
||
// Ask a question | ||
agent.start("Why is the sky blue?") | ||
// Ask the agent to solve a math problem | ||
agent.start("What is 15% of 80?") | ||
.then(response => { | ||
console.log('\nExplanation:'); | ||
console.log('\nMath Solution:'); | ||
console.log(response); | ||
}) | ||
.catch(error => console.error('Error:', error)); | ||
.catch(error => { | ||
console.error('Error:', error); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.