forked from openai/openai-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimages_response.py
More file actions
79 lines (50 loc) · 2.51 KB
/
Copy pathimages_response.py
File metadata and controls
79 lines (50 loc) · 2.51 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Optional
from typing_extensions import Literal
from .image import Image
from .._models import BaseModel
__all__ = ["ImagesResponse", "Usage", "UsageInputTokensDetails", "UsageOutputTokensDetails"]
class UsageInputTokensDetails(BaseModel):
"""The input tokens detailed information for the image generation."""
image_tokens: int
"""The number of image tokens in the input prompt."""
text_tokens: int
"""The number of text tokens in the input prompt."""
class UsageOutputTokensDetails(BaseModel):
"""The output token details for the image generation."""
image_tokens: int
"""The number of image output tokens generated by the model."""
text_tokens: int
"""The number of text output tokens generated by the model."""
class Usage(BaseModel):
"""For `gpt-image-1` only, the token usage information for the image generation."""
input_tokens: int
"""The number of tokens (images and text) in the input prompt."""
input_tokens_details: UsageInputTokensDetails
"""The input tokens detailed information for the image generation."""
output_tokens: int
"""The number of output tokens generated by the model."""
total_tokens: int
"""The total number of tokens (images and text) used for the image generation."""
output_tokens_details: Optional[UsageOutputTokensDetails] = None
"""The output token details for the image generation."""
class ImagesResponse(BaseModel):
"""The response from the image generation endpoint."""
created: int
"""The Unix timestamp (in seconds) of when the image was created."""
background: Optional[Literal["transparent", "opaque"]] = None
"""The background parameter used for the image generation.
Either `transparent` or `opaque`.
"""
data: Optional[List[Image]] = None
"""The list of generated images."""
output_format: Optional[Literal["png", "webp", "jpeg"]] = None
"""The output format of the image generation. Either `png`, `webp`, or `jpeg`."""
quality: Optional[Literal["low", "medium", "high"]] = None
"""The quality of the image generated. Either `low`, `medium`, or `high`."""
size: Optional[Literal["1024x1024", "1024x1536", "1536x1024"]] = None
"""The size of the image generated.
Either `1024x1024`, `1024x1536`, or `1536x1024`.
"""
usage: Optional[Usage] = None
"""For `gpt-image-1` only, the token usage information for the image generation."""