# Prompting

> Prompting - List all chats available to the user. If the LLM blueprint is specified, results are
> restricted to only those chats associated with the LLM blueprint.

This Markdown file sits beside the HTML page at the same path (with a `.md` suffix). It summarizes the topic and lists links for tools and LLM context.

Companion generated at `2026-05-06T18:17:09.834742+00:00` (UTC).

## Primary page

- [Prompting](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html): Full documentation for this topic (HTML).

## Sections on this page

- [classdatarobot.models.genai.chat.Chat](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.chat.Chat): In-page section heading.
- [classmethodcreate(name, llm_blueprint)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.chat.Chat.create): In-page section heading.
- [classmethodget(chat)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.chat.Chat.get): In-page section heading.
- [classmethodlist(llm_blueprint=None, sort=None)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.chat.Chat.list): In-page section heading.
- [delete()](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.chat.Chat.delete): In-page section heading.
- [update(name)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.chat.Chat.update): In-page section heading.
- [classdatarobot.models.genai.chat_prompt.ChatPrompt](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.chat_prompt.ChatPrompt): In-page section heading.
- [classmethodcreate(text, llm_blueprint=None, chat=None, llm=None, llm_settings=None, vector_database=None, vector_database_settings=None, wait_for_completion=False, metadata_filter=None)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.chat_prompt.ChatPrompt.create): In-page section heading.
- [update(custom_metrics=None, feedback_metadata=None)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.chat_prompt.ChatPrompt.update): In-page section heading.
- [classmethodget(chat_prompt)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.chat_prompt.ChatPrompt.get): In-page section heading.
- [classmethodlist(llm_blueprint=None, playground=None, chat=None)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.chat_prompt.ChatPrompt.list): In-page section heading.
- [delete()](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.chat_prompt.ChatPrompt.delete): In-page section heading.
- [create_llm_blueprint(name, description='')](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.chat_prompt.ChatPrompt.create_llm_blueprint): In-page section heading.
- [classdatarobot.models.genai.comparison_chat.ComparisonChat](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.comparison_chat.ComparisonChat): In-page section heading.
- [classmethodcreate(name, playground)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.comparison_chat.ComparisonChat.create): In-page section heading.
- [classmethodget(comparison_chat)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.comparison_chat.ComparisonChat.get): In-page section heading.
- [classmethodlist(playground=None, sort=None)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.comparison_chat.ComparisonChat.list): In-page section heading.
- [delete()](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.comparison_chat.ComparisonChat.delete): In-page section heading.
- [update(name)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.comparison_chat.ComparisonChat.update): In-page section heading.
- [classdatarobot.models.genai.comparison_prompt.ComparisonPrompt](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.comparison_prompt.ComparisonPrompt): In-page section heading.
- [update(additional_llm_blueprints=None, wait_for_completion=False, feedback_result=None, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.comparison_prompt.ComparisonPrompt.update): In-page section heading.
- [classmethodcreate(llm_blueprints, text, comparison_chat=None, wait_for_completion=False, metadata_filter=None)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.comparison_prompt.ComparisonPrompt.create): In-page section heading.
- [classmethodget(comparison_prompt)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.comparison_prompt.ComparisonPrompt.get): In-page section heading.
- [classmethodlist(llm_blueprints=None, comparison_chat=None)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.comparison_prompt.ComparisonPrompt.list): In-page section heading.
- [delete()](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.comparison_prompt.ComparisonPrompt.delete): In-page section heading.
- [classdatarobot.models.genai.playground.Playground](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.playground.Playground): In-page section heading.
- [classmethodcreate(name, description='', use_case=None, copy_insights=None, playground_type=PlaygroundType.RAG)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.playground.Playground.create): In-page section heading.
- [classmethodget(playground_id)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.playground.Playground.get): In-page section heading.
- [classmethodlist(use_case=None, search=None, sort=None)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.playground.Playground.list): In-page section heading.
- [update(name=None, description=None)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.playground.Playground.update): In-page section heading.
- [delete()](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.playground.Playground.delete): In-page section heading.
- [classdatarobot.enums.PromptType](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.enums.PromptType): In-page section heading.
- [classdatarobot.models.genai.user_limits.UserLimits](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.user_limits.UserLimits): In-page section heading.
- [classmethodget_vector_database_count()](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.user_limits.UserLimits.get_vector_database_count): In-page section heading.
- [classmethodget_llm_requests_count()](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.user_limits.UserLimits.get_llm_requests_count): In-page section heading.
- [classdatarobot.models.genai.chat_prompt.ResultMetadata](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.chat_prompt.ResultMetadata): In-page section heading.
- [classdatarobot.models.genai.prompt_trace.PromptTrace](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.prompt_trace.PromptTrace): In-page section heading.
- [classmethodlist(playground)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.prompt_trace.PromptTrace.list): In-page section heading.
- [classmethodexport_to_ai_catalog(playground)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.prompt_trace.PromptTrace.export_to_ai_catalog): In-page section heading.
- [classdatarobot.models.genai.prompt_trace.TraceMetadata](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.prompt_trace.TraceMetadata): In-page section heading.
- [classmethodget(playground)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.prompt_trace.TraceMetadata.get): In-page section heading.
- [classdatarobot.models.genai.prompt_template.PromptTemplate](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.prompt_template.PromptTemplate): In-page section heading.
- [classmethodcreate(name, description='')](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.prompt_template.PromptTemplate.create): In-page section heading.
- [classmethodlist(sort=None, search=None)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.prompt_template.PromptTemplate.list): In-page section heading.
- [classmethodget(prompt_template_id)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.prompt_template.PromptTemplate.get): In-page section heading.
- [create_version(prompt_text, variables=None, commit_comment='')](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.prompt_template.PromptTemplate.create_version): In-page section heading.
- [list_versions()](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.prompt_template.PromptTemplate.list_versions): In-page section heading.
- [get_version(prompt_template_version_id)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.prompt_template.PromptTemplate.get_version): In-page section heading.
- [get_latest_version()](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.prompt_template.PromptTemplate.get_latest_version): In-page section heading.
- [classdatarobot.models.genai.prompt_template.PromptTemplateVersion](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.prompt_template.PromptTemplateVersion): In-page section heading.
- [classmethodget(prompt_template_id, prompt_template_version_id)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.prompt_template.PromptTemplateVersion.get): In-page section heading.
- [classmethodcreate(prompt_template_id, prompt_text, variables=None, commit_comment='')](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.prompt_template.PromptTemplateVersion.create): In-page section heading.
- [classmethodlist(prompt_template_id)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.prompt_template.PromptTemplateVersion.list): In-page section heading.
- [classmethodlist_all(prompt_template_ids=None)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.prompt_template.PromptTemplateVersion.list_all): In-page section heading.
- [render(variables=None, **kwargs)](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.prompt_template.PromptTemplateVersion.render): In-page section heading.
- [to_fstring()](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.prompt_template.PromptTemplateVersion.to_fstring): In-page section heading.
- [classdatarobot.models.genai.prompt_template.Variable](https://docs.datarobot.com/en/docs/api/reference/sdk/gen-prompting.html#datarobot.models.genai.prompt_template.Variable): In-page section heading.

## Related documentation

- [Developer documentation](https://docs.datarobot.com/en/docs/api/index.html): Linked from this page.
- [API reference](https://docs.datarobot.com/en/docs/api/reference/index.html): Linked from this page.
- [Python API client](https://docs.datarobot.com/en/docs/api/reference/sdk/index.html): Linked from this page.
- [Generative AI](https://docs.datarobot.com/en/docs/api/reference/sdk/tag-genai.html): Linked from this page.
- [APIObject](https://docs.datarobot.com/en/docs/api/reference/sdk/api-object.html#datarobot.models.api_object.APIObject): Linked from this page.
- [datarobot.errors.ClientError](https://docs.datarobot.com/en/docs/api/reference/sdk/errors.html#datarobot.errors.ClientError): Linked from this page.

## Documentation content

### class datarobot.models.genai.chat.Chat

Metadata for a DataRobot GenAI chat.

- Variables:

#### classmethod create(name, llm_blueprint)

Creates a new chat.

- Parameters:
- Returns: chat – The created chat.
- Return type: Chat

#### classmethod get(chat)

Retrieve a single chat.

- Parameters: chat ( Chat or str ) – The chat you want to retrieve. Accepts chat or chat ID.
- Returns: chat – The requested chat.
- Return type: Chat

#### classmethod list(llm_blueprint=None, sort=None)

List all chats available to the user. If the LLM blueprint is specified,
results are restricted to only those chats associated with the LLM blueprint.

- Parameters:
- Returns: chats – Returns a list of chats.
- Return type: list[Chat]

#### delete()

Delete the single chat.

- Return type: None

#### update(name)

Update the chat.

- Parameters: name ( str ) – The new name for the chat.
- Returns: chat – The updated chat.
- Return type: Chat

### class datarobot.models.genai.chat_prompt.ChatPrompt

Metadata for a DataRobot GenAI chat prompt.

- Variables:

#### classmethod create(text, llm_blueprint=None, chat=None, llm=None, llm_settings=None, vector_database=None, vector_database_settings=None, wait_for_completion=False, metadata_filter=None)

Create a new ChatPrompt. This submits the prompt text to the LLM. Either llm_blueprint
or chat is required.

- Parameters:

#### update(custom_metrics=None, feedback_metadata=None)

Update the chat prompt.

- Parameters:
- Returns: chat_prompt – The updated chat prompt.
- Return type: ChatPrompt

#### classmethod get(chat_prompt)

Retrieve a single chat prompt.

- Parameters: chat_prompt ( ChatPrompt or str ) – The chat prompt you want to retrieve, either ChatPrompt or chat prompt ID.
- Returns: chat_prompt – The requested chat prompt.
- Return type: ChatPrompt

#### classmethod list(llm_blueprint=None, playground=None, chat=None)

List all chat prompts available to the user. If the llm_blueprint, playground, or chat
is specified then the results are restricted to the chat prompts associated with that
entity.

- Parameters:
- Returns: chat_prompts – A list of chat prompts available to the user.
- Return type: list[ChatPrompt]

#### delete()

Delete the single chat prompt.

- Return type: None

#### create_llm_blueprint(name, description='')

Create a new LLM blueprint from an existing chat prompt.

- Parameters:
- Returns: llm_blueprint – The created LLM blueprint.
- Return type: LLMBlueprint

### class datarobot.models.genai.comparison_chat.ComparisonChat

Metadata for a DataRobot GenAI comparison chat.

- Variables:

#### classmethod create(name, playground)

Creates a new comparison chat.

- Parameters:
- Returns: comparison_chat – The created comparison chat.
- Return type: ComparisonChat

#### classmethod get(comparison_chat)

Retrieve a single comparison chat.

- Parameters: comparison_chat ( ComparisonChat or str ) – The comparison chat you want to retrieve. Accepts ComparisonChat or
  comparison chat ID.
- Returns: comparison_chat – The requested comparison chat.
- Return type: ComparisonChat

#### classmethod list(playground=None, sort=None)

List all comparison chats available to the user. If the playground is specified,
results are restricted to only those comparison chats associated with the playground.

- Parameters:
- Returns: comparison_chats – Returns a list of comparison chats.
- Return type: list[ComparisonChat]

#### delete()

Delete the single comparison chat.

- Return type: None

#### update(name)

Update the comparison chat.

- Parameters: name ( str ) – The new name for the comparison chat.
- Returns: comparison_chat – The updated comparison chat.
- Return type: ComparisonChat

### class datarobot.models.genai.comparison_prompt.ComparisonPrompt

Metadata for a DataRobot GenAI comparison prompt.

- Variables:

#### update(additional_llm_blueprints=None, wait_for_completion=False, feedback_result=None, **kwargs)

Update the comparison prompt.

- Parameters: additional_llm_blueprints ( list[LLMBlueprint or str] ) – The additional LLM blueprints you want to submit the comparison prompt.
- Returns: comparison_prompt – The updated comparison prompt.
- Return type: ComparisonPrompt

#### classmethod create(llm_blueprints, text, comparison_chat=None, wait_for_completion=False, metadata_filter=None)

Create a new ComparisonPrompt. This submits the prompt text to the LLM blueprints that
are specified.

- Parameters:

#### classmethod get(comparison_prompt)

Retrieve a single comparison prompt.

- Parameters: comparison_prompt ( str ) – The comparison prompt you want to retrieve. Accepts entity or ID.
- Returns: comparison_prompt – The requested comparison prompt.
- Return type: ComparisonPrompt

#### classmethod list(llm_blueprints=None, comparison_chat=None)

List all comparison prompts available to the user that include the specified LLM blueprints
or from the specified comparison chat.

- Parameters:
- Returns: comparison_prompts – A list of comparison prompts available to the user that use the specified LLM
  blueprints.
- Return type: list[ComparisonPrompt]

#### delete()

Delete the single comparison prompt.

- Return type: None

### class datarobot.models.genai.playground.Playground

Metadata for a DataRobot GenAI playground.

- Variables:

#### classmethod create(name, description='', use_case=None, copy_insights=None, playground_type=PlaygroundType.RAG)

Create a new playground.

- Parameters:
- Returns: playground – The created playground.
- Return type: Playground

#### classmethod get(playground_id)

Retrieve a single playground.

- Parameters: playground_id ( str ) – The ID of the playground you want to retrieve.
- Returns: playground – The requested playground.
- Return type: Playground

#### classmethod list(use_case=None, search=None, sort=None)

List all playgrounds available to the user. If the use_case is specified or can be
inferred from the Context then the results are restricted to the playgrounds
associated with the UseCase.

- Parameters:
- Returns: playgrounds – A list of playgrounds available to the user.
- Return type: list[Playground]

#### update(name=None, description=None)

Update the playground.

- Parameters:
- Returns: playground – The updated playground.
- Return type: Playground

#### delete()

Delete the playground.

- Return type: None

### class datarobot.enums.PromptType

Supported LLM blueprint prompting types.

### class datarobot.models.genai.user_limits.UserLimits

Counts for user limits for LLM APIs and vector databases.

#### classmethod get_vector_database_count()

Get the count of vector databases for the user.

- Return type: APIObject

#### classmethod get_llm_requests_count()

Get the count of LLMs requests made by the user.

- Return type: APIObject

### class datarobot.models.genai.chat_prompt.ResultMetadata

Metadata for the result of a chat prompt submission.

- Variables:

### class datarobot.models.genai.prompt_trace.PromptTrace

Prompt trace contains aggregated information about a prompt execution.

- Variables:

#### classmethod list(playground)

List all prompt traces for a playground.

- Parameters: playground ( str ) – The ID of the playground to list prompt traces for.
- Returns: prompt_traces – List of prompt traces for the playground.
- Return type: list[PromptTrace]

#### classmethod export_to_ai_catalog(playground)

Export prompt traces to AI Catalog as a CSV.

- Parameters: playground ( str ) – The ID of the playground to export prompt traces for.
- Returns: status_url – The URL where the status of the job can be monitored
- Return type: str

### class datarobot.models.genai.prompt_trace.TraceMetadata

Trace metadata contains information about all the users and chats that are relevant to
this playground.

- Variables: users ( list[dict] ) – The users who submitted the prompt.

#### classmethod get(playground)

Get trace metadata for a playground.

- Parameters: playground ( str ) – The ID of the playground to get trace metadata for.
- Returns: trace_metadata – The trace metadata for the playground.
- Return type: TraceMetadata

### class datarobot.models.genai.prompt_template.PromptTemplate

A prompt template that can have multiple versions.

- Variables:

#### classmethod create(name, description='')

Create a new prompt template.

- Parameters:
- Returns: The created prompt template.
- Return type: PromptTemplate
- Raises:

> [!NOTE] Examples
> ```
> >>> import datarobot as dr
> >>> template = dr.genai.PromptTemplate.create(
> ...     name="Customer Support",
> ...     description="Template for support responses"
> ... )
> ```

#### classmethod list(sort=None, search=None)

List all prompt templates available to the user.

- Parameters:
- Returns: A list of prompt templates.
- Return type: List[PromptTemplate]
- Raises:

> [!NOTE] Examples
> ```
> >>> import datarobot as dr
> >>> templates = dr.genai.PromptTemplate.list(sort="-creationDate")
> ```

#### classmethod get(prompt_template_id)

Get a prompt template by ID.

- Parameters: prompt_template_id ( str ) – The ID of the prompt template to retrieve.
- Returns: The requested prompt template.
- Return type: PromptTemplate
- Raises:

> [!NOTE] Examples
> ```
> >>> import datarobot as dr
> >>> template = dr.genai.PromptTemplate.get("507f1f77bcf86cd799439011")
> ```

#### create_version(prompt_text, variables=None, commit_comment='')

Create a new version of this prompt template.

- Parameters:
- Returns: The created version.
- Return type: PromptTemplateVersion
- Raises:

> [!NOTE] Examples
> ```
> >>> from datarobot.models.genai.prompt_template import Variable
> >>> template.create_version(
> ...     prompt_text="Hello {{ name }}, regarding {{ issue }}",
> ...     variables=[
> ...         Variable(name="name", type="str", description="Customer name"),
> ...         Variable(name="issue", type="str", description="Issue type")
> ...     ],
> ...     commit_comment="Initial version"
> ... )
> ```

#### list_versions()

List all versions of this prompt template.

- Returns: A list of versions for this template.
- Return type: List[PromptTemplateVersion]
- Raises:

> [!NOTE] Examples
> ```
> >>> versions = template.list_versions()
> ```

#### get_version(prompt_template_version_id)

Get a specific version of this prompt template.

- Parameters: prompt_template_version_id ( str ) – The ID of the version to retrieve.
- Returns: The requested version.
- Return type: PromptTemplateVersion
- Raises:

> [!NOTE] Examples
> ```
> >>> import datarobot as dr
> >>> template = dr.genai.PromptTemplate.get("507f1f77bcf86cd799439011")
> >>> version = template.get_version("507f1f77bcf86cd799439012")
> ```

#### get_latest_version()

Get the latest version of this prompt template.

- Returns: The latest version, or None if no versions exist.
- Return type: Optional[PromptTemplateVersion]
- Raises:

> [!NOTE] Examples
> ```
> >>> import datarobot as dr
> >>> template = dr.genai.PromptTemplate.get("507f1f77bcf86cd799439011")
> >>> latest = template.get_latest_version()
> >>> if latest:
> ...     print(f"Version {latest.version}")
> ```

### class datarobot.models.genai.prompt_template.PromptTemplateVersion

A specific version of a prompt template.

- Variables:

#### classmethod get(prompt_template_id, prompt_template_version_id)

Get a specific prompt template version by ID.

- Parameters:
- Returns: The requested prompt template version.
- Return type: PromptTemplateVersion
- Raises:

> [!NOTE] Examples
> ```
> >>> import datarobot as dr
> >>> version = dr.genai.PromptTemplateVersion.get("prompt_template_id", "prompt_template_version_id")
> ```

#### classmethod create(prompt_template_id, prompt_text, variables=None, commit_comment='')

Create a new version of a prompt template.

- Parameters:
- Returns: The created version.
- Return type: PromptTemplateVersion
- Raises:

> [!NOTE] Examples
> ```
> >>> import datarobot as dr
> >>> from datarobot.models.genai.prompt_template import Variable
> >>> version = dr.genai.PromptTemplateVersion.create(
> ...     prompt_template_id="507f1f77bcf86cd799439011",
> ...     prompt_text="Hello {{ name }}, regarding {{ issue }}",
> ...     variables=[
> ...         Variable(name="name", type="str", description="Customer name"),
> ...         Variable(name="issue", type="str", description="Issue type")
> ...     ],
> ...     commit_comment="Initial version"
> ... )
> ```

#### classmethod list(prompt_template_id)

List all versions of a prompt template.

- Parameters: prompt_template_id ( str ) – The ID of the prompt template.
- Returns: A list of versions for the template.
- Return type: List[PromptTemplateVersion]
- Raises:

> [!NOTE] Examples
> ```
> >>> import datarobot as dr
> >>> versions = dr.genai.PromptTemplateVersion.list(
> ...     prompt_template_id="507f1f77bcf86cd799439011"
> ... )
> ```

#### classmethod list_all(prompt_template_ids=None)

List prompt template versions across multiple templates.

- Parameters: prompt_template_ids ( List[str] , optional ) – Filter versions to only those belonging to these prompt template IDs.
  If not provided, returns versions for all accessible templates.
- Returns: A list of prompt template versions.
- Return type: List[PromptTemplateVersion]
- Raises:

> [!NOTE] Examples
> ```
> >>> import datarobot as dr
> >>> # List all versions across all templates
> >>> versions = dr.genai.PromptTemplateVersion.list_all()
> >>> # List versions for specific templates
> >>> versions = dr.genai.PromptTemplateVersion.list_all(
> ...     prompt_template_ids=["template_id_1", "template_id_2"]
> ... )
> ```

#### render(variables=None, **kwargs)

Render the prompt text by substituting variables.

- Parameters:
- Returns: Rendered prompt text with variables substituted.
- Return type: str
- Raises: ValueError – If required variables are missing.

> [!NOTE] Examples
> ```
> >>> import datarobot as dr
> >>> version = dr.genai.PromptTemplateVersion.get("template_id", "version_id")
> >>> version.render(name="Alice", issue="billing")
> 'Hello Alice, regarding billing...'
> ```

#### to_fstring()

Convert the prompt text from {{ variable }} format to Python f-string {variable} format.

This method transforms template placeholders from double-brace format ({{ variable }})
to single-brace format ({variable}), making the template compatible with Python
f-string syntax. Whitespace around variable names is automatically stripped.

- Returns: Prompt text with variables in f-string format.
- Return type: str
- Raises: ValueError – If prompt_text is None.

> [!NOTE] Examples
> ```
> >>> import datarobot as dr
> >>> version = dr.genai.PromptTemplateVersion.get("template_id", "version_id")
> >>> # Original: "Hello {{ name }}, regarding {{ issue }}"
> >>> fstring_template = version.to_fstring()
> >>> # Result: "Hello {name}, regarding {issue}"
> >>> # Can now be used with f-string evaluation:
> >>> name = "Alice"
> >>> issue = "billing"
> >>> result = eval(f'f"{fstring_template}"')
> ```

### class datarobot.models.genai.prompt_template.Variable

A variable used in prompt templates.

- Variables:
