Module _prompt_management (1.75.0)

API documentation for _prompt_management module.

Classes

Arguments

Arguments(
    variables: dict[str, list[vertexai.generative_models._generative_models.Part]]
)

Arguments. Child of Execution.

Execution

Execution(
    arguments: dict[str, list[vertexai.generative_models._generative_models.Part]]
)

Execution. Child of MultimodalPrompt.

MultimodalPrompt

MultimodalPrompt(
    prompt_message: google.cloud.aiplatform_v1beta1.types.prediction_service.GenerateContentRequest,
    api_schema_version: typing.Optional[str] = "1.0.0",
    executions: typing.Optional[
        list[vertexai.prompts._prompt_management.Execution]
    ] = None,
)

MultimodalPrompt. Child of PromptDatasetMetadata.

PromptDatasetMetadata

PromptDatasetMetadata(
    prompt_type: str,
    prompt_api_schema: vertexai.prompts._prompt_management.MultimodalPrompt,
)

PromptDatasetMetadata.

PromptMetadata

PromptMetadata(display_name: str, prompt_id: str)

Metadata containing the display name and prompt id of a prompt.

Returned by the list_prompts method.

PromptVersionMetadata

PromptVersionMetadata(display_name: str, prompt_id: str, version_id: str)

Metadata containing the display name, prompt id, and version id of a prompt version.

Returned by the list_prompt_versions method.

Modules Functions

create_version

create_version(
    prompt: vertexai.prompts._prompts.Prompt,
    prompt_id: typing.Optional[str] = None,
    version_name: typing.Optional[str] = None,
) -> vertexai.prompts._prompts.Prompt

Creates a Prompt or Prompt Version in the online prompt store

delete

delete(prompt_id: str) -> None

Deletes the online prompt resource associated with the prompt id.

get

get(
    prompt_id: str, version_id: typing.Optional[str] = None
) -> vertexai.prompts._prompts.Prompt

Creates a Prompt object from an online resource.

list_prompts

list_prompts() -> list[vertexai.prompts._prompt_management.PromptMetadata]

Lists all prompt resources in the online prompt store associated with the project.

list_versions

list_versions(
    prompt_id: str,
) -> list[vertexai.prompts._prompt_management.PromptVersionMetadata]

Returns a list of PromptVersionMetadata objects for the prompt resource.

restore_version

restore_version(
    prompt_id: str, version_id: str
) -> vertexai.prompts._prompt_management.PromptVersionMetadata

Restores a previous version of the prompt resource and loads that version into the current Prompt object.