An image URL content part.
| 67 | return f'ContentPartVideo(video_url={repr(self.video_url)})' |
| 68 | |
| 69 | class ImageURL(BaseModel): |
| 70 | """An image URL content part.""" |
| 71 | url: str = Field(description="Either a URL of the image or the base64 encoded image data.") |
| 72 | detail: Literal['auto', 'low', 'high'] = Field(default='auto', description="Specifies the detail level of the image.") # type: ignore |
| 73 | """Specifies the detail level of the image. |
| 74 | Learn more in the |
| 75 | [Vision guide](https://platform.openai.com/docs/guides/vision#low-or-high-fidelity-image-understanding). |
| 76 | """ |
| 77 | |
| 78 | # needed for Anthropic |
| 79 | media_type: SupportedImageMediaType = 'image/png' |
| 80 | |
| 81 | def __str__(self) -> str: |
| 82 | return str(self.url) |
| 83 | |
| 84 | def __repr__(self) -> str: |
| 85 | return f'ImageURL(url={repr(self.url)}, detail={repr(self.detail)}, media_type={repr(self.media_type)})' |
| 86 | |
| 87 | class ContentPartImage(BaseModel): |
| 88 | """An image content part.""" |
no outgoing calls