You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For Gemini API and Generative AI on Vertex AI, please reference `Vertex Generative AI SDK for Python`_
9
+
.. _Vertex Generative AI SDK for Python: https://cloud.google.com/vertex-ai/generative-ai/docs/reference/python/latest
6
10
7
11
`Vertex AI`_: Google Vertex AI is an integrated suite of machine learning tools and services for building and using ML models with AutoML or custom code. It offers both novices and experts the best workbench for the entire machine learning development lifecycle.
8
12
@@ -113,18 +117,6 @@ Vertex AI SDK resource based functionality can be used by importing the followin
113
117
114
118
from google.cloud import aiplatform
115
119
116
-
Vertex AI SDK preview functionality can be used by importing the following namespace:
117
-
118
-
.. code-block:: Python
119
-
120
-
from vertexai import preview
121
-
122
-
Vertex AI SDK general availability (GA) functionality can be used by importing the following namespace:
123
-
124
-
.. code-block:: Python
125
-
126
-
import vertexai
127
-
128
120
Initialization
129
121
^^^^^^^^^^^^^^
130
122
Initialize the SDK to store common configurations that you use with the SDK.
For Gemini API and Generative AI on Vertex AI, please reference `Vertex Generative AI SDK for Python`_
9
+
.. _Vertex Generative AI SDK for Python: https://cloud.google.com/vertex-ai/generative-ai/docs/reference/python/latest
5
10
6
11
`Vertex AI`_: Google Vertex AI is an integrated suite of machine learning tools and services for building and using ML models with AutoML or custom code. It offers both novices and experts the best workbench for the entire machine learning development lifecycle.
from vertexai.preview.generative_models import GenerativeModel, Tool, FunctionDeclaration, AutomaticFunctionCallingResponder
137
142
138
143
# First, create functions that the model can use to answer your questions.
@@ -179,7 +184,7 @@ print(chat.send_message("What is the weather like in Boston?"))
179
184
180
185
- To perform bring-your-own-response(BYOR) evaluation, provide the model responses in the `response` column in the dataset. If a pairwise metric is used for BYOR evaluation, provide the baseline model responses in the `baseline_model_response` column.
181
186
182
-
```
187
+
```python
183
188
import pandas as pd
184
189
from vertexai.evaluation import EvalTask, MetricPromptTemplateExamples
- To perform evaluation with Gemini model inference, specify the `model` parameter with a `GenerativeModel` instance. The input column name to the model is `prompt` and must be present in the dataset.
205
210
206
-
```
211
+
```python
207
212
from vertexai.evaluation import EvalTask
208
213
from vertexai.generative_models import GenerativeModel
209
214
@@ -223,7 +228,7 @@ result = EvalTask(
223
228
224
229
- If a `prompt_template` is specified, the `prompt` column is not required. Prompts can be assembled from the evaluation dataset, and all prompt template variable names must be present in the dataset columns.
225
230
226
-
```
231
+
```python
227
232
import pandas as pd
228
233
from vertexai.evaluation import EvalTask, MetricPromptTemplateExamples
229
234
from vertexai.generative_models import GenerativeModel
@@ -245,7 +250,7 @@ result = EvalTask(
245
250
parameter with a custom inference function. The input column name to the
246
251
custom inference function is `prompt` and must be present in the dataset.
247
252
248
-
```
253
+
```python
249
254
from openai import OpenAI
250
255
from vertexai.evaluation import EvalTask, MetricPromptTemplateExamples
251
256
@@ -279,7 +284,7 @@ the `baseline_model` input to a `PairwiseMetric` instance and the candidate
279
284
`model` input to the `EvalTask.evaluate()` function. The input column name
280
285
to both models is `prompt` and must be present in the dataset.
281
286
282
-
```
287
+
```python
283
288
import pandas as pd
284
289
from vertexai.evaluation import EvalTask, MetricPromptTemplateExamples, PairwiseMetric
285
290
from vertexai.generative_models import GenerativeModel
0 commit comments