google-adk 1.6.1__py3-none-any.whl → 1.8.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 (110) hide show
  1. google/adk/a2a/converters/event_converter.py +5 -85
  2. google/adk/a2a/converters/request_converter.py +1 -2
  3. google/adk/a2a/executor/a2a_agent_executor.py +45 -16
  4. google/adk/a2a/logs/log_utils.py +1 -2
  5. google/adk/a2a/utils/__init__.py +0 -0
  6. google/adk/a2a/utils/agent_card_builder.py +544 -0
  7. google/adk/a2a/utils/agent_to_a2a.py +118 -0
  8. google/adk/agents/__init__.py +5 -0
  9. google/adk/agents/agent_config.py +46 -0
  10. google/adk/agents/base_agent.py +239 -41
  11. google/adk/agents/callback_context.py +41 -0
  12. google/adk/agents/common_configs.py +79 -0
  13. google/adk/agents/config_agent_utils.py +184 -0
  14. google/adk/agents/config_schemas/AgentConfig.json +566 -0
  15. google/adk/agents/invocation_context.py +5 -1
  16. google/adk/agents/live_request_queue.py +15 -0
  17. google/adk/agents/llm_agent.py +201 -9
  18. google/adk/agents/loop_agent.py +35 -1
  19. google/adk/agents/parallel_agent.py +24 -3
  20. google/adk/agents/remote_a2a_agent.py +17 -5
  21. google/adk/agents/sequential_agent.py +22 -1
  22. google/adk/artifacts/gcs_artifact_service.py +110 -20
  23. google/adk/auth/auth_handler.py +3 -3
  24. google/adk/auth/credential_manager.py +23 -23
  25. google/adk/auth/credential_service/base_credential_service.py +6 -6
  26. google/adk/auth/credential_service/in_memory_credential_service.py +10 -8
  27. google/adk/auth/credential_service/session_state_credential_service.py +8 -8
  28. google/adk/auth/exchanger/oauth2_credential_exchanger.py +3 -3
  29. google/adk/auth/oauth2_credential_util.py +2 -2
  30. google/adk/auth/refresher/oauth2_credential_refresher.py +4 -4
  31. google/adk/cli/agent_graph.py +3 -1
  32. google/adk/cli/browser/index.html +2 -2
  33. google/adk/cli/browser/main-W7QZBYAR.js +3914 -0
  34. google/adk/cli/browser/polyfills-B6TNHZQ6.js +17 -0
  35. google/adk/cli/cli_eval.py +87 -12
  36. google/adk/cli/cli_tools_click.py +143 -82
  37. google/adk/cli/fast_api.py +150 -69
  38. google/adk/cli/utils/agent_loader.py +35 -1
  39. google/adk/code_executors/base_code_executor.py +14 -19
  40. google/adk/code_executors/built_in_code_executor.py +4 -1
  41. google/adk/evaluation/base_eval_service.py +46 -2
  42. google/adk/evaluation/eval_metrics.py +4 -0
  43. google/adk/evaluation/eval_sets_manager.py +5 -1
  44. google/adk/evaluation/evaluation_generator.py +1 -1
  45. google/adk/evaluation/final_response_match_v2.py +2 -2
  46. google/adk/evaluation/gcs_eval_sets_manager.py +2 -1
  47. google/adk/evaluation/in_memory_eval_sets_manager.py +151 -0
  48. google/adk/evaluation/local_eval_service.py +389 -0
  49. google/adk/evaluation/local_eval_set_results_manager.py +2 -2
  50. google/adk/evaluation/local_eval_sets_manager.py +24 -9
  51. google/adk/evaluation/metric_evaluator_registry.py +16 -6
  52. google/adk/evaluation/vertex_ai_eval_facade.py +7 -1
  53. google/adk/events/event.py +7 -2
  54. google/adk/flows/llm_flows/auto_flow.py +6 -11
  55. google/adk/flows/llm_flows/base_llm_flow.py +66 -29
  56. google/adk/flows/llm_flows/contents.py +16 -10
  57. google/adk/flows/llm_flows/functions.py +89 -52
  58. google/adk/memory/in_memory_memory_service.py +21 -15
  59. google/adk/memory/vertex_ai_memory_bank_service.py +12 -10
  60. google/adk/models/anthropic_llm.py +46 -6
  61. google/adk/models/base_llm_connection.py +2 -0
  62. google/adk/models/gemini_llm_connection.py +17 -6
  63. google/adk/models/google_llm.py +46 -11
  64. google/adk/models/lite_llm.py +52 -22
  65. google/adk/plugins/__init__.py +17 -0
  66. google/adk/plugins/base_plugin.py +317 -0
  67. google/adk/plugins/plugin_manager.py +265 -0
  68. google/adk/runners.py +122 -18
  69. google/adk/sessions/database_session_service.py +51 -52
  70. google/adk/sessions/vertex_ai_session_service.py +27 -12
  71. google/adk/tools/__init__.py +2 -0
  72. google/adk/tools/_automatic_function_calling_util.py +20 -2
  73. google/adk/tools/agent_tool.py +15 -3
  74. google/adk/tools/apihub_tool/apihub_toolset.py +38 -39
  75. google/adk/tools/application_integration_tool/application_integration_toolset.py +35 -37
  76. google/adk/tools/application_integration_tool/integration_connector_tool.py +2 -3
  77. google/adk/tools/base_tool.py +9 -9
  78. google/adk/tools/base_toolset.py +29 -5
  79. google/adk/tools/bigquery/__init__.py +3 -3
  80. google/adk/tools/bigquery/metadata_tool.py +2 -0
  81. google/adk/tools/bigquery/query_tool.py +15 -1
  82. google/adk/tools/computer_use/__init__.py +13 -0
  83. google/adk/tools/computer_use/base_computer.py +265 -0
  84. google/adk/tools/computer_use/computer_use_tool.py +166 -0
  85. google/adk/tools/computer_use/computer_use_toolset.py +220 -0
  86. google/adk/tools/enterprise_search_tool.py +4 -2
  87. google/adk/tools/exit_loop_tool.py +1 -0
  88. google/adk/tools/google_api_tool/google_api_tool.py +16 -1
  89. google/adk/tools/google_api_tool/google_api_toolset.py +9 -7
  90. google/adk/tools/google_api_tool/google_api_toolsets.py +41 -20
  91. google/adk/tools/google_search_tool.py +4 -2
  92. google/adk/tools/langchain_tool.py +16 -6
  93. google/adk/tools/long_running_tool.py +21 -0
  94. google/adk/tools/mcp_tool/mcp_toolset.py +27 -28
  95. google/adk/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.py +5 -0
  96. google/adk/tools/openapi_tool/openapi_spec_parser/openapi_toolset.py +8 -8
  97. google/adk/tools/openapi_tool/openapi_spec_parser/rest_api_tool.py +4 -6
  98. google/adk/tools/retrieval/vertex_ai_rag_retrieval.py +3 -2
  99. google/adk/tools/tool_context.py +0 -10
  100. google/adk/tools/url_context_tool.py +4 -2
  101. google/adk/tools/vertex_ai_search_tool.py +4 -2
  102. google/adk/utils/model_name_utils.py +90 -0
  103. google/adk/version.py +1 -1
  104. {google_adk-1.6.1.dist-info → google_adk-1.8.0.dist-info}/METADATA +3 -2
  105. {google_adk-1.6.1.dist-info → google_adk-1.8.0.dist-info}/RECORD +108 -91
  106. google/adk/cli/browser/main-RXDVX3K6.js +0 -3914
  107. google/adk/cli/browser/polyfills-FFHMD2TL.js +0 -17
  108. {google_adk-1.6.1.dist-info → google_adk-1.8.0.dist-info}/WHEEL +0 -0
  109. {google_adk-1.6.1.dist-info → google_adk-1.8.0.dist-info}/entry_points.txt +0 -0
  110. {google_adk-1.6.1.dist-info → google_adk-1.8.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,566 @@
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
+ "input_schema": {
167
+ "anyOf": [
168
+ {
169
+ "$ref": "#/$defs/CodeConfig"
170
+ },
171
+ {
172
+ "type": "null"
173
+ }
174
+ ],
175
+ "default": null
176
+ },
177
+ "output_schema": {
178
+ "anyOf": [
179
+ {
180
+ "$ref": "#/$defs/CodeConfig"
181
+ },
182
+ {
183
+ "type": "null"
184
+ }
185
+ ],
186
+ "default": null
187
+ },
188
+ "output_key": {
189
+ "anyOf": [
190
+ {
191
+ "type": "string"
192
+ },
193
+ {
194
+ "type": "null"
195
+ }
196
+ ],
197
+ "default": null,
198
+ "title": "Output Key"
199
+ },
200
+ "include_contents": {
201
+ "default": "default",
202
+ "enum": [
203
+ "default",
204
+ "none"
205
+ ],
206
+ "title": "Include Contents",
207
+ "type": "string"
208
+ },
209
+ "tools": {
210
+ "anyOf": [
211
+ {
212
+ "items": {
213
+ "$ref": "#/$defs/CodeConfig"
214
+ },
215
+ "type": "array"
216
+ },
217
+ {
218
+ "type": "null"
219
+ }
220
+ ],
221
+ "default": null,
222
+ "title": "Tools"
223
+ },
224
+ "before_model_callbacks": {
225
+ "anyOf": [
226
+ {
227
+ "items": {
228
+ "$ref": "#/$defs/CodeConfig"
229
+ },
230
+ "type": "array"
231
+ },
232
+ {
233
+ "type": "null"
234
+ }
235
+ ],
236
+ "default": null,
237
+ "title": "Before Model Callbacks"
238
+ },
239
+ "after_model_callbacks": {
240
+ "anyOf": [
241
+ {
242
+ "items": {
243
+ "$ref": "#/$defs/CodeConfig"
244
+ },
245
+ "type": "array"
246
+ },
247
+ {
248
+ "type": "null"
249
+ }
250
+ ],
251
+ "default": null,
252
+ "title": "After Model Callbacks"
253
+ },
254
+ "before_tool_callbacks": {
255
+ "anyOf": [
256
+ {
257
+ "items": {
258
+ "$ref": "#/$defs/CodeConfig"
259
+ },
260
+ "type": "array"
261
+ },
262
+ {
263
+ "type": "null"
264
+ }
265
+ ],
266
+ "default": null,
267
+ "title": "Before Tool Callbacks"
268
+ },
269
+ "after_tool_callbacks": {
270
+ "anyOf": [
271
+ {
272
+ "items": {
273
+ "$ref": "#/$defs/CodeConfig"
274
+ },
275
+ "type": "array"
276
+ },
277
+ {
278
+ "type": "null"
279
+ }
280
+ ],
281
+ "default": null,
282
+ "title": "After Tool Callbacks"
283
+ }
284
+ },
285
+ "required": [
286
+ "name",
287
+ "instruction"
288
+ ],
289
+ "title": "LlmAgentConfig",
290
+ "type": "object"
291
+ },
292
+ "LoopAgentConfig": {
293
+ "additionalProperties": false,
294
+ "description": "The config for the YAML schema of a LoopAgent.",
295
+ "properties": {
296
+ "agent_class": {
297
+ "const": "LoopAgent",
298
+ "default": "LoopAgent",
299
+ "title": "Agent Class",
300
+ "type": "string"
301
+ },
302
+ "name": {
303
+ "title": "Name",
304
+ "type": "string"
305
+ },
306
+ "description": {
307
+ "default": "",
308
+ "title": "Description",
309
+ "type": "string"
310
+ },
311
+ "sub_agents": {
312
+ "anyOf": [
313
+ {
314
+ "items": {
315
+ "$ref": "#/$defs/SubAgentConfig"
316
+ },
317
+ "type": "array"
318
+ },
319
+ {
320
+ "type": "null"
321
+ }
322
+ ],
323
+ "default": null,
324
+ "title": "Sub Agents"
325
+ },
326
+ "before_agent_callbacks": {
327
+ "anyOf": [
328
+ {
329
+ "items": {
330
+ "$ref": "#/$defs/CodeConfig"
331
+ },
332
+ "type": "array"
333
+ },
334
+ {
335
+ "type": "null"
336
+ }
337
+ ],
338
+ "default": null,
339
+ "title": "Before Agent Callbacks"
340
+ },
341
+ "after_agent_callbacks": {
342
+ "anyOf": [
343
+ {
344
+ "items": {
345
+ "$ref": "#/$defs/CodeConfig"
346
+ },
347
+ "type": "array"
348
+ },
349
+ {
350
+ "type": "null"
351
+ }
352
+ ],
353
+ "default": null,
354
+ "title": "After Agent Callbacks"
355
+ },
356
+ "max_iterations": {
357
+ "anyOf": [
358
+ {
359
+ "type": "integer"
360
+ },
361
+ {
362
+ "type": "null"
363
+ }
364
+ ],
365
+ "default": null,
366
+ "title": "Max Iterations"
367
+ }
368
+ },
369
+ "required": [
370
+ "name"
371
+ ],
372
+ "title": "LoopAgentConfig",
373
+ "type": "object"
374
+ },
375
+ "ParallelAgentConfig": {
376
+ "additionalProperties": false,
377
+ "description": "The config for the YAML schema of a ParallelAgent.",
378
+ "properties": {
379
+ "agent_class": {
380
+ "const": "ParallelAgent",
381
+ "default": "ParallelAgent",
382
+ "title": "Agent Class",
383
+ "type": "string"
384
+ },
385
+ "name": {
386
+ "title": "Name",
387
+ "type": "string"
388
+ },
389
+ "description": {
390
+ "default": "",
391
+ "title": "Description",
392
+ "type": "string"
393
+ },
394
+ "sub_agents": {
395
+ "anyOf": [
396
+ {
397
+ "items": {
398
+ "$ref": "#/$defs/SubAgentConfig"
399
+ },
400
+ "type": "array"
401
+ },
402
+ {
403
+ "type": "null"
404
+ }
405
+ ],
406
+ "default": null,
407
+ "title": "Sub Agents"
408
+ },
409
+ "before_agent_callbacks": {
410
+ "anyOf": [
411
+ {
412
+ "items": {
413
+ "$ref": "#/$defs/CodeConfig"
414
+ },
415
+ "type": "array"
416
+ },
417
+ {
418
+ "type": "null"
419
+ }
420
+ ],
421
+ "default": null,
422
+ "title": "Before Agent Callbacks"
423
+ },
424
+ "after_agent_callbacks": {
425
+ "anyOf": [
426
+ {
427
+ "items": {
428
+ "$ref": "#/$defs/CodeConfig"
429
+ },
430
+ "type": "array"
431
+ },
432
+ {
433
+ "type": "null"
434
+ }
435
+ ],
436
+ "default": null,
437
+ "title": "After Agent Callbacks"
438
+ }
439
+ },
440
+ "required": [
441
+ "name"
442
+ ],
443
+ "title": "ParallelAgentConfig",
444
+ "type": "object"
445
+ },
446
+ "SequentialAgentConfig": {
447
+ "additionalProperties": false,
448
+ "description": "The config for the YAML schema of a SequentialAgent.",
449
+ "properties": {
450
+ "agent_class": {
451
+ "const": "SequentialAgent",
452
+ "default": "SequentialAgent",
453
+ "title": "Agent Class",
454
+ "type": "string"
455
+ },
456
+ "name": {
457
+ "title": "Name",
458
+ "type": "string"
459
+ },
460
+ "description": {
461
+ "default": "",
462
+ "title": "Description",
463
+ "type": "string"
464
+ },
465
+ "sub_agents": {
466
+ "anyOf": [
467
+ {
468
+ "items": {
469
+ "$ref": "#/$defs/SubAgentConfig"
470
+ },
471
+ "type": "array"
472
+ },
473
+ {
474
+ "type": "null"
475
+ }
476
+ ],
477
+ "default": null,
478
+ "title": "Sub Agents"
479
+ },
480
+ "before_agent_callbacks": {
481
+ "anyOf": [
482
+ {
483
+ "items": {
484
+ "$ref": "#/$defs/CodeConfig"
485
+ },
486
+ "type": "array"
487
+ },
488
+ {
489
+ "type": "null"
490
+ }
491
+ ],
492
+ "default": null,
493
+ "title": "Before Agent Callbacks"
494
+ },
495
+ "after_agent_callbacks": {
496
+ "anyOf": [
497
+ {
498
+ "items": {
499
+ "$ref": "#/$defs/CodeConfig"
500
+ },
501
+ "type": "array"
502
+ },
503
+ {
504
+ "type": "null"
505
+ }
506
+ ],
507
+ "default": null,
508
+ "title": "After Agent Callbacks"
509
+ }
510
+ },
511
+ "required": [
512
+ "name"
513
+ ],
514
+ "title": "SequentialAgentConfig",
515
+ "type": "object"
516
+ },
517
+ "SubAgentConfig": {
518
+ "additionalProperties": false,
519
+ "description": "The config for a sub-agent.",
520
+ "properties": {
521
+ "config": {
522
+ "anyOf": [
523
+ {
524
+ "type": "string"
525
+ },
526
+ {
527
+ "type": "null"
528
+ }
529
+ ],
530
+ "default": null,
531
+ "title": "Config"
532
+ },
533
+ "code": {
534
+ "anyOf": [
535
+ {
536
+ "type": "string"
537
+ },
538
+ {
539
+ "type": "null"
540
+ }
541
+ ],
542
+ "default": null,
543
+ "title": "Code"
544
+ }
545
+ },
546
+ "title": "SubAgentConfig",
547
+ "type": "object"
548
+ }
549
+ },
550
+ "anyOf": [
551
+ {
552
+ "$ref": "#/$defs/LlmAgentConfig"
553
+ },
554
+ {
555
+ "$ref": "#/$defs/LoopAgentConfig"
556
+ },
557
+ {
558
+ "$ref": "#/$defs/ParallelAgentConfig"
559
+ },
560
+ {
561
+ "$ref": "#/$defs/SequentialAgentConfig"
562
+ }
563
+ ],
564
+ "description": "The config for the YAML schema to create an agent.",
565
+ "title": "AgentConfig"
566
+ }
@@ -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.
@@ -12,12 +12,15 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
+ from __future__ import annotations
16
+
15
17
  import asyncio
