Skip to content

Commit 8a6b968

Browse files
authored
feat: upload placeholder colab for agent eval (#2435)
1 parent c6063ff commit 8a6b968

File tree

2 files changed

+294
-0
lines changed

2 files changed

+294
-0
lines changed
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {
7+
"id": "9ZUGfIJwT-H2"
8+
},
9+
"outputs": [],
10+
"source": [
11+
"# Copyright 2025 Google LLC\n",
12+
"#\n",
13+
"# Licensed under the Apache License, Version 2.0 (the \"License\");\n",
14+
"\n",
15+
"# you may not use this file except in compliance with the License.\n",
16+
"# You may obtain a copy of the License at\n",
17+
"#\n",
18+
"# https://www.apache.org/licenses/LICENSE-2.0\n",
19+
"#\n",
20+
"# Unless required by applicable law or agreed to in writing, software\n",
21+
"# distributed under the License is distributed on an \"AS IS\" BASIS,\n",
22+
"# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n",
23+
"# See the License for the specific language governing permissions and\n",
24+
"# limitations under the License."
25+
]
26+
},
27+
{
28+
"cell_type": "markdown",
29+
"metadata": {
30+
"id": "NulM87jyTWJG"
31+
},
32+
"source": [
33+
"# Placeholder of Gen AI Agent Eval SDK (Colab 1 for UI)"
34+
]
35+
},
36+
{
37+
"cell_type": "markdown",
38+
"source": [
39+
"**Goals:**\n",
40+
"\n",
41+
"This Colab notebook demonstrates how to use the Gen AI Eval SDK to evaluate your agents. It covers one primary use cases:\n",
42+
"\n",
43+
"1. Run Agent + Create Evaluatuation Run: The SDK will first run the agent and then create evaluation run to perform the evaluation."
44+
],
45+
"metadata": {
46+
"id": "NWiijMdFxAon"
47+
}
48+
},
49+
{
50+
"cell_type": "markdown",
51+
"metadata": {
52+
"id": "JTK2Y3bRUMce"
53+
},
54+
"source": [
55+
"# Set up"
56+
]
57+
},
58+
{
59+
"cell_type": "markdown",
60+
"source": [
61+
"## Authenticate"
62+
],
63+
"metadata": {
64+
"id": "mqNKLziY0mr3"
65+
}
66+
},
67+
{
68+
"cell_type": "code",
69+
"execution_count": null,
70+
"metadata": {
71+
"id": "nax0k_afTVKc"
72+
},
73+
"outputs": [],
74+
"source": [
75+
"from google.colab import auth\n",
76+
"auth.authenticate_user()"
77+
]
78+
},
79+
{
80+
"cell_type": "markdown",
81+
"metadata": {
82+
"id": "f4_NugC0UFCU"
83+
},
84+
"source": [
85+
"## Install Vertex AI SDK for Gen AI Evaluation Service"
86+
]
87+
},
88+
{
89+
"cell_type": "code",
90+
"source": [
91+
"%pip install --upgrade --force-reinstall -q google-cloud-aiplatform[evaluation]"
92+
],
93+
"metadata": {
94+
"id": "lWaDe8WN0sKm"
95+
},
96+
"execution_count": null,
97+
"outputs": []
98+
},
99+
{
100+
"cell_type": "markdown",
101+
"source": [
102+
"## Initialize Variables"
103+
],
104+
"metadata": {
105+
"id": "a1r_ha0J69yQ"
106+
}
107+
},
108+
{
109+
"cell_type": "code",
110+
"execution_count": null,
111+
"metadata": {
112+
"id": "r8-HbNKnUQD3"
113+
},
114+
"outputs": [],
115+
"source": [
116+
"import vertexai\n",
117+
"import pandas as pd\n",
118+
"from vertexai.preview import reasoning_engines\n",
119+
"from vertexai import agent_engines\n",
120+
"import os\n",
121+
"\n",
122+
"PROJECT_ID = \"\" # @param {type: \"string\", placeholder: \"[your-project-id]\", isTemplate: true}\n",
123+
"if not PROJECT_ID or PROJECT_ID == \"[your-project-id]\":\n",
124+
" PROJECT_ID = str(os.environ.get(\"GOOGLE_CLOUD_PROJECT\"))\n",
125+
"LOCATION= \"\" # @param {type: \"string\", placeholder: \"us-central1\", isTemplate: true}\n",
126+
"LOCATION = os.environ.get(\"GOOGLE_CLOUD_REGION\", LOCATION)\n",
127+
"# e.g. gs://my-bucket/my-folder\n",
128+
"GCS_DEST = \"\" # @param {type: \"string\", placeholder: \"[your-gcs-bucket]\", isTemplate: true}\n",
129+
"# e.g. projects/977012026409/locations/us-central1/reasoningEngines/7188347537655332864\n",
130+
"AGENT = \"\" # @param {type: \"string\", placeholder: \"[your-agent]\", isTemplate: true}\n",
131+
"\n",
132+
"\n",
133+
"from vertexai import Client, types\n",
134+
"from google.genai import types as genai_types\n",
135+
"\n",
136+
"vertexai.init(project=PROJECT_ID, location=LOCATION)\n",
137+
"client = Client(project=PROJECT_ID, location=LOCATION)"
138+
]
139+
}
140+
],
141+
"metadata": {
142+
"colab": {
143+
"provenance": [],
144+
"toc_visible": true
145+
},
146+
"kernelspec": {
147+
"display_name": "Python 3",
148+
"name": "python3"
149+
},
150+
"language_info": {
151+
"name": "python"
152+
}
153+
},
154+
"nbformat": 4,
155+
"nbformat_minor": 0
156+
}
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {
7+
"id": "9ZUGfIJwT-H2"
8+
},
9+
"outputs": [],
10+
"source": [
11+
"# Copyright 2025 Google LLC\n",
12+
"#\n",
13+
"# Licensed under the Apache License, Version 2.0 (the \"License\");\n",
14+
"\n",
15+
"# you may not use this file except in compliance with the License.\n",
16+
"# You may obtain a copy of the License at\n",
17+
"#\n",
18+
"# https://www.apache.org/licenses/LICENSE-2.0\n",
19+
"#\n",
20+
"# Unless required by applicable law or agreed to in writing, software\n",
21+
"# distributed under the License is distributed on an \"AS IS\" BASIS,\n",
22+
"# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n",
23+
"# See the License for the specific language governing permissions and\n",
24+
"# limitations under the License."
25+
]
26+
},
27+
{
28+
"cell_type": "markdown",
29+
"metadata": {
30+
"id": "NulM87jyTWJG"
31+
},
32+
"source": [
33+
"# Placeholder of Gen AI Agent Eval SDK (Colab 2 for UI)"
34+
]
35+
},
36+
{
37+
"cell_type": "markdown",
38+
"metadata": {
39+
"id": "JTK2Y3bRUMce"
40+
},
41+
"source": [
42+
"# Set up"
43+
]
44+
},
45+
{
46+
"cell_type": "markdown",
47+
"source": [
48+
"## Authenticate"
49+
],
50+
"metadata": {
51+
"id": "mqNKLziY0mr3"
52+
}
53+
},
54+
{
55+
"cell_type": "code",
56+
"execution_count": null,
57+
"metadata": {
58+
"id": "nax0k_afTVKc"
59+
},
60+
"outputs": [],
61+
"source": [
62+
"from google.colab import auth\n",
63+
"auth.authenticate_user()"
64+
]
65+
},
66+
{
67+
"cell_type": "markdown",
68+
"metadata": {
69+
"id": "f4_NugC0UFCU"
70+
},
71+
"source": [
72+
"## Install Vertex AI SDK for Gen AI Evaluation Service"
73+
]
74+
},
75+
{
76+
"cell_type": "code",
77+
"source": [
78+
"%pip install --upgrade --force-reinstall -q google-cloud-aiplatform[evaluation]"
79+
],
80+
"metadata": {
81+
"id": "lWaDe8WN0sKm"
82+
},
83+
"execution_count": null,
84+
"outputs": []
85+
},
86+
{
87+
"cell_type": "markdown",
88+
"source": [
89+
"## Initialize Variables"
90+
],
91+
"metadata": {
92+
"id": "a1r_ha0J69yQ"
93+
}
94+
},
95+
{
96+
"cell_type": "code",
97+
"execution_count": null,
98+
"metadata": {
99+
"id": "r8-HbNKnUQD3"
100+
},
101+
"outputs": [],
102+
"source": [
103+
"import vertexai\n",
104+
"import pandas as pd\n",
105+
"from vertexai.preview import reasoning_engines\n",
106+
"from vertexai import agent_engines\n",
107+
"import os\n",
108+
"\n",
109+
"PROJECT_ID = \"\" # @param {type: \"string\", placeholder: \"[your-project-id]\", isTemplate: true}\n",
110+
"if not PROJECT_ID or PROJECT_ID == \"[your-project-id]\":\n",
111+
" PROJECT_ID = str(os.environ.get(\"GOOGLE_CLOUD_PROJECT\"))\n",
112+
"LOCATION= \"\" # @param {type: \"string\", placeholder: \"us-central1\", isTemplate: true}\n",
113+
"LOCATION = os.environ.get(\"GOOGLE_CLOUD_REGION\", LOCATION)\n",
114+
"EVAL_RUN_ID= \"\" # @param {type: \"string\", placeholder: \"[your-eval-run-id]\", isTemplate: true}\n",
115+
"\n",
116+
"\n",
117+
"from vertexai import Client, types\n",
118+
"\n",
119+
"vertexai.init(project=PROJECT_ID, location=LOCATION)\n",
120+
"client = Client(project=PROJECT_ID, location=LOCATION)"
121+
]
122+
}
123+
],
124+
"metadata": {
125+
"colab": {
126+
"provenance": []
127+
},
128+
"kernelspec": {
129+
"display_name": "Python 3",
130+
"name": "python3"
131+
},
132+
"language_info": {
133+
"name": "python"
134+
}
135+
},
136+
"nbformat": 4,
137+
"nbformat_minor": 0
138+
}

0 commit comments

Comments
 (0)