@@ -173,19 +173,19 @@ You can also run queries against the deployed agent:
173173 Prompt optimization
174174^^^^^^^^^^^^^^^^^^^
175175
176- To do a zero-shot prompt optimization, use the `optimize_prompt `
176+ To do a zero-shot prompt optimization, use the `optimize `
177177method.
178178
179179.. code-block :: Python
180180
181181 prompt = " Generate system instructions for a question-answering assistant"
182- response = client.prompt_optimizer.optimize_prompt (prompt = prompt)
182+ response = client.prompts.optimize (prompt = prompt)
183183 print (response.raw_text_response)
184184 if response.parsed_response:
185185 print (response.parsed_response.suggested_prompt)
186186
187- To call the data-driven prompt optimization, call the `optimize ` method.
188- In this case however, we need to provide ` vapo_config ` . This config needs to
187+ To call the data-driven prompt optimization, call the `launch_optimization_job ` method.
188+ In this case however, we need to provide a VAPO (Vertex AI Prompt Optimizer) config . This config needs to
189189have either service account or project **number ** and the config path.
190190Please refer to this [tutorial](https://cloud.google.com/vertex-ai/generative-ai/docs/learn/prompts/data-driven-optimizer)
191191for more details on config parameter.
@@ -206,7 +206,7 @@ for more details on config parameter.
206206 # Set up logging to see the progress of the optimization job
207207 logging.basicConfig(encoding = ' utf-8' , level = logging.INFO , force = True )
208208
209- result = client.prompt_optimizer.optimize (method = " vapo " , config = vapo_config)
209+ result = client.prompts.launch_optimization_job (method = types.PromptOptimizerMethod. VAPO , config = vapo_config)
210210
211211 If you want to use the project number instead of the service account, you can
212212instead use the following config:
@@ -219,11 +219,11 @@ instead use the following config:
219219 wait_for_completion = False
220220 )
221221
222- We can also call optimize method async .
222+ We can also call the ` launch_optimization_job ` method asynchronously .
223223
224224.. code-block :: Python
225225
226- await client.aio.prompt_optimizer.optimize (method = " vapo " , config = vapo_config)
226+ await client.aio.prompts.launch_optimization_job (method = types.PromptOptimizerMethod. VAPO , config = vapo_config)
227227
228228 Prompt Management
229229^^^^^^^^^^^^^^^^^
0 commit comments