2023-05-01 06:09:25 +09:00
|
|
|
from typing import Any, List
|
2023-05-01 23:34:45 +09:00
|
|
|
|
2023-05-01 06:09:25 +09:00
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
|
|
|
|
|
|
class Choice(BaseModel):
|
|
|
|
text: str
|
|
|
|
index: int
|
|
|
|
logprobs: Any
|
|
|
|
finish_reason: str
|
|
|
|
|
|
|
|
|
|
|
|
class Usage(BaseModel):
|
|
|
|
prompt_tokens: int
|
|
|
|
completion_tokens: int
|
|
|
|
total_tokens: int
|
|
|
|
|
|
|
|
|
|
|
|
class ForeFrontResponse(BaseModel):
|
|
|
|
id: str
|
|
|
|
object: str
|
|
|
|
created: int
|
|
|
|
model: str
|
|
|
|
choices: List[Choice]
|
|
|
|
usage: Usage
|
2023-05-01 23:34:45 +09:00
|
|
|
text: str
|