-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompletion.py
More file actions
48 lines (28 loc) · 1.1 KB
/
completion.py
File metadata and controls
48 lines (28 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Optional
from typing_extensions import Literal
from .._models import BaseModel
from .log_probs import LogProbs
from .chat.chat_completion_usage import ChatCompletionUsage
__all__ = ["Completion", "Choice", "Prompt"]
class Choice(BaseModel):
finish_reason: Optional[Literal["stop", "eos", "length", "tool_calls", "function_call"]] = None
logprobs: Optional[LogProbs] = None
seed: Optional[int] = None
text: Optional[str] = None
class Prompt(BaseModel):
logprobs: Optional[LogProbs] = None
text: Optional[str] = None
class Completion(BaseModel):
id: str
choices: List[Choice]
created: int
model: str
object: Literal["text.completion"]
"""The object type, which is always `text.completion`."""
prompt: List[Prompt]
"""When `echo` is true, the prompt is included in the response.
Additionally, when `logprobs` is also provided, log probability information is
provided on the prompt.
"""
usage: Optional[ChatCompletionUsage] = None