ImageEmbeddingInput Class
- Inheritance
-
azure.ai.inference.models._models.ImageEmbeddingInputImageEmbeddingInput
Constructor
ImageEmbeddingInput(*args: Any, **kwargs: Any)
Methods
as_dict |
Return a dict that can be turned into json using json.dump. |
clear | |
copy | |
get | |
items | |
keys | |
load |
Create an ImageEmbeddingInput object from a local image file. The method reads the image file and encodes it as a base64 string, which together with the image format is then used to format the JSON url value passed in the request payload. |
pop | |
popitem | |
setdefault | |
update | |
values |
as_dict
Return a dict that can be turned into json using json.dump.
as_dict(*, exclude_readonly: bool = False) -> Dict[str, Any]
Keyword-Only Parameters
Name | Description |
---|---|
exclude_readonly
|
Whether to remove the readonly properties. |
Returns
Type | Description |
---|---|
A dict JSON compatible object |
clear
clear() -> None
copy
copy() -> Model
get
get(key: str, default: Any = None) -> Any
Parameters
Name | Description |
---|---|
key
Required
|
|
default
Required
|
Default value: None
|
items
items() -> ItemsView[str, Any]
keys
keys() -> KeysView[str]
load
Create an ImageEmbeddingInput object from a local image file. The method reads the image file and encodes it as a base64 string, which together with the image format is then used to format the JSON url value passed in the request payload.
load(*, image_file: str, image_format: str, text: str | None = None) -> Self
Keyword-Only Parameters
Name | Description |
---|---|
image_file
Required
|
|
image_format
Required
|
|
text
Required
|
|
Returns
Type | Description |
---|---|
<xref:azure.ai.inference.models.EmbeddingsInput>
|
An ImageEmbeddingInput object with the image data encoded as a base64 string. |
Exceptions
Type | Description |
---|---|
when the image file could not be opened. |
pop
pop(key: str, default: ~typing.Any = <object object>) -> Any
Parameters
Name | Description |
---|---|
key
Required
|
|
default
Required
|
|
popitem
popitem() -> Tuple[str, Any]
setdefault
setdefault(key: str, default: ~typing.Any = <object object>) -> Any
Parameters
Name | Description |
---|---|
key
Required
|
|
default
Required
|
|
update
update(*args: Any, **kwargs: Any) -> None
values
values() -> ValuesView[Any]
Attributes
image
The input image encoded in base64 string as a data URL. Example:
data:image/{format};base64,{data}
. Required.
image: str
text
Optional. The text input to feed into the model (like DINO, CLIP). Returns a 422 error if the model doesn't support the value or parameter.
text: str | None
Azure SDK for Python