16
18
  from typing import Optional
17
19
 
18
20
  from google.genai import types
19
21
  from pydantic import BaseModel
20
22
  from pydantic import ConfigDict
23
+ from pydantic import field_validator
21
24
 
22
25
 
23
26
  class LiveRequest(BaseModel):
@@ -30,6 +33,10 @@ class LiveRequest(BaseModel):
30
33
  """If set, send the content to the model in turn-by-turn mode."""
31
34
  blob: Optional[types.Blob] = None
32
35
  """If set, send the blob to the model in realtime mode."""
36
+ activity_start: Optional[types.ActivityStart] = None
37
+ """If set, signal the start of user activity to the model."""
38
+ activity_end: Optional[types.ActivityEnd] = None
39
+ """If set, signal the end of user activity to the model."""
33
40
  close: bool = False
34
41
  """If set, close the queue. queue.shutdown() is only supported in Python 3.13+."""
35
42
 
@@ -58,6 +65,14 @@ class LiveRequestQueue:
58
65
  def send_realtime(self, blob: types.Blob):
59
66
  self._queue.put_nowait(LiveRequest(blob=blob))
60
67
 
68
+ def send_activity_start(self):
69
+ """Sends an activity start signal to mark the beginning of user input."""
70
+ self._queue.put_nowait(LiveRequest(activity_start=types.ActivityStart()))
71
+
72
+ def send_activity_end(self):
73
+ """Sends an activity end signal to mark the end of user input."""
74
+ self._queue.put_nowait(LiveRequest(activity_end=types.ActivityEnd()))
75
+
61
76
  def send(self, req: LiveRequest):
62
77
  self._queue.put_nowait(req)
63
78