API: Add template list endpoint

Fetches all template names that a user has in the templates directory
for chat completions.

Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
kingbri
2023-12-29 22:56:47 -05:00
parent dce8c74edc
commit 79a57588d5
3 changed files with 28 additions and 3 deletions

9
OAI/types/template.py Normal file
View File

@@ -0,0 +1,9 @@
from pydantic import BaseModel, Field
from typing import List
class TemplateList(BaseModel):
"""Represents a list of templates."""
object: str = "list"
data: List[str] = Field(default_factory=list)