- 1.122.0 (latest)
- 1.121.0
- 1.120.0
- 1.119.0
- 1.118.0
- 1.117.0
- 1.95.1
- 1.94.0
- 1.93.1
- 1.92.0
- 1.91.0
- 1.90.0
- 1.89.0
- 1.88.0
- 1.87.0
- 1.86.0
- 1.85.0
- 1.84.0
- 1.83.0
- 1.82.0
- 1.81.0
- 1.80.0
- 1.79.0
- 1.78.0
- 1.77.0
- 1.76.0
- 1.75.0
- 1.74.0
- 1.73.0
- 1.72.0
- 1.71.1
- 1.70.0
- 1.69.0
- 1.68.0
- 1.67.1
- 1.66.0
- 1.65.0
- 1.63.0
- 1.62.0
- 1.60.0
- 1.59.0
AsyncPrompts
(
api_client_
:
google
.
genai
.
_api_client
.
BaseApiClient
)
API documentation for AsyncPrompts
class.
Methods
create
create
(
*
,
prompt
:
typing
.
Union
[
vertexai
.
_genai
.
types
.
Prompt
,
vertexai
.
_genai
.
types
.
PromptDict
],
config
:
typing
.
Optional
[
typing
.
Union
[
vertexai
.
_genai
.
types
.
CreatePromptConfig
,
vertexai
.
_genai
.
types
.
CreatePromptConfigDict
,
]
]
=
None
)
-
> vertexai
.
_genai
.
types
.
Prompt
Creates a new prompt in a Vertex Dataset resource.
This method waits for prompt creation to be complete before returning.
create_version
create_version
(
*
,
prompt_id
:
str
,
prompt
:
typing
.
Union
[
vertexai
.
_genai
.
types
.
Prompt
,
vertexai
.
_genai
.
types
.
PromptDict
],
config
:
typing
.
Optional
[
typing
.
Union
[
vertexai
.
_genai
.
types
.
CreatePromptVersionConfig
,
vertexai
.
_genai
.
types
.
CreatePromptVersionConfigDict
,
]
]
=
None
)
-
> vertexai
.
_genai
.
types
.
Prompt
Creates a new version of a prompt in the prompt resource associated with the provided prompt_id.
When creating new prompt version resources, this waits for the create operation to complete before returning.
delete
delete
(
*
,
prompt_id
:
str
,
config
:
typing
.
Optional
[
vertexai
.
_genai
.
types
.
DeletePromptConfig
]
=
None
)
-
> None
Deletes a prompt resource.
TimeoutError
ValueError
delete_version
delete_version
(
*
,
prompt_id
:
str
,
version_id
:
str
,
config
:
typing
.
Optional
[
vertexai
.
_genai
.
types
.
DeletePromptConfig
]
=
None
)
-
> None
Deletes a prompt version resource.
TimeoutError
ValueError
get
get
(
*
,
prompt_id
:
str
,
config
:
typing
.
Optional
[
vertexai
.
_genai
.
types
.
GetPromptConfig
]
=
None
)
-
> vertexai
.
_genai
.
types
.
Prompt
Gets a prompt resource from a Vertex Dataset.
get_version
get_version
(
*
,
prompt_id
:
str
,
version_id
:
str
,
config
:
typing
.
Optional
[
vertexai
.
_genai
.
types
.
GetPromptConfig
]
=
None
)
-
> vertexai
.
_genai
.
types
.
Prompt
Gets a prompt resource from a Vertex Dataset.
list
list
(
*
,
config
:
typing
.
Optional
[
typing
.
Union
[
vertexai
.
_genai
.
types
.
ListPromptsConfig
,
vertexai
.
_genai
.
types
.
ListPromptsConfigDict
,
]
]
=
None
)
-
> typing
.
AsyncIterator
[
vertexai
.
_genai
.
types
.
PromptRef
]
Lists prompt resources in a project.
This method retrieves all the prompts from the project provided in the vertexai.Client constructor and returns a list of prompt references containing the prompt_id and model for the prompt.
To get the full types.Prompt resource for a PromptRef after calling this method, use the get() method with the prompt_id as the prompt_id argument. Example usage:
prompt_refs = client.aio.prompt_management.list_prompts()
async for prompt_ref in prompt_refs:
await client.prompt_management.get(prompt_id=prompt_ref.prompt_id)
list_versions
list_versions
(
*
,
prompt_id
:
str
,
config
:
typing
.
Optional
[
typing
.
Union
[
vertexai
.
_genai
.
types
.
ListPromptsConfig
,
vertexai
.
_genai
.
types
.
ListPromptsConfigDict
,
]
]
=
None
)
-
> typing
.
AsyncIterator
[
vertexai
.
_genai
.
types
.
PromptVersionRef
]
Lists prompt version resources for a provided prompt_id.
This method retrieves all the prompt versions for a provided prompt_id.
To get the full types.Prompt resource for a PromptVersionRef after calling this method, use the get() method with the returned prompt_id and version_id. Example usage:
prompt_version_refs = await client.prompt_management.list_versions(prompt_id="123")
async for version_ref in prompt_version_refs:
await client.aio.prompt_management.get(prompt_id=version_ref.prompt_id, version_id=version_ref.version_id)
restore_version
restore_version
(
*
,
prompt_id
:
str
,
version_id
:
str
,
config
:
typing
.
Optional
[
vertexai
.
_genai
.
types
.
RestoreVersionConfig
]
=
None
)
-
> vertexai
.
_genai
.
types
.
Prompt
Restores the provided prompt version to the latest version.

