main
 1# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
 2
 3from typing import Dict, List, Optional
 4from typing_extensions import Literal
 5
 6from .._models import BaseModel
 7
 8__all__ = ["CompletionChoice", "Logprobs"]
 9
10
11class Logprobs(BaseModel):
12    text_offset: Optional[List[int]] = None
13
14    token_logprobs: Optional[List[float]] = None
15
16    tokens: Optional[List[str]] = None
17
18    top_logprobs: Optional[List[Dict[str, float]]] = None
19
20
21class CompletionChoice(BaseModel):
22    finish_reason: Literal["stop", "length", "content_filter"]
23    """The reason the model stopped generating tokens.
24
25    This will be `stop` if the model hit a natural stop point or a provided stop
26    sequence, `length` if the maximum number of tokens specified in the request was
27    reached, or `content_filter` if content was omitted due to a flag from our
28    content filters.
29    """
30
31    index: int
32
33    logprobs: Optional[Logprobs] = None
34
35    text: str