Create prompt template version by ID
Create a new version of an existing prompt template. Freeplay assigns a random ID. Use when you have the template ID from a previous API call.
Version Creation Semantics:
A new version is created only if there is no existing version with identical:
- Content (prompt messages)
- Model
- LLM parameters
- Version name (if provided)
- Version description
- Tool schema
- Output schema
If an identical version exists in any of the target environments, that version is reused and its environments are updated to match the requested environments. This ensures you never create duplicate versions with the same configuration.
Environment Deployment:
- When creating a new version, it will be deployed to the specified environments (or “latest” if none specified)
- When reuploading an existing prompt template with a new environment, the environments on that prompt template version will be updated
These checks are performed so that you can safely upload prompt templates without worrying that you will be creating duplicate versions. This is especially useful in development workflows where your prompts are stored in code.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
- PromptTemplateMessageInfo
- HistoryPlaceholderInfo
Response
PlainPromptTemplate(prompt_template_id: uuid.UUID, prompt_template_version_id: uuid.UUID, prompt_template_name: str, version_name: Optional[str], version_description: Optional[str], metadata: server.api_routes.prompt_templates_api_v2.PromptTemplateMetadata, format_version: int, project_id: uuid.UUID, content: list[typing.Union[server.project_sessions.prompt_template_model.ChatMessageWithMediaSlot, server.project_sessions.prompt_template_model.ChatMessage, server.project_sessions.prompt_template_model.HistoryPlaceholder]], tool_schema: Optional[list[shared.common.NormalizedToolSchema]], output_schema: Optional[dict[str, Any]])
- ChatMessageWithMediaSlot
- ChatMessage
- HistoryPlaceholder

