google-adk 1.6.1__py3-none-any.whl → 1.7.0__py3-none-any.whl

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.
Files changed (81) hide show
  1. google/adk/a2a/converters/event_converter.py +5 -85
  2. google/adk/a2a/executor/a2a_agent_executor.py +45 -16
  3. google/adk/agents/__init__.py +5 -0
  4. google/adk/agents/agent_config.py +46 -0
  5. google/adk/agents/base_agent.py +234 -41
  6. google/adk/agents/callback_context.py +41 -0
  7. google/adk/agents/common_configs.py +79 -0
  8. google/adk/agents/config_agent_utils.py +184 -0
  9. google/adk/agents/config_schemas/AgentConfig.json +544 -0
  10. google/adk/agents/invocation_context.py +5 -1
  11. google/adk/agents/llm_agent.py +190 -9
  12. google/adk/agents/loop_agent.py +29 -0
  13. google/adk/agents/parallel_agent.py +24 -3
  14. google/adk/agents/remote_a2a_agent.py +15 -3
  15. google/adk/agents/sequential_agent.py +22 -1
  16. google/adk/artifacts/gcs_artifact_service.py +24 -2
  17. google/adk/auth/auth_handler.py +3 -3
  18. google/adk/auth/credential_manager.py +23 -23
  19. google/adk/auth/credential_service/base_credential_service.py +6 -6
  20. google/adk/auth/credential_service/in_memory_credential_service.py +10 -8
  21. google/adk/auth/credential_service/session_state_credential_service.py +8 -8
  22. google/adk/auth/exchanger/oauth2_credential_exchanger.py +3 -3
  23. google/adk/auth/oauth2_credential_util.py +2 -2
  24. google/adk/auth/refresher/oauth2_credential_refresher.py +4 -4
  25. google/adk/cli/agent_graph.py +3 -1
  26. google/adk/cli/browser/index.html +1 -1
  27. google/adk/cli/browser/main-SRBSE46V.js +3914 -0
  28. google/adk/cli/browser/polyfills-B6TNHZQ6.js +17 -0
  29. google/adk/cli/fast_api.py +42 -2
  30. google/adk/cli/utils/agent_loader.py +35 -1
  31. google/adk/code_executors/base_code_executor.py +14 -19
  32. google/adk/code_executors/built_in_code_executor.py +4 -1
  33. google/adk/evaluation/base_eval_service.py +46 -2
  34. google/adk/evaluation/evaluation_generator.py +1 -1
  35. google/adk/evaluation/in_memory_eval_sets_manager.py +151 -0
  36. google/adk/evaluation/local_eval_service.py +389 -0
  37. google/adk/evaluation/local_eval_sets_manager.py +23 -8
  38. google/adk/flows/llm_flows/auto_flow.py +6 -11
  39. google/adk/flows/llm_flows/base_llm_flow.py +41 -23
  40. google/adk/flows/llm_flows/contents.py +16 -10
  41. google/adk/flows/llm_flows/functions.py +76 -33
  42. google/adk/memory/in_memory_memory_service.py +20 -14
  43. google/adk/models/anthropic_llm.py +44 -5
  44. google/adk/models/google_llm.py +11 -6
  45. google/adk/models/lite_llm.py +21 -4
  46. google/adk/plugins/__init__.py +17 -0
  47. google/adk/plugins/base_plugin.py +317 -0
  48. google/adk/plugins/plugin_manager.py +265 -0
  49. google/adk/runners.py +122 -18
  50. google/adk/sessions/database_session_service.py +26 -28
  51. google/adk/sessions/vertex_ai_session_service.py +14 -7
  52. google/adk/tools/agent_tool.py +1 -0
  53. google/adk/tools/apihub_tool/apihub_toolset.py +38 -39
  54. google/adk/tools/application_integration_tool/application_integration_toolset.py +35 -37
  55. google/adk/tools/application_integration_tool/integration_connector_tool.py +2 -3
  56. google/adk/tools/base_tool.py +9 -9
  57. google/adk/tools/base_toolset.py +7 -5
  58. google/adk/tools/bigquery/__init__.py +3 -3
  59. google/adk/tools/enterprise_search_tool.py +4 -2
  60. google/adk/tools/google_api_tool/google_api_tool.py +16 -1
  61. google/adk/tools/google_api_tool/google_api_toolset.py +9 -7
  62. google/adk/tools/google_api_tool/google_api_toolsets.py +41 -20
  63. google/adk/tools/google_search_tool.py +4 -2
  64. google/adk/tools/langchain_tool.py +2 -3
  65. google/adk/tools/long_running_tool.py +21 -0
  66. google/adk/tools/mcp_tool/mcp_toolset.py +27 -28
  67. google/adk/tools/openapi_tool/openapi_spec_parser/openapi_toolset.py +8 -8
  68. google/adk/tools/openapi_tool/openapi_spec_parser/rest_api_tool.py +4 -6
  69. google/adk/tools/retrieval/vertex_ai_rag_retrieval.py +3 -2
  70. google/adk/tools/tool_context.py +0 -10
  71. google/adk/tools/url_context_tool.py +4 -2
  72. google/adk/tools/vertex_ai_search_tool.py +4 -2
  73. google/adk/utils/model_name_utils.py +90 -0
  74. google/adk/version.py +1 -1
  75. {google_adk-1.6.1.dist-info → google_adk-1.7.0.dist-info}/METADATA +2 -2
  76. {google_adk-1.6.1.dist-info → google_adk-1.7.0.dist-info}/RECORD +79 -69
  77. google/adk/cli/browser/main-RXDVX3K6.js +0 -3914
  78. google/adk/cli/browser/polyfills-FFHMD2TL.js +0 -17
  79. {google_adk-1.6.1.dist-info → google_adk-1.7.0.dist-info}/WHEEL +0 -0
  80. {google_adk-1.6.1.dist-info → google_adk-1.7.0.dist-info}/entry_points.txt +0 -0
  81. {google_adk-1.6.1.dist-info → google_adk-1.7.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,544 @@
1
+ {
2
+ "$defs": {
3
+ "ArgumentConfig": {
4
+ "additionalProperties": false,
5
+ "description": "An argument passed to a function or a class's constructor.",
6
+ "properties": {
7
+ "name": {
8
+ "anyOf": [
9
+ {
10
+ "type": "string"
11
+ },
12
+ {
13
+ "type": "null"
14
+ }
15
+ ],
16
+ "default": null,
17
+ "title": "Name"
18
+ },
19
+ "value": {
20
+ "title": "Value"
21
+ }
22
+ },
23
+ "required": [
24
+ "value"
25
+ ],
26
+ "title": "ArgumentConfig",
27
+ "type": "object"
28
+ },
29
+ "CodeConfig": {
30
+ "additionalProperties": false,
31
+ "description": "Code reference config for a variable, a function, or a class.\n\nThis config is used for configuring callbacks and tools.",
32
+ "properties": {
33
+ "name": {
34
+ "title": "Name",
35
+ "type": "string"
36
+ },
37
+ "args": {
38
+ "anyOf": [
39
+ {
40
+ "items": {
41
+ "$ref": "#/$defs/ArgumentConfig"
42
+ },
43
+ "type": "array"
44
+ },
45
+ {
46
+ "type": "null"
47
+ }
48
+ ],
49
+ "default": null,
50
+ "title": "Args"
51
+ }
52
+ },
53
+ "required": [
54
+ "name"
55
+ ],
56
+ "title": "CodeConfig",
57
+ "type": "object"
58
+ },
59
+ "LlmAgentConfig": {
60
+ "additionalProperties": false,
61
+ "description": "The config for the YAML schema of a LlmAgent.",
62
+ "properties": {
63
+ "agent_class": {
64
+ "default": "LlmAgent",
65
+ "enum": [
66
+ "LlmAgent",
67
+ ""
68
+ ],
69
+ "title": "Agent Class",
70
+ "type": "string"
71
+ },
72
+ "name": {
73
+ "title": "Name",
74
+ "type": "string"
75
+ },
76
+ "description": {
77
+ "default": "",
78
+ "title": "Description",
79
+ "type": "string"
80
+ },
81
+ "sub_agents": {
82
+ "anyOf": [
83
+ {
84
+ "items": {
85
+ "$ref": "#/$defs/SubAgentConfig"
86
+ },
87
+ "type": "array"
88
+ },
89
+ {
90
+ "type": "null"
91
+ }
92
+ ],
93
+ "default": null,
94
+ "title": "Sub Agents"
95
+ },
96
+ "before_agent_callbacks": {
97
+ "anyOf": [
98
+ {
99
+ "items": {
100
+ "$ref": "#/$defs/CodeConfig"
101
+ },
102
+ "type": "array"
103
+ },
104
+ {
105
+ "type": "null"
106
+ }
107
+ ],
108
+ "default": null,
109
+ "title": "Before Agent Callbacks"
110
+ },
111
+ "after_agent_callbacks": {
112
+ "anyOf": [
113
+ {
114
+ "items": {
115
+ "$ref": "#/$defs/CodeConfig"
116
+ },
117
+ "type": "array"
118
+ },
119
+ {
120
+ "type": "null"
121
+ }
122
+ ],
123
+ "default": null,
124
+ "title": "After Agent Callbacks"
125
+ },
126
+ "model": {
127
+ "anyOf": [
128
+ {
129
+ "type": "string"
130
+ },
131
+ {
132
+ "type": "null"
133
+ }
134
+ ],
135
+ "default": null,
136
+ "title": "Model"
137
+ },
138
+ "instruction": {
139
+ "title": "Instruction",
140
+ "type": "string"
141
+ },
142
+ "disallow_transfer_to_parent": {
143
+ "anyOf": [
144
+ {
145
+ "type": "boolean"
146
+ },
147
+ {
148
+ "type": "null"
149
+ }
150
+ ],
151
+ "default": null,
152
+ "title": "Disallow Transfer To Parent"
153
+ },
154
+ "disallow_transfer_to_peers": {
155
+ "anyOf": [
156
+ {
157
+ "type": "boolean"
158
+ },
159
+ {
160
+ "type": "null"
161
+ }
162
+ ],
163
+ "default": null,
164
+ "title": "Disallow Transfer To Peers"
165
+ },
166
+ "output_key": {
167
+ "anyOf": [
168
+ {
169
+ "type": "string"
170
+ },
171
+ {
172
+ "type": "null"
173
+ }
174
+ ],
175
+ "default": null,
176
+ "title": "Output Key"
177
+ },
178
+ "include_contents": {
179
+ "default": "default",
180
+ "enum": [
181
+ "default",
182
+ "none"
183
+ ],
184
+ "title": "Include Contents",
185
+ "type": "string"
186
+ },
187
+ "tools": {
188
+ "anyOf": [
189
+ {
190
+ "items": {
191
+ "$ref": "#/$defs/CodeConfig"
192
+ },
193
+ "type": "array"
194
+ },
195
+ {
196
+ "type": "null"
197
+ }
198
+ ],
199
+ "default": null,
200
+ "title": "Tools"
201
+ },
202
+ "before_model_callbacks": {
203
+ "anyOf": [
204
+ {
205
+ "items": {
206
+ "$ref": "#/$defs/CodeConfig"
207
+ },
208
+ "type": "array"
209
+ },
210
+ {
211
+ "type": "null"
212
+ }
213
+ ],
214
+ "default": null,
215
+ "title": "Before Model Callbacks"
216
+ },
217
+ "after_model_callbacks": {
218
+ "anyOf": [
219
+ {
220
+ "items": {
221
+ "$ref": "#/$defs/CodeConfig"
222
+ },
223
+ "type": "array"
224
+ },
225
+ {
226
+ "type": "null"
227
+ }
228
+ ],
229
+ "default": null,
230
+ "title": "After Model Callbacks"
231
+ },
232
+ "before_tool_callbacks": {
233
+ "anyOf": [
234
+ {
235
+ "items": {
236
+ "$ref": "#/$defs/CodeConfig"
237
+ },
238
+ "type": "array"
239
+ },
240
+ {
241
+ "type": "null"
242
+ }
243
+ ],
244
+ "default": null,
245
+ "title": "Before Tool Callbacks"
246
+ },
247
+ "after_tool_callbacks": {
248
+ "anyOf": [
249
+ {
250
+ "items": {
251
+ "$ref": "#/$defs/CodeConfig"
252
+ },
253
+ "type": "array"
254
+ },
255
+ {
256
+ "type": "null"
257
+ }
258
+ ],
259
+ "default": null,
260
+ "title": "After Tool Callbacks"
261
+ }
262
+ },
263
+ "required": [
264
+ "name",
265
+ "instruction"
266
+ ],
267
+ "title": "LlmAgentConfig",
268
+ "type": "object"
269
+ },
270
+ "LoopAgentConfig": {
271
+ "additionalProperties": false,
272
+ "description": "The config for the YAML schema of a LoopAgent.",
273
+ "properties": {
274
+ "agent_class": {
275
+ "const": "LoopAgent",
276
+ "default": "LoopAgent",
277
+ "title": "Agent Class",
278
+ "type": "string"
279
+ },
280
+ "name": {
281
+ "title": "Name",
282
+ "type": "string"
283
+ },
284
+ "description": {
285
+ "default": "",
286
+ "title": "Description",
287
+ "type": "string"
288
+ },
289
+ "sub_agents": {
290
+ "anyOf": [
291
+ {
292
+ "items": {
293
+ "$ref": "#/$defs/SubAgentConfig"
294
+ },
295
+ "type": "array"
296
+ },
297
+ {
298
+ "type": "null"
299
+ }
300
+ ],
301
+ "default": null,
302
+ "title": "Sub Agents"
303
+ },
304
+ "before_agent_callbacks": {
305
+ "anyOf": [
306
+ {
307
+ "items": {
308
+ "$ref": "#/$defs/CodeConfig"
309
+ },
310
+ "type": "array"
311
+ },
312
+ {
313
+ "type": "null"
314
+ }
315
+ ],
316
+ "default": null,
317
+ "title": "Before Agent Callbacks"
318
+ },
319
+ "after_agent_callbacks": {
320
+ "anyOf": [
321
+ {
322
+ "items": {
323
+ "$ref": "#/$defs/CodeConfig"
324
+ },
325
+ "type": "array"
326
+ },
327
+ {
328
+ "type": "null"
329
+ }
330
+ ],
331
+ "default": null,
332
+ "title": "After Agent Callbacks"
333
+ },
334
+ "max_iterations": {
335
+ "anyOf": [
336
+ {
337
+ "type": "integer"
338
+ },
339
+ {
340
+ "type": "null"
341
+ }
342
+ ],
343
+ "default": null,
344
+ "title": "Max Iterations"
345
+ }
346
+ },
347
+ "required": [
348
+ "name"
349
+ ],
350
+ "title": "LoopAgentConfig",
351
+ "type": "object"
352
+ },
353
+ "ParallelAgentConfig": {
354
+ "additionalProperties": false,
355
+ "description": "The config for the YAML schema of a ParallelAgent.",
356
+ "properties": {
357
+ "agent_class": {
358
+ "const": "ParallelAgent",
359
+ "default": "ParallelAgent",
360
+ "title": "Agent Class",
361
+ "type": "string"
362
+ },
363
+ "name": {
364
+ "title": "Name",
365
+ "type": "string"
366
+ },
367
+ "description": {
368
+ "default": "",
369
+ "title": "Description",
370
+ "type": "string"
371
+ },
372
+ "sub_agents": {
373
+ "anyOf": [
374
+ {
375
+ "items": {
376
+ "$ref": "#/$defs/SubAgentConfig"
377
+ },
378
+ "type": "array"
379
+ },
380
+ {
381
+ "type": "null"
382
+ }
383
+ ],
384
+ "default": null,
385
+ "title": "Sub Agents"
386
+ },
387
+ "before_agent_callbacks": {
388
+ "anyOf": [
389
+ {
390
+ "items": {
391
+ "$ref": "#/$defs/CodeConfig"
392
+ },
393
+ "type": "array"
394
+ },
395
+ {
396
+ "type": "null"
397
+ }
398
+ ],
399
+ "default": null,
400
+ "title": "Before Agent Callbacks"
401
+ },
402
+ "after_agent_callbacks": {
403
+ "anyOf": [
404
+ {
405
+ "items": {
406
+ "$ref": "#/$defs/CodeConfig"
407
+ },
408
+ "type": "array"
409
+ },
410
+ {
411
+ "type": "null"
412
+ }
413
+ ],
414
+ "default": null,
415
+ "title": "After Agent Callbacks"
416
+ }
417
+ },
418
+ "required": [
419
+ "name"
420
+ ],
421
+ "title": "ParallelAgentConfig",
422
+ "type": "object"
423
+ },
424
+ "SequentialAgentConfig": {
425
+ "additionalProperties": false,
426
+ "description": "The config for the YAML schema of a SequentialAgent.",
427
+ "properties": {
428
+ "agent_class": {
429
+ "const": "SequentialAgent",
430
+ "default": "SequentialAgent",
431
+ "title": "Agent Class",
432
+ "type": "string"
433
+ },
434
+ "name": {
435
+ "title": "Name",
436
+ "type": "string"
437
+ },
438
+ "description": {
439
+ "default": "",
440
+ "title": "Description",
441
+ "type": "string"
442
+ },
443
+ "sub_agents": {
444
+ "anyOf": [
445
+ {
446
+ "items": {
447
+ "$ref": "#/$defs/SubAgentConfig"
448
+ },
449
+ "type": "array"
450
+ },
451
+ {
452
+ "type": "null"
453
+ }
454
+ ],
455
+ "default": null,
456
+ "title": "Sub Agents"
457
+ },
458
+ "before_agent_callbacks": {
459
+ "anyOf": [
460
+ {
461
+ "items": {
462
+ "$ref": "#/$defs/CodeConfig"
463
+ },
464
+ "type": "array"
465
+ },
466
+ {
467
+ "type": "null"
468
+ }
469
+ ],
470
+ "default": null,
471
+ "title": "Before Agent Callbacks"
472
+ },
473
+ "after_agent_callbacks": {
474
+ "anyOf": [
475
+ {
476
+ "items": {
477
+ "$ref": "#/$defs/CodeConfig"
478
+ },
479
+ "type": "array"
480
+ },
481
+ {
482
+ "type": "null"
483
+ }
484
+ ],
485
+ "default": null,
486
+ "title": "After Agent Callbacks"
487
+ }
488
+ },
489
+ "required": [
490
+ "name"
491
+ ],
492
+ "title": "SequentialAgentConfig",
493
+ "type": "object"
494
+ },
495
+ "SubAgentConfig": {
496
+ "additionalProperties": false,
497
+ "description": "The config for a sub-agent.",
498
+ "properties": {
499
+ "config": {
500
+ "anyOf": [
501
+ {
502
+ "type": "string"
503
+ },
504
+ {
505
+ "type": "null"
506
+ }
507
+ ],
508
+ "default": null,
509
+ "title": "Config"
510
+ },
511
+ "code": {
512
+ "anyOf": [
513
+ {
514
+ "type": "string"
515
+ },
516
+ {
517
+ "type": "null"
518
+ }
519
+ ],
520
+ "default": null,
521
+ "title": "Code"
522
+ }
523
+ },
524
+ "title": "SubAgentConfig",
525
+ "type": "object"
526
+ }
527
+ },
528
+ "anyOf": [
529
+ {
530
+ "$ref": "#/$defs/LlmAgentConfig"
531
+ },
532
+ {
533
+ "$ref": "#/$defs/LoopAgentConfig"
534
+ },
535
+ {
536
+ "$ref": "#/$defs/ParallelAgentConfig"
537
+ },
538
+ {
539
+ "$ref": "#/$defs/SequentialAgentConfig"
540
+ }
541
+ ],
542
+ "description": "The config for the YAML schema to create an agent.",
543
+ "title": "AgentConfig"
544
+ }
@@ -24,6 +24,7 @@ from pydantic import ConfigDict
24
24
  from ..artifacts.base_artifact_service import BaseArtifactService
25
25
  from ..auth.credential_service.base_credential_service import BaseCredentialService
26
26
  from ..memory.base_memory_service import BaseMemoryService
27
+ from ..plugins.plugin_manager import PluginManager
27
28
  from ..sessions.base_session_service import BaseSessionService
28
29
  from ..sessions.session import Session
29
30
  from .active_streaming_tool import ActiveStreamingTool
@@ -148,11 +149,14 @@ class InvocationContext(BaseModel):
148
149
  """The running streaming tools of this invocation."""
149
150
 
150
151
  transcription_cache: Optional[list[TranscriptionEntry]] = None
151
- """Caches necessary, data audio or contents, that are needed by transcription."""
152
+ """Caches necessary data, audio or contents, that are needed by transcription."""
152
153
 
153
154
  run_config: Optional[RunConfig] = None
154
155
  """Configurations for live agents under this invocation."""
155
156
 
157
+ plugin_manager: PluginManager = PluginManager()
158
+ """The manager for keeping track of plugins in this invocation."""
159
+
156
160
  _invocation_cost_manager: _InvocationCostManager = _InvocationCostManager()
157
161
  """A container to keep track of different kinds of costs incurred as a part
158
162
  of this invocation.