User configurable templates (#6420)

Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
Douwe Osinga
2026-01-20 17:15:52 -05:00
committed by GitHub
parent 5a04ee8700
commit 2f083b827a
23 changed files with 1052 additions and 307 deletions
+210
View File
@@ -1014,6 +1014,140 @@
}
}
},
"/config/prompts": {
"get": {
"tags": [
"super::routes::prompts"
],
"operationId": "get_prompts",
"responses": {
"200": {
"description": "List of all available prompts",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PromptsListResponse"
}
}
}
}
}
}
},
"/config/prompts/{name}": {
"get": {
"tags": [
"super::routes::prompts"
],
"operationId": "get_prompt",
"parameters": [
{
"name": "name",
"in": "path",
"description": "Prompt template name (e.g., system.md)",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Prompt content retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PromptContentResponse"
}
}
}
},
"404": {
"description": "Prompt not found"
}
}
},
"put": {
"tags": [
"super::routes::prompts"
],
"operationId": "save_prompt",
"parameters": [
{
"name": "name",
"in": "path",
"description": "Prompt template name (e.g., system.md)",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SavePromptRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Prompt saved successfully",
"content": {
"text/plain": {
"schema": {
"type": "string"
}
}
}
},
"404": {
"description": "Prompt not found"
},
"500": {
"description": "Failed to save prompt"
}
}
},
"delete": {
"tags": [
"super::routes::prompts"
],
"operationId": "reset_prompt",
"parameters": [
{
"name": "name",
"in": "path",
"description": "Prompt template name (e.g., system.md)",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Prompt reset to default successfully",
"content": {
"text/plain": {
"schema": {
"type": "string"
}
}
}
},
"404": {
"description": "Prompt not found"
},
"500": {
"description": "Failed to reset prompt"
}
}
}
},
"/config/providers": {
"get": {
"tags": [
@@ -4691,6 +4825,43 @@
"Tool"
]
},
"PromptContentResponse": {
"type": "object",
"required": [
"name",
"content",
"default_content",
"is_customized"
],
"properties": {
"content": {
"type": "string"
},
"default_content": {
"type": "string"
},
"is_customized": {
"type": "boolean"
},
"name": {
"type": "string"
}
}
},
"PromptsListResponse": {
"type": "object",
"required": [
"prompts"
],
"properties": {
"prompts": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Template"
}
}
}
},
"ProviderDetails": {
"type": "object",
"required": [
@@ -5352,6 +5523,17 @@
}
}
},
"SavePromptRequest": {
"type": "object",
"required": [
"content"
],
"properties": {
"content": {
"type": "string"
}
}
},
"SaveRecipeRequest": {
"type": "object",
"required": [
@@ -5970,6 +6152,34 @@
}
}
},
"Template": {
"type": "object",
"description": "Information about a template including its content and customization status",
"required": [
"name",
"description",
"default_content",
"is_customized"
],
"properties": {
"default_content": {
"type": "string"
},
"description": {
"type": "string"
},
"is_customized": {
"type": "boolean"
},
"name": {
"type": "string"
},
"user_content": {
"type": "string",
"nullable": true
}
}
},
"TextContent": {
"type": "object",
"required": [