-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): add message image content (#1405)
- Loading branch information
1 parent
064a34a
commit a115de6
Showing
28 changed files
with
295 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
configured_endpoints: 64 | ||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-2e14236d4015bf3b956290ea8b656224a0c7b206a356c6af2a7ae43fdbceb04c.yml | ||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-084b8f68408c6b689a55200a78bcf233769bfcd8e999d9fadaeb399152b05bcd.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/openai/types/beta/threads/image_file_content_block_param.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
|
||
from __future__ import annotations | ||
|
||
from typing_extensions import Literal, Required, TypedDict | ||
|
||
from .image_file_param import ImageFileParam | ||
|
||
__all__ = ["ImageFileContentBlockParam"] | ||
|
||
|
||
class ImageFileContentBlockParam(TypedDict, total=False): | ||
image_file: Required[ImageFileParam] | ||
|
||
type: Required[Literal["image_file"]] | ||
"""Always `image_file`.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
|
||
from typing import Optional | ||
from typing_extensions import Literal | ||
|
||
from ...._models import BaseModel | ||
|
||
__all__ = ["ImageFileDelta"] | ||
|
||
|
||
class ImageFileDelta(BaseModel): | ||
detail: Optional[Literal["auto", "low", "high"]] = None | ||
"""Specifies the detail level of the image if specified by the user. | ||
`low` uses fewer tokens, you can opt in to high resolution using `high`. | ||
""" | ||
|
||
file_id: Optional[str] = None | ||
""" | ||
The [File](https://platform.openai.com/docs/api-reference/files) ID of the image | ||
in the message content. | ||
in the message content. Set `purpose="vision"` when uploading the File if you | ||
need to later display the file content. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
|
||
from __future__ import annotations | ||
|
||
from typing_extensions import Literal, Required, TypedDict | ||
|
||
__all__ = ["ImageFileParam"] | ||
|
||
|
||
class ImageFileParam(TypedDict, total=False): | ||
file_id: Required[str] | ||
""" | ||
The [File](https://platform.openai.com/docs/api-reference/files) ID of the image | ||
in the message content. Set `purpose="vision"` when uploading the File if you | ||
need to later display the file content. | ||
""" | ||
|
||
detail: Literal["auto", "low", "high"] | ||
"""Specifies the detail level of the image if specified by the user. | ||
`low` uses fewer tokens, you can opt in to high resolution using `high`. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
|
||
from typing import Optional | ||
from typing_extensions import Literal | ||
|
||
from ...._models import BaseModel | ||
|
||
__all__ = ["ImageURL"] | ||
|
||
|
||
class ImageURL(BaseModel): | ||
url: str | ||
""" | ||
The external URL of the image, must be a supported image types: jpeg, jpg, png, | ||
gif, webp. | ||
""" | ||
|
||
detail: Optional[Literal["auto", "low", "high"]] = None | ||
"""Specifies the detail level of the image. | ||
`low` uses fewer tokens, you can opt in to high resolution using `high`. Default | ||
value is `auto` | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
|
||
from typing_extensions import Literal | ||
|
||
from .image_url import ImageURL | ||
from ...._models import BaseModel | ||
|
||
__all__ = ["ImageURLContentBlock"] | ||
|
||
|
||
class ImageURLContentBlock(BaseModel): | ||
image_url: ImageURL | ||
|
||
type: Literal["image_url"] | ||
"""The type of the content part.""" |
16 changes: 16 additions & 0 deletions
16
src/openai/types/beta/threads/image_url_content_block_param.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
|
||
from __future__ import annotations | ||
|
||
from typing_extensions import Literal, Required, TypedDict | ||
|
||
from .image_url_param import ImageURLParam | ||
|
||
__all__ = ["ImageURLContentBlockParam"] | ||
|
||
|
||
class ImageURLContentBlockParam(TypedDict, total=False): | ||
image_url: Required[ImageURLParam] | ||
|
||
type: Required[Literal["image_url"]] | ||
"""The type of the content part.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
|
||
from typing import Optional | ||
from typing_extensions import Literal | ||
|
||
from ...._models import BaseModel | ||
|
||
__all__ = ["ImageURLDelta"] | ||
|
||
|
||
class ImageURLDelta(BaseModel): | ||
detail: Optional[Literal["auto", "low", "high"]] = None | ||
"""Specifies the detail level of the image. | ||
`low` uses fewer tokens, you can opt in to high resolution using `high`. | ||
""" | ||
|
||
url: Optional[str] = None | ||
""" | ||
The URL of the image, must be a supported image types: jpeg, jpg, png, gif, | ||
webp. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
|
||
from typing import Optional | ||
from typing_extensions import Literal | ||
|
||
from ...._models import BaseModel | ||
from .image_url_delta import ImageURLDelta | ||
|
||
__all__ = ["ImageURLDeltaBlock"] | ||
|
||
|
||
class ImageURLDeltaBlock(BaseModel): | ||
index: int | ||
"""The index of the content part in the message.""" | ||
|
||
type: Literal["image_url"] | ||
"""Always `image_url`.""" | ||
|
||
image_url: Optional[ImageURLDelta] = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
|
||
from __future__ import annotations | ||
|
||
from typing_extensions import Literal, Required, TypedDict | ||
|
||
__all__ = ["ImageURLParam"] | ||
|
||
|
||
class ImageURLParam(TypedDict, total=False): | ||
url: Required[str] | ||
""" | ||
The external URL of the image, must be a supported image types: jpeg, jpg, png, | ||
gif, webp. | ||
""" | ||
|
||
detail: Literal["auto", "low", "high"] | ||
"""Specifies the detail level of the image. | ||
`low` uses fewer tokens, you can opt in to high resolution using `high`. Default | ||
value is `auto` | ||
""" |
Oops, something went wrong.