tabby/server/models.py

23 lines
478 B
Python
Raw Normal View History

2023-03-20 14:12:05 +00:00
from enum import Enum
from typing import List, Optional
from pydantic import BaseModel, Field
class Choice(BaseModel):
index: int
text: str
class CompletionsRequest(BaseModel):
prompt: str = Field(
2023-03-20 14:57:29 +00:00
example="def binarySearch(arr, left, right, x):\n mid = (left +",
2023-03-20 14:12:05 +00:00
description="The context to generate completions for, encoded as a string.",
)
class CompletionsResponse(BaseModel):
id: str
2023-03-20 14:57:29 +00:00
created: int
2023-03-20 14:12:05 +00:00
choices: List[Choice]