@yesvara/svara 0.2.4 → 0.2.5
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.
- package/README.md +1 -1
- package/package.json +1 -1
- package/my-agent/.env.example +0 -4
- package/my-agent/docs/README.md +0 -3
- package/my-agent/package.json +0 -19
- package/my-agent/src/index.ts +0 -35
- package/my-agent/tsconfig.json +0 -19
package/README.md
CHANGED
package/package.json
CHANGED
package/my-agent/.env.example
DELETED
package/my-agent/docs/README.md
DELETED
package/my-agent/package.json
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "my-agent",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"scripts": {
|
|
6
|
-
"dev": "tsx watch src/index.ts",
|
|
7
|
-
"build": "tsc",
|
|
8
|
-
"start": "node dist/index.js"
|
|
9
|
-
},
|
|
10
|
-
"dependencies": {
|
|
11
|
-
"@yesvara/svara": "^0.1.3",
|
|
12
|
-
"dotenv": "^16.4.5"
|
|
13
|
-
},
|
|
14
|
-
"devDependencies": {
|
|
15
|
-
"@types/node": "^20.14.2",
|
|
16
|
-
"tsx": "^4.15.7",
|
|
17
|
-
"typescript": "^5.4.5"
|
|
18
|
-
}
|
|
19
|
-
}
|
package/my-agent/src/index.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import 'dotenv/config';
|
|
2
|
-
import { SvaraApp, SvaraAgent, createTool } from '@yesvara/svara';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* my-agent — powered by SvaraJS
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
// Define tools
|
|
9
|
-
const timeTool = createTool({
|
|
10
|
-
name: 'get_time',
|
|
11
|
-
description: 'Get the current date and time',
|
|
12
|
-
parameters: {},
|
|
13
|
-
async run() {
|
|
14
|
-
return {
|
|
15
|
-
datetime: new Date().toISOString(),
|
|
16
|
-
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
17
|
-
};
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
// Create agent
|
|
22
|
-
const agent = new SvaraAgent({
|
|
23
|
-
name: 'my-agent',
|
|
24
|
-
model: 'gpt-4o',
|
|
25
|
-
systemPrompt: 'You are a helpful AI assistant. Be concise and friendly.',
|
|
26
|
-
tools: [timeTool],
|
|
27
|
-
knowledge: './docs', // Add your documents here for RAG
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
// Setup channels
|
|
31
|
-
const app = new SvaraApp({ cors: true });
|
|
32
|
-
app.route('/chat', agent.handler());
|
|
33
|
-
app.listen(3000);
|
|
34
|
-
|
|
35
|
-
console.log('✨ my-agent is running!');
|
package/my-agent/tsconfig.json
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "CommonJS",
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
|
-
"outDir": "dist",
|
|
7
|
-
"rootDir": "src",
|
|
8
|
-
"strict": true,
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"skipLibCheck": true
|
|
11
|
-
},
|
|
12
|
-
"include": [
|
|
13
|
-
"src/**/*"
|
|
14
|
-
],
|
|
15
|
-
"exclude": [
|
|
16
|
-
"node_modules",
|
|
17
|
-
"dist"
|
|
18
|
-
]
|
|
19
|
-
}
|