Skip to content

Get Template

GET
/api/v1/chat/templates/{template_id}

Get a template by ID.

Args: template_id: Template UUID conn: Database connection (injected)

Returns: Template if found

Raises: HTTPException: 404 if not found

template_id
required
Template Id
string

Successful Response

ChatTemplate

A reusable chat template with persona and configuration defaults.

object
id
Any of:
string
name
required
Name
string
>= 1 characters <= 100 characters
description
Any of:
string
tags
Tags
Array<string>
owner_id
Any of:
string
is_public
Is Public

Whether template is publicly visible

boolean
persona
Any of:
string
<= 200 characters
instructions
Instructions

Behavior instructions

Array<string>
roles
required
RoleConfig

Role configuration with system prompt

object
system_prompt
required
System Prompt

The system prompt defining the role’s behavior

string
name
Any of:
string
description
Any of:
string
default_context_mode
ContextMode

How to provide context to the LLM.

string
default: rag
Allowed values: rag attachment hybrid document none
default_rag_config
Any of:
RAGConfig

Complete RAG configuration for a chat query.

object
sources
required
Sources
Array<object>
>= 1 items <= 10 items
DataSourceConfig

Configuration for a single data source in RAG.

object
name
required
Name
string
model_name
required
Model Name
string
metadata_filters
Any of:
object
key
additional properties
any
limit
Limit
integer
default: 5 >= 1 <= 50
similarity_threshold
Similarity Threshold
number
default: 0.5 <= 1
weight
Weight
number
default: 1 <= 10
retrieval_strategy
RetrievalStrategy

How to combine results from multiple sources.

string
default: merge
Allowed values: merge sequential ensemble
max_total_results
Max Total Results
integer
default: 10 >= 1 <= 50
include_content
Include Content
boolean
default: true
default_attachment_config
Any of:
AttachmentConfig

Configuration for attachment-based context retrieval.

object
attachments
Attachments

Explicit document attachments

Array<object>
<= 20 items
Attachment

A document attachment for explicit context selection.

object
storage_key
required
Storage Key

Storage path to the document

string
title
Any of:
string
max_tokens
Any of:
integer
include_full_content
Include Full Content

Include full document content (vs summary/excerpts)

boolean
default: true
llm_model
Llm Model
string
default: gpt-4o-mini
temperature
Temperature
number
default: 0.7 <= 2
max_tokens
Max Tokens
integer
default: 2048 >= 100 <= 8000

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object