agentnet 0.0.1 → 0.0.3
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 +317 -364
- package/_OLD_README.md +554 -0
- package/assets/network01.png +0 -0
- package/examples/customer-support/README.md +66 -0
- package/examples/customer-support/agents.yaml +457 -0
- package/examples/customer-support/index.js +408 -0
- package/examples/event-planner/README.md +69 -0
- package/examples/event-planner/agents.yaml +318 -0
- package/examples/event-planner/index.js +547 -0
- package/{src/examples → examples/simple}/simple.js +2 -2
- package/{src/examples → examples/smartness}/agents-smartness.yaml +8 -17
- package/{src/examples/def3.js → examples/smartness/index.js} +9 -9
- package/jest.config.js +1 -0
- package/package.json +6 -3
- package/src/agent/agent-loader.js +75 -12
- package/src/agent/agent.js +13 -3
- package/src/agent/runtime.js +9 -6
- package/src/llm/base.js +131 -0
- package/src/llm/gemini.js +137 -117
- package/src/llm/gpt.js +131 -104
- package/src/store/store.js +82 -48
- package/src/tests/agent.test.js +350 -0
- package/src/tools/migrate-version.js +250 -0
- package/src/transport/README.md +123 -0
- package/src/transport/base.js +237 -0
- package/src/transport/index.js +89 -0
- package/src/transport/kafka.js +474 -0
- package/src/transport/nats.js +521 -0
- package/src/transport/rabbitmq.js +722 -0
- package/src/transport/redis.js +532 -0
- package/src/utils/version.js +212 -0
- package/src/agent/runtimes/nats.js +0 -379
- package/src/examples/agents.yaml +0 -394
- package/src/examples/def.js +0 -74
- package/src/examples/def2.js +0 -65
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
---
|
|
2
|
+
apiVersion: smartagent.io/v1alpha1
|
|
3
|
+
kind: AgentDefinition
|
|
4
|
+
metadata:
|
|
5
|
+
name: plannerAgent
|
|
6
|
+
namespace: eventPlanner
|
|
7
|
+
spec:
|
|
8
|
+
io:
|
|
9
|
+
- type: NatsIO
|
|
10
|
+
bindings:
|
|
11
|
+
discoveryTopic: eventPlanner.discovery
|
|
12
|
+
acceptedNetworks:
|
|
13
|
+
- "eventPlanner.*"
|
|
14
|
+
store:
|
|
15
|
+
type: Memory
|
|
16
|
+
llm:
|
|
17
|
+
provider: Gemini
|
|
18
|
+
model: gemini-2.0-flash
|
|
19
|
+
systemInstruction: |
|
|
20
|
+
You are an intelligent event planning assistant. Your role is to:
|
|
21
|
+
1. Help users create and manage calendar events
|
|
22
|
+
2. Provide clear information about scheduled events
|
|
23
|
+
3. Update or delete events as requested
|
|
24
|
+
4. Suggest optimal scheduling based on calendar availability
|
|
25
|
+
|
|
26
|
+
Be proactive, helpful, and respectful of users' time. Ensure all events have
|
|
27
|
+
the necessary details like title, date, time, and any special requirements.
|
|
28
|
+
config:
|
|
29
|
+
temperature: 0.3
|
|
30
|
+
toolConfig:
|
|
31
|
+
functionCallingConfig:
|
|
32
|
+
mode: 'auto'
|
|
33
|
+
|
|
34
|
+
tools:
|
|
35
|
+
- name: createEvent
|
|
36
|
+
description: Create a new calendar event
|
|
37
|
+
parameters:
|
|
38
|
+
type: object
|
|
39
|
+
properties:
|
|
40
|
+
title:
|
|
41
|
+
type: string
|
|
42
|
+
description: The title or name of the event
|
|
43
|
+
startDateTime:
|
|
44
|
+
type: string
|
|
45
|
+
description: Start date and time in ISO format (YYYY-MM-DDTHH:MM:SS)
|
|
46
|
+
endDateTime:
|
|
47
|
+
type: string
|
|
48
|
+
description: End date and time in ISO format (YYYY-MM-DDTHH:MM:SS)
|
|
49
|
+
description:
|
|
50
|
+
type: string
|
|
51
|
+
description: Optional description of the event
|
|
52
|
+
location:
|
|
53
|
+
type: string
|
|
54
|
+
description: Optional location of the event
|
|
55
|
+
participants:
|
|
56
|
+
type: array
|
|
57
|
+
items:
|
|
58
|
+
type: string
|
|
59
|
+
description: Optional list of participants' emails
|
|
60
|
+
reminders:
|
|
61
|
+
type: array
|
|
62
|
+
items:
|
|
63
|
+
type: object
|
|
64
|
+
properties:
|
|
65
|
+
time:
|
|
66
|
+
type: integer
|
|
67
|
+
description: Time before event in minutes
|
|
68
|
+
type:
|
|
69
|
+
type: string
|
|
70
|
+
description: Type of reminder (email, notification)
|
|
71
|
+
description: Optional reminders for the event
|
|
72
|
+
required:
|
|
73
|
+
- title
|
|
74
|
+
- startDateTime
|
|
75
|
+
- endDateTime
|
|
76
|
+
|
|
77
|
+
- name: listEvents
|
|
78
|
+
description: List calendar events within a date range
|
|
79
|
+
parameters:
|
|
80
|
+
type: object
|
|
81
|
+
properties:
|
|
82
|
+
startDate:
|
|
83
|
+
type: string
|
|
84
|
+
description: Start date in YYYY-MM-DD format
|
|
85
|
+
endDate:
|
|
86
|
+
type: string
|
|
87
|
+
description: End date in YYYY-MM-DD format
|
|
88
|
+
maxResults:
|
|
89
|
+
type: integer
|
|
90
|
+
description: Maximum number of events to return
|
|
91
|
+
required:
|
|
92
|
+
- startDate
|
|
93
|
+
- endDate
|
|
94
|
+
|
|
95
|
+
- name: getEventDetails
|
|
96
|
+
description: Get details of a specific event
|
|
97
|
+
parameters:
|
|
98
|
+
type: object
|
|
99
|
+
properties:
|
|
100
|
+
eventId:
|
|
101
|
+
type: string
|
|
102
|
+
description: The ID of the event to retrieve
|
|
103
|
+
required:
|
|
104
|
+
- eventId
|
|
105
|
+
|
|
106
|
+
- name: updateEvent
|
|
107
|
+
description: Update an existing calendar event
|
|
108
|
+
parameters:
|
|
109
|
+
type: object
|
|
110
|
+
properties:
|
|
111
|
+
eventId:
|
|
112
|
+
type: string
|
|
113
|
+
description: The ID of the event to update
|
|
114
|
+
updates:
|
|
115
|
+
type: object
|
|
116
|
+
description: Fields to update (title, startDateTime, endDateTime, description, location)
|
|
117
|
+
required:
|
|
118
|
+
- eventId
|
|
119
|
+
- updates
|
|
120
|
+
|
|
121
|
+
- name: deleteEvent
|
|
122
|
+
description: Delete a calendar event
|
|
123
|
+
parameters:
|
|
124
|
+
type: object
|
|
125
|
+
properties:
|
|
126
|
+
eventId:
|
|
127
|
+
type: string
|
|
128
|
+
description: The ID of the event to delete
|
|
129
|
+
notifyParticipants:
|
|
130
|
+
type: boolean
|
|
131
|
+
description: Whether to notify participants about the cancellation
|
|
132
|
+
required:
|
|
133
|
+
- eventId
|
|
134
|
+
|
|
135
|
+
- name: checkAvailability
|
|
136
|
+
description: Check availability for a potential time slot
|
|
137
|
+
parameters:
|
|
138
|
+
type: object
|
|
139
|
+
properties:
|
|
140
|
+
startDateTime:
|
|
141
|
+
type: string
|
|
142
|
+
description: Start date and time in ISO format (YYYY-MM-DDTHH:MM:SS)
|
|
143
|
+
endDateTime:
|
|
144
|
+
type: string
|
|
145
|
+
description: End date and time in ISO format (YYYY-MM-DDTHH:MM:SS)
|
|
146
|
+
participants:
|
|
147
|
+
type: array
|
|
148
|
+
items:
|
|
149
|
+
type: string
|
|
150
|
+
description: Optional list of participants to check availability for
|
|
151
|
+
required:
|
|
152
|
+
- startDateTime
|
|
153
|
+
- endDateTime
|
|
154
|
+
|
|
155
|
+
discoverySchemas:
|
|
156
|
+
- name: planner_agent_query
|
|
157
|
+
description: Manage calendar events including creation, listing, updating, and deletion
|
|
158
|
+
parameters:
|
|
159
|
+
type: object
|
|
160
|
+
properties:
|
|
161
|
+
request:
|
|
162
|
+
type: string
|
|
163
|
+
description: The user's event management request
|
|
164
|
+
context:
|
|
165
|
+
type: object
|
|
166
|
+
description: Additional context about the request
|
|
167
|
+
required:
|
|
168
|
+
- request
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
apiVersion: smartagent.io/v1alpha1
|
|
172
|
+
kind: AgentDefinition
|
|
173
|
+
metadata:
|
|
174
|
+
name: eventFinderAgent
|
|
175
|
+
namespace: eventPlanner
|
|
176
|
+
spec:
|
|
177
|
+
io:
|
|
178
|
+
- type: NatsIO
|
|
179
|
+
bindings:
|
|
180
|
+
discoveryTopic: eventPlanner.discovery
|
|
181
|
+
store:
|
|
182
|
+
type: Memory
|
|
183
|
+
llm:
|
|
184
|
+
provider: Gemini
|
|
185
|
+
model: gemini-2.0-flash
|
|
186
|
+
systemInstruction: |
|
|
187
|
+
You are an event finder assistant specialized in searching and filtering events.
|
|
188
|
+
Your role is to:
|
|
189
|
+
1. Help users find specific events in their calendar
|
|
190
|
+
2. Filter events by various criteria (date range, participants, keywords, etc.)
|
|
191
|
+
3. Identify scheduling conflicts
|
|
192
|
+
4. Suggest optimal meeting times
|
|
193
|
+
|
|
194
|
+
Be precise, efficient, and thorough in your search results. Provide clear
|
|
195
|
+
and concise information to help users quickly understand their calendar situation.
|
|
196
|
+
config:
|
|
197
|
+
temperature: 0.3
|
|
198
|
+
toolConfig:
|
|
199
|
+
functionCallingConfig:
|
|
200
|
+
mode: 'auto'
|
|
201
|
+
|
|
202
|
+
tools:
|
|
203
|
+
- name: searchEvents
|
|
204
|
+
description: Search for events matching specific criteria
|
|
205
|
+
parameters:
|
|
206
|
+
type: object
|
|
207
|
+
properties:
|
|
208
|
+
query:
|
|
209
|
+
type: string
|
|
210
|
+
description: Free text search query
|
|
211
|
+
startDate:
|
|
212
|
+
type: string
|
|
213
|
+
description: Optional start date in YYYY-MM-DD format
|
|
214
|
+
endDate:
|
|
215
|
+
type: string
|
|
216
|
+
description: Optional end date in YYYY-MM-DD format
|
|
217
|
+
participants:
|
|
218
|
+
type: array
|
|
219
|
+
items:
|
|
220
|
+
type: string
|
|
221
|
+
description: Optional list of participants to filter by
|
|
222
|
+
locations:
|
|
223
|
+
type: array
|
|
224
|
+
items:
|
|
225
|
+
type: string
|
|
226
|
+
description: Optional list of locations to filter by
|
|
227
|
+
maxResults:
|
|
228
|
+
type: integer
|
|
229
|
+
description: Maximum number of events to return
|
|
230
|
+
required:
|
|
231
|
+
- query
|
|
232
|
+
|
|
233
|
+
- name: findConflicts
|
|
234
|
+
description: Find scheduling conflicts within a date range
|
|
235
|
+
parameters:
|
|
236
|
+
type: object
|
|
237
|
+
properties:
|
|
238
|
+
startDate:
|
|
239
|
+
type: string
|
|
240
|
+
description: Start date in YYYY-MM-DD format
|
|
241
|
+
endDate:
|
|
242
|
+
type: string
|
|
243
|
+
description: End date in YYYY-MM-DD format
|
|
244
|
+
participants:
|
|
245
|
+
type: array
|
|
246
|
+
items:
|
|
247
|
+
type: string
|
|
248
|
+
description: Optional list of participants to check conflicts for
|
|
249
|
+
required:
|
|
250
|
+
- startDate
|
|
251
|
+
- endDate
|
|
252
|
+
|
|
253
|
+
- name: suggestMeetingTimes
|
|
254
|
+
description: Suggest available meeting times for all participants
|
|
255
|
+
parameters:
|
|
256
|
+
type: object
|
|
257
|
+
properties:
|
|
258
|
+
participants:
|
|
259
|
+
type: array
|
|
260
|
+
items:
|
|
261
|
+
type: string
|
|
262
|
+
description: List of participants' emails
|
|
263
|
+
duration:
|
|
264
|
+
type: integer
|
|
265
|
+
description: Required meeting duration in minutes
|
|
266
|
+
earliestDate:
|
|
267
|
+
type: string
|
|
268
|
+
description: Earliest date to consider in YYYY-MM-DD format
|
|
269
|
+
latestDate:
|
|
270
|
+
type: string
|
|
271
|
+
description: Latest date to consider in YYYY-MM-DD format
|
|
272
|
+
workingHoursStart:
|
|
273
|
+
type: string
|
|
274
|
+
description: Start of working hours in HH:MM format
|
|
275
|
+
workingHoursEnd:
|
|
276
|
+
type: string
|
|
277
|
+
description: End of working hours in HH:MM format
|
|
278
|
+
required:
|
|
279
|
+
- participants
|
|
280
|
+
- duration
|
|
281
|
+
- earliestDate
|
|
282
|
+
- latestDate
|
|
283
|
+
|
|
284
|
+
- name: getFreeBusy
|
|
285
|
+
description: Get free/busy information for participants
|
|
286
|
+
parameters:
|
|
287
|
+
type: object
|
|
288
|
+
properties:
|
|
289
|
+
participants:
|
|
290
|
+
type: array
|
|
291
|
+
items:
|
|
292
|
+
type: string
|
|
293
|
+
description: List of participants' emails
|
|
294
|
+
startDate:
|
|
295
|
+
type: string
|
|
296
|
+
description: Start date in YYYY-MM-DD format
|
|
297
|
+
endDate:
|
|
298
|
+
type: string
|
|
299
|
+
description: End date in YYYY-MM-DD format
|
|
300
|
+
required:
|
|
301
|
+
- participants
|
|
302
|
+
- startDate
|
|
303
|
+
- endDate
|
|
304
|
+
|
|
305
|
+
discoverySchemas:
|
|
306
|
+
- name: event_finder_query
|
|
307
|
+
description: Search for events and find optimal meeting times
|
|
308
|
+
parameters:
|
|
309
|
+
type: object
|
|
310
|
+
properties:
|
|
311
|
+
search:
|
|
312
|
+
type: string
|
|
313
|
+
description: The user's search or scheduling query
|
|
314
|
+
filters:
|
|
315
|
+
type: object
|
|
316
|
+
description: Additional filter criteria
|
|
317
|
+
required:
|
|
318
|
+
- search
|