google-cloud-agentplatform 1.165.1.dev0__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 (62) hide show
  1. agentplatform/__init__.py +72 -0
  2. agentplatform/_genai/__init__.py +43 -0
  3. agentplatform/_genai/_agent_engines_utils.py +2341 -0
  4. agentplatform/_genai/_bigquery_utils.py +49 -0
  5. agentplatform/_genai/_datasets_utils.py +344 -0
  6. agentplatform/_genai/_evals_builtin_tools.py +209 -0
  7. agentplatform/_genai/_evals_common.py +4268 -0
  8. agentplatform/_genai/_evals_constant.py +122 -0
  9. agentplatform/_genai/_evals_data_converters.py +926 -0
  10. agentplatform/_genai/_evals_metric_handlers.py +1783 -0
  11. agentplatform/_genai/_evals_metric_loaders.py +401 -0
  12. agentplatform/_genai/_evals_utils.py +1043 -0
  13. agentplatform/_genai/_evals_visualization.py +2070 -0
  14. agentplatform/_genai/_gcs_utils.py +262 -0
  15. agentplatform/_genai/_logging_utils.py +47 -0
  16. agentplatform/_genai/_memory_bank_utils.py +206 -0
  17. agentplatform/_genai/_observability_data_converter.py +186 -0
  18. agentplatform/_genai/_operations_utils.py +94 -0
  19. agentplatform/_genai/_prompt_management_utils.py +147 -0
  20. agentplatform/_genai/_prompt_optimizer_utils.py +215 -0
  21. agentplatform/_genai/_skills_utils.py +69 -0
  22. agentplatform/_genai/_transformers.py +628 -0
  23. agentplatform/_genai/a2a_task_events.py +509 -0
  24. agentplatform/_genai/a2a_tasks.py +861 -0
  25. agentplatform/_genai/agent_engines.py +3931 -0
  26. agentplatform/_genai/client.py +519 -0
  27. agentplatform/_genai/datasets.py +3045 -0
  28. agentplatform/_genai/endpoints.py +1149 -0
  29. agentplatform/_genai/evals.py +6883 -0
  30. agentplatform/_genai/example_stores.py +1445 -0
  31. agentplatform/_genai/feedback_contexts.py +700 -0
  32. agentplatform/_genai/feedback_entries.py +1644 -0
  33. agentplatform/_genai/live.py +64 -0
  34. agentplatform/_genai/live_agent_engines.py +179 -0
  35. agentplatform/_genai/memories.py +2962 -0
  36. agentplatform/_genai/memory_banks.py +1927 -0
  37. agentplatform/_genai/memory_revisions.py +465 -0
  38. agentplatform/_genai/model_garden.py +2638 -0
  39. agentplatform/_genai/prompt_optimizer.py +995 -0
  40. agentplatform/_genai/prompts.py +4515 -0
  41. agentplatform/_genai/rag.py +4961 -0
  42. agentplatform/_genai/runtime_revisions.py +1257 -0
  43. agentplatform/_genai/runtimes.py +78 -0
  44. agentplatform/_genai/sandbox_snapshots.py +1015 -0
  45. agentplatform/_genai/sandbox_templates.py +1088 -0
  46. agentplatform/_genai/sandboxes.py +1604 -0
  47. agentplatform/_genai/session_events.py +543 -0
  48. agentplatform/_genai/sessions.py +1449 -0
  49. agentplatform/_genai/skill_revisions.py +377 -0
  50. agentplatform/_genai/skills.py +1708 -0
  51. agentplatform/_genai/types/__init__.py +4695 -0
  52. agentplatform/_genai/types/agent_engines.py +16 -0
  53. agentplatform/_genai/types/common.py +32784 -0
  54. agentplatform/_genai/types/evals.py +1031 -0
  55. agentplatform/_genai/types/prompt_optimizer.py +107 -0
  56. agentplatform/_genai/types/prompts.py +107 -0
  57. agentplatform/version.py +17 -0
  58. google_cloud_agentplatform-1.165.1.dev0.dist-info/METADATA +79 -0
  59. google_cloud_agentplatform-1.165.1.dev0.dist-info/RECORD +62 -0
  60. google_cloud_agentplatform-1.165.1.dev0.dist-info/WHEEL +5 -0
  61. google_cloud_agentplatform-1.165.1.dev0.dist-info/licenses/LICENSE +202 -0
  62. google_cloud_agentplatform-1.165.1.dev0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,122 @@
1
+ # Copyright 2025 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ #
15
+ """Constants for evals module."""
16
+
17
+ SUPPORTED_PREDEFINED_METRICS = frozenset(
18
+ {
19
+ # v1 metrics (kept for backward compatibility).
20
+ "general_quality_v1",
21
+ "text_quality_v1",
22
+ "instruction_following_v1",
23
+ "grounding_v1",
24
+ "safety_v1",
25
+ "multi_turn_general_quality_v1",
26
+ "multi_turn_text_quality_v1",
27
+ "multi_turn_tool_use_quality_v1",
28
+ "multi_turn_trajectory_quality_v1",
29
+ "multi_turn_task_success_v1",
30
+ "final_response_match_v2",
31
+ "final_response_reference_free_v1",
32
+ "final_response_quality_v1",
33
+ "hallucination_v1",
34
+ "tool_use_quality_v1",
35
+ "gecko_text2image_v1",
36
+ "gecko_text2video_v1",
37
+ # v2/v3 metrics backed by Gemini 3.5 Flash.
38
+ "general_quality_v2",
39
+ "instruction_following_v2",
40
+ "text_quality_v2",
41
+ "grounding_v2",
42
+ "hallucination_v2",
43
+ "safety_v3",
44
+ "multi_turn_general_quality_v2",
45
+ "multi_turn_text_quality_v2",
46
+ "tool_use_quality_v2",
47
+ "final_response_quality_v2",
48
+ "final_response_match_v3",
49
+ "final_response_reference_free_v2",
50
+ "gecko_text2image_v2",
51
+ "gecko_text2video_v2",
52
+ }
53
+ )
54
+
55
+ # Maps the SDK-facing base metric name to the latest API spec name.
56
+ # When a user creates a metric without specifying a version, this resolves to
57
+ # the latest available version (backed by Gemini 3.5 Flash).
58
+ # Note: v2/v3 specs require Gemini 3.5 Flash, which is not available in all
59
+ # regions (e.g. us-central1). To use v1 explicitly for full regional
60
+ # availability:
61
+ # types.RubricMetric.GENERAL_QUALITY(version="v1")
62
+ METRIC_LATEST_SPEC_NAME: dict[str, str] = {
63
+ "general_quality": "general_quality_v2",
64
+ "instruction_following": "instruction_following_v2",
65
+ "text_quality": "text_quality_v2",
66
+ "grounding": "grounding_v2",
67
+ "hallucination": "hallucination_v2",
68
+ "safety": "safety_v3",
69
+ "multi_turn_general_quality": "multi_turn_general_quality_v2",
70
+ "multi_turn_text_quality": "multi_turn_text_quality_v2",
71
+ "tool_use_quality": "tool_use_quality_v2",
72
+ "final_response_quality": "final_response_quality_v2",
73
+ "final_response_match": "final_response_match_v3",
74
+ "final_response_reference_free": "final_response_reference_free_v2",
75
+ "gecko_text2image": "gecko_text2image_v2",
76
+ "gecko_text2video": "gecko_text2video_v2",
77
+ }
78
+
79
+ SUPPORTED_VERTEX_MAAS_MODEL_PREFIXES = frozenset(
80
+ {
81
+ "meta/", # Meta/Llama
82
+ "deepseek-ai/", # DeepSeek AI
83
+ "qwen/", # Qwen
84
+ "openai/", # OpenAI (GPT-OSS)
85
+ "claude-", # Anthropic (Claude)
86
+ "mistral-", # Mistral AI
87
+ "jamba-", # AI21 (Jamba)
88
+ }
89
+ )
90
+ INTERMEDIATE_EVENTS = "intermediate_events"
91
+ RESPONSE = "response"
92
+ PROMPT = "prompt"
93
+ REFERENCE = "reference"
94
+ SESSION_INPUT = "session_inputs"
95
+ CONTEXT = "context"
96
+ CONTENT = "content"
97
+ PARTS = "parts"
98
+ USER_AUTHOR = "user"
99
+ MODEL_AUTHOR = "model"
100
+ AGENT_DATA = "agent_data"
101
+ INTERACTION_ID = "interaction_id"
102
+ STARTING_PROMPT = "starting_prompt"
103
+ CONVERSATION_PLAN = "conversation_plan"
104
+ HISTORY = "history"
105
+ CONVERSATION_HISTORY = "conversation_history"
106
+ DEFAULT_CANDIDATE_NAME = "candidate-1"
107
+
108
+ COMMON_DATASET_COLUMNS = frozenset(
109
+ {
110
+ INTERMEDIATE_EVENTS,
111
+ PROMPT,
112
+ REFERENCE,
113
+ SESSION_INPUT,
114
+ CONTEXT,
115
+ HISTORY,
116
+ CONVERSATION_HISTORY,
117
+ STARTING_PROMPT,
118
+ CONVERSATION_PLAN,
119
+ AGENT_DATA,
120
+ INTERACTION_ID,
121
+ }
122
+ )