google-cloud-agentplatform 2.1.3__tar.gz → 2.3.0__tar.gz

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 (74) hide show
  1. {google_cloud_agentplatform-2.1.3/google_cloud_agentplatform.egg-info → google_cloud_agentplatform-2.3.0}/PKG-INFO +1 -1
  2. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/__init__.py +11 -2
  3. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/_evals_common.py +20 -2
  4. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/client.py +26 -0
  5. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/evals.py +14 -0
  6. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/memory_banks.py +7 -0
  7. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/runtimes.py +7 -0
  8. google_cloud_agentplatform-2.3.0/agentplatform/_genai/serving_profiles.py +1251 -0
  9. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/types/__init__.py +86 -0
  10. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/types/common.py +627 -27
  11. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/version.py +1 -1
  12. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0/google_cloud_agentplatform.egg-info}/PKG-INFO +1 -1
  13. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/google_cloud_agentplatform.egg-info/SOURCES.txt +1 -0
  14. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/LICENSE +0 -0
  15. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/README.md +0 -0
  16. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/__init__.py +0 -0
  17. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/_bigquery_utils.py +0 -0
  18. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/_datasets_utils.py +0 -0
  19. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/_evals_builtin_tools.py +0 -0
  20. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/_evals_constant.py +0 -0
  21. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/_evals_data_converters.py +0 -0
  22. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/_evals_metric_handlers.py +0 -0
  23. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/_evals_metric_loaders.py +0 -0
  24. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/_evals_utils.py +0 -0
  25. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/_evals_visualization.py +0 -0
  26. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/_gcs_utils.py +0 -0
  27. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/_logging_utils.py +0 -0
  28. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/_memory_bank_utils.py +0 -0
  29. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/_observability_data_converter.py +0 -0
  30. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/_operations_utils.py +0 -0
  31. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/_prompt_management_utils.py +0 -0
  32. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/_prompt_optimizer_utils.py +0 -0
  33. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/_runtimes_utils.py +0 -0
  34. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/_skills_utils.py +0 -0
  35. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/_transformers.py +0 -0
  36. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/a2a_task_events.py +0 -0
  37. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/a2a_tasks.py +0 -0
  38. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/datasets.py +0 -0
  39. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/endpoints.py +0 -0
  40. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/example_stores.py +0 -0
  41. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/feedback_contexts.py +0 -0
  42. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/feedback_entries.py +0 -0
  43. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/live.py +0 -0
  44. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/live_runtimes.py +0 -0
  45. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/memories.py +0 -0
  46. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/memory_revisions.py +0 -0
  47. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/model_garden.py +0 -0
  48. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/prompt_optimizer.py +0 -0
  49. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/prompts.py +0 -0
  50. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/rag.py +0 -0
  51. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/runtime_revisions.py +0 -0
  52. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/sandbox_snapshots.py +0 -0
  53. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/sandbox_templates.py +0 -0
  54. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/sandboxes.py +0 -0
  55. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/session_events.py +0 -0
  56. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/sessions.py +0 -0
  57. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/skill_revisions.py +0 -0
  58. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/skills.py +0 -0
  59. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/types/agent_engines.py +0 -0
  60. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/types/evals.py +0 -0
  61. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/types/prompt_optimizer.py +0 -0
  62. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/_genai/types/prompts.py +0 -0
  63. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/frameworks/__init__.py +0 -0
  64. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/frameworks/a2a.py +0 -0
  65. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/frameworks/adk.py +0 -0
  66. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/frameworks/ag2.py +0 -0
  67. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/frameworks/langchain.py +0 -0
  68. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/frameworks/langgraph.py +0 -0
  69. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/agentplatform/frameworks/llama_index.py +0 -0
  70. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/google_cloud_agentplatform.egg-info/dependency_links.txt +0 -0
  71. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/google_cloud_agentplatform.egg-info/requires.txt +0 -0
  72. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/google_cloud_agentplatform.egg-info/top_level.txt +0 -0
  73. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/pyproject.toml +0 -0
  74. {google_cloud_agentplatform-2.1.3 → google_cloud_agentplatform-2.3.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: google-cloud-agentplatform
3
- Version: 2.1.3
3
+ Version: 2.3.0
4
4
  Summary: Google Cloud Agent Platform Client Library
5
5
  Author-email: Google LLC <googleapis-packages@google.com>
6
6
  License: Apache-2.0
@@ -54,8 +54,17 @@ def __getattr__(name): # type: ignore[no-untyped-def]
54
54
  global _genai_types
55
55
  if _genai_types is None:
56
56
  _genai_types = importlib.import_module("._genai.types", __name__)
57
- if "vertexai.types" not in sys.modules:
58
- sys.modules["vertexai.types"] = _genai_types
57
+ # `types` is an alias for `._genai.types` rather than a real submodule,
58
+ # so register it to keep
59
+ # `from agentplatform.types import TypeName`
60
+ # working without a prior attribute access. Spell it the google3 way:
61
+ # Copybara rewrites that prefix in both directions, and the external
62
+ # spelling fails its reversibility check. This key was `vertexai.types`,
63
+ # which both misnamed this package's own alias and shadowed the real
64
+ # `vertexai.types` module.
65
+ types_module_name = f"{__name__}.types"
66
+ if types_module_name not in sys.modules:
67
+ sys.modules[types_module_name] = _genai_types
59
68
  return _genai_types
60
69
 
61
70
  raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
@@ -37,6 +37,11 @@ from google.genai._gaos.types.interactions import functioncallstep
37
37
  from google.genai._gaos.types.interactions import functionresultstep
38
38
  from google.genai._gaos.types.interactions import modeloutputstep
39
39
  from google.genai._gaos.types.interactions import userinputstep
40
+
41
+ try:
42
+ from google.genai._gaos.utils.serializers import ALLOW_UNKNOWN_UNION_VARIANTS
43
+ except (ImportError, AttributeError):
44
+ ALLOW_UNKNOWN_UNION_VARIANTS = "speakeasy_allow_unknown_union_variants"
40
45
  from google.genai.models import Models
41
46
  import pandas as pd
42
47
  from tqdm import tqdm
@@ -775,7 +780,16 @@ def _interaction_dict_to_agent_data(
775
780
  Returns:
776
781
  An AgentData object with one or more ConversationTurns.
777
782
  """
778
- typed_interaction = interaction_types.Interaction.model_validate(interaction)
783
+ # A server response, so unknown step types must degrade rather than raise.
784
+ # `Step` is an open discriminated union: parse_open_union only falls back to
785
+ # the Unknown variant when the validation context carries
786
+ # ALLOW_UNKNOWN_UNION_VARIANTS, and raises without it so that a
787
+ # user-constructed request payload surfaces its mistakes locally. This
788
+ # payload comes off the Interactions API, so it is on the tolerant side of
789
+ # that line. _interaction_steps_to_events already drops steps it cannot map.
790
+ typed_interaction = interaction_types.Interaction.model_validate(
791
+ interaction, context={ALLOW_UNKNOWN_UNION_VARIANTS: True}
792
+ )
779
793
  all_events = _interaction_steps_to_events(typed_interaction.steps or [])
780
794
 
781
795
  # Group events into turns. Each UserInputStep starts a new turn.
@@ -1689,8 +1703,12 @@ def _resolve_interactions_to_eval_cases(
1689
1703
  break
1690
1704
  interaction_dict = json.loads(response.body)
1691
1705
  try:
1706
+ # Also a server response -- see _interaction_dict_to_agent_data.
1707
+ # Without the context a single step type this client does not
1708
+ # know about raised, and the except below turned that into a
1709
+ # `break`, silently truncating the interaction history.
1692
1710
  typed_interaction = interaction_types.Interaction.model_validate(
1693
- interaction_dict
1711
+ interaction_dict, context={ALLOW_UNKNOWN_UNION_VARIANTS: True}
1694
1712
  )
1695
1713
  except Exception as e:
1696
1714
  logger.warning("Failed to validate interaction model: %s", e)
@@ -62,6 +62,10 @@ if TYPE_CHECKING:
62
62
  from agentplatform._genai import (
63
63
  memory_banks as memory_banks_module,
64
64
  )
65
+ from agentplatform._genai import (
66
+ serving_profiles as serving_profiles_module,
67
+ )
68
+
65
69
 
66
70
  _GENAI_MODULES_TELEMETRY_HEADER = "vertex-genai-modules"
67
71
 
@@ -112,6 +116,7 @@ class AsyncClient:
112
116
  self._sessions: Optional[ModuleType] = None
113
117
  self._sandboxes: Optional[ModuleType] = None
114
118
  self._memory_banks: Optional[ModuleType] = None
119
+ self._serving_profiles: Optional[ModuleType] = None
115
120
 
116
121
  @property
117
122
  @_common.experimental_warning(
@@ -287,6 +292,17 @@ class AsyncClient:
287
292
  self._memory_banks = importlib.import_module(".memory_banks", __package__)
288
293
  return self._memory_banks.AsyncMemoryBanks(self._api_client) # type: ignore[no-any-return]
289
294
 
295
+ @property
296
+ def serving_profiles(
297
+ self,
298
+ ) -> "serving_profiles_module.AsyncServingProfiles":
299
+ if self._serving_profiles is None:
300
+ self._serving_profiles = importlib.import_module(
301
+ ".serving_profiles",
302
+ __package__,
303
+ )
304
+ return self._serving_profiles.AsyncServingProfiles(self._api_client) # type: ignore[no-any-return]
305
+
290
306
  async def aclose(self) -> None:
291
307
  """Closes the async client explicitly.
292
308
 
@@ -399,6 +415,7 @@ class Client:
399
415
  self._sessions: Optional[ModuleType] = None
400
416
  self._sandboxes: Optional[ModuleType] = None
401
417
  self._memory_banks: Optional[ModuleType] = None
418
+ self._serving_profiles: Optional[ModuleType] = None
402
419
 
403
420
  @property
404
421
  def evals(self) -> "evals_module.Evals":
@@ -598,3 +615,12 @@ class Client:
598
615
  if self._memory_banks is None:
599
616
  self._memory_banks = importlib.import_module(".memory_banks", __package__)
600
617
  return self._memory_banks.MemoryBanks(self._api_client) # type: ignore[no-any-return]
618
+
619
+ @property
620
+ def serving_profiles(self) -> "serving_profiles_module.ServingProfiles":
621
+ if self._serving_profiles is None:
622
+ self._serving_profiles = importlib.import_module(
623
+ ".serving_profiles",
624
+ __package__,
625
+ )
626
+ return self._serving_profiles.ServingProfiles(self._api_client) # type: ignore[no-any-return]
@@ -215,6 +215,13 @@ def _CustomCodeExecutionSpec_from_vertex(
215
215
  getv(from_object, ["evaluation_function"]),
216
216
  )
217
217
 
218
+ if getv(from_object, ["codeExecutionRegion"]) is not None:
219
+ setv(
220
+ to_object,
221
+ ["code_execution_region"],
222
+ getv(from_object, ["codeExecutionRegion"]),
223
+ )
224
+
218
225
  return to_object
219
226
 
220
227
 
@@ -237,6 +244,13 @@ def _CustomCodeExecutionSpec_to_vertex(
237
244
  getv(from_object, ["remote_custom_function"]),
238
245
  )
239
246
 
247
+ if getv(from_object, ["code_execution_region"]) is not None:
248
+ setv(
249
+ to_object,
250
+ ["codeExecutionRegion"],
251
+ getv(from_object, ["code_execution_region"]),
252
+ )
253
+
240
254
  return to_object
241
255
 
242
256
 
@@ -504,6 +504,13 @@ def _ReasoningEngine_from_vertex(
504
504
  if getv(from_object, ["trafficConfig"]) is not None:
505
505
  setv(to_object, ["traffic_config"], getv(from_object, ["trafficConfig"]))
506
506
 
507
+ if getv(from_object, ["revisionGarbageCollectionStrategy"]) is not None:
508
+ setv(
509
+ to_object,
510
+ ["revision_garbage_collection_strategy"],
511
+ getv(from_object, ["revisionGarbageCollectionStrategy"]),
512
+ )
513
+
507
514
  return to_object
508
515
 
509
516
 
@@ -484,6 +484,13 @@ def _ReasoningEngine_from_vertex(
484
484
  if getv(from_object, ["trafficConfig"]) is not None:
485
485
  setv(to_object, ["traffic_config"], getv(from_object, ["trafficConfig"]))
486
486
 
487
+ if getv(from_object, ["revisionGarbageCollectionStrategy"]) is not None:
488
+ setv(
489
+ to_object,
490
+ ["revision_garbage_collection_strategy"],
491
+ getv(from_object, ["revisionGarbageCollectionStrategy"]),
492
+ )
493
+
487
494
  return to_object
488
495
 
489
496