@voltagent/core 0.1.85 → 1.0.0-next.1
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 +27 -8
- package/dist/index.d.mts +3108 -4057
- package/dist/index.d.ts +3108 -4057
- package/dist/index.js +8341 -15451
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8326 -15426
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -10
package/README.md
CHANGED
|
@@ -96,17 +96,30 @@ You'll see the starter code in `src/index.ts`, which now registers both an agent
|
|
|
96
96
|
|
|
97
97
|
```typescript
|
|
98
98
|
import { VoltAgent, Agent } from "@voltagent/core";
|
|
99
|
+
import { LibSQLStorage } from "@voltagent/libsql";
|
|
100
|
+
import { createPinoLogger } from "@voltagent/logger";
|
|
99
101
|
import { VercelAIProvider } from "@voltagent/vercel-ai";
|
|
100
102
|
import { openai } from "@ai-sdk/openai";
|
|
101
|
-
import {
|
|
103
|
+
import { expenseApprovalWorkflow } from "./workflows";
|
|
104
|
+
import { weatherTool } from "./tools";
|
|
105
|
+
|
|
106
|
+
// Create a logger instance
|
|
107
|
+
const logger = createPinoLogger({
|
|
108
|
+
name: "my-agent-app",
|
|
109
|
+
level: "info",
|
|
110
|
+
});
|
|
102
111
|
|
|
103
112
|
// A simple, general-purpose agent for the project.
|
|
104
113
|
const agent = new Agent({
|
|
105
114
|
name: "my-agent",
|
|
106
|
-
instructions: "A helpful assistant that
|
|
115
|
+
instructions: "A helpful assistant that can check weather and help with various tasks",
|
|
107
116
|
llm: new VercelAIProvider(),
|
|
108
117
|
model: openai("gpt-4o-mini"),
|
|
109
|
-
tools: [],
|
|
118
|
+
tools: [weatherTool],
|
|
119
|
+
memory: new LibSQLStorage({
|
|
120
|
+
url: "file:./.voltagent/memory.db",
|
|
121
|
+
logger: logger.child({ component: "libsql" }),
|
|
122
|
+
}),
|
|
110
123
|
});
|
|
111
124
|
|
|
112
125
|
// Initialize VoltAgent with your agent(s) and workflow(s)
|
|
@@ -115,8 +128,9 @@ new VoltAgent({
|
|
|
115
128
|
agent,
|
|
116
129
|
},
|
|
117
130
|
workflows: {
|
|
118
|
-
|
|
131
|
+
expenseApprovalWorkflow,
|
|
119
132
|
},
|
|
133
|
+
logger,
|
|
120
134
|
});
|
|
121
135
|
```
|
|
122
136
|
|
|
@@ -150,16 +164,21 @@ Your agent is now running! To interact with it:
|
|
|
150
164
|
|
|
151
165
|
### Running Your First Workflow
|
|
152
166
|
|
|
153
|
-
Your new project also includes a powerful workflow engine. You can test the pre-built `
|
|
167
|
+
Your new project also includes a powerful workflow engine. You can test the pre-built `expenseApprovalWorkflow` directly from the VoltOps console:
|
|
154
168
|
|
|
155
169
|

|
|
156
170
|
|
|
157
171
|
1. **Go to the Workflows Page:** After starting your server, go directly to the [Workflows page](https://console.voltagent.dev/workflows).
|
|
158
172
|
2. **Select Your Project:** Use the project selector to choose your project (e.g., "my-agent-app").
|
|
159
|
-
3. **Find and Run:** You will see **"
|
|
160
|
-
4. **Provide Input:** The workflow expects a JSON object with
|
|
173
|
+
3. **Find and Run:** You will see **"Expense Approval Workflow"** listed. Click it, then click the **"Run"** button.
|
|
174
|
+
4. **Provide Input:** The workflow expects a JSON object with expense details. Try a small expense for automatic approval:
|
|
161
175
|
```json
|
|
162
|
-
{
|
|
176
|
+
{
|
|
177
|
+
"employeeId": "EMP-123",
|
|
178
|
+
"amount": 250,
|
|
179
|
+
"category": "office-supplies",
|
|
180
|
+
"description": "New laptop mouse and keyboard"
|
|
181
|
+
}
|
|
163
182
|
```
|
|
164
183
|
5. **View the Results:** After execution, you can inspect the detailed logs for each step and see the final output directly in the console.
|
|
165
184
|
|