content
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| AudioBase64Content llmling_agent.models.content Audio from base64 data. |
||
| AudioContent llmling_agent.models.content Base for audio content. |
||
| AudioURLContent llmling_agent.models.content Audio from URL. |
||
| BaseContent llmling_agent.models.content Base class for special content types (non-text). |
||
| BaseImageContent llmling_agent.models.content Base for image content. |
||
| BasePDFContent llmling_agent.models.content Base for PDF document content. |
||
| ImageBase64Content llmling_agent.models.content Image from base64 data. |
||
| ImageURLContent llmling_agent.models.content Image from URL. |
||
| PDFBase64Content llmling_agent.models.content PDF from base64 data. |
||
| PDFURLContent llmling_agent.models.content PDF from URL. |
||
| VideoContent llmling_agent.models.content Base for video content. |
||
| VideoURLContent llmling_agent.models.content Video from URL. |
🛈 DocStrings¶
Content types for messages.
AudioBase64Content
¶
Bases: AudioContent
Audio from base64 data.
Source code in src/llmling_agent/models/content.py
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | |
type
class-attribute
instance-attribute
¶
type: Literal['audio_base64'] = Field('audio_base64', init=False)
Base64-encoded audio.
from_bytes
classmethod
¶
from_bytes(data: bytes, audio_format: str = 'mp3') -> Self
Create from raw bytes.
Source code in src/llmling_agent/models/content.py
238 239 240 241 | |
from_path
classmethod
¶
from_path(path: JoinablePathLike) -> Self
Create from file path with auto format detection.
Source code in src/llmling_agent/models/content.py
243 244 245 246 247 248 249 250 251 252 253 254 255 256 | |
AudioContent
¶
Bases: BaseContent
Base for audio content.
Source code in src/llmling_agent/models/content.py
199 200 201 202 203 204 205 206 | |
AudioURLContent
¶
Bases: AudioContent
Audio from URL.
Source code in src/llmling_agent/models/content.py
209 210 211 212 213 214 215 216 217 218 219 | |
BaseContent
¶
Bases: Schema
Base class for special content types (non-text).
Source code in src/llmling_agent/models/content.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 | |
BaseImageContent
¶
Bases: BaseContent
Base for image content.
Source code in src/llmling_agent/models/content.py
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 | |
detail
class-attribute
instance-attribute
¶
detail: DetailLevel | None = None
Detail level for image processing by vision models. - high: Maximum resolution (up to 2048x2048) - low: Lower resolution (512x512) - auto: Let model decide based on content
from_path
async
classmethod
¶
from_path(
path: JoinablePathLike, *, detail: DetailLevel | None = None, description: str | None = None
) -> ImageURLContent | ImageBase64Content
Create image content from any path.
Automatically chooses between URL and base64 based on path type. Downloads and converts remote content if needed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
JoinablePathLike
|
Local path or URL to image |
required |
detail
|
DetailLevel | None
|
Optional detail level for processing |
None
|
description
|
str | None
|
Optional description of the image |
None
|
Source code in src/llmling_agent/models/content.py
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 | |
BasePDFContent
¶
Bases: BaseContent
Base for PDF document content.
Source code in src/llmling_agent/models/content.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | |
detail
class-attribute
instance-attribute
¶
detail: DetailLevel | None = None
Detail level for document processing by models.
from_path
async
classmethod
¶
from_path(
path: JoinablePathLike, *, detail: DetailLevel | None = None, description: str | None = None
) -> PDFURLContent | PDFBase64Content
Create PDF content from any path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
JoinablePathLike
|
Local path or URL to PDF |
required |
detail
|
DetailLevel | None
|
Optional detail level for processing |
None
|
description
|
str | None
|
Optional description of the document |
None
|
Source code in src/llmling_agent/models/content.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | |
ImageBase64Content
¶
Bases: BaseImageContent
Image from base64 data.
Source code in src/llmling_agent/models/content.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | |
mime_type
class-attribute
instance-attribute
¶
mime_type: str = 'image/jpeg'
MIME type of the image.
type
class-attribute
instance-attribute
¶
type: Literal['image_base64'] = Field('image_base64', init=False)
Base64-encoded image.
from_bytes
classmethod
¶
from_bytes(
data: bytes, *, detail: DetailLevel | None = None, description: str | None = None
) -> ImageBase64Content
Create image content from raw bytes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
bytes
|
Raw image bytes |
required |
detail
|
DetailLevel | None
|
Optional detail level for processing |
None
|
description
|
str | None
|
Optional description of the image |
None
|
Source code in src/llmling_agent/models/content.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | |
ImageURLContent
¶
Bases: BaseImageContent
Image from URL.
Source code in src/llmling_agent/models/content.py
77 78 79 80 81 82 83 84 85 86 87 | |
PDFBase64Content
¶
Bases: BasePDFContent
PDF from base64 data.
Source code in src/llmling_agent/models/content.py
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | |
type
class-attribute
instance-attribute
¶
type: Literal['pdf_base64'] = Field('pdf_base64', init=False)
Base64-data based PDF.
from_bytes
classmethod
¶
from_bytes(
data: bytes, *, detail: DetailLevel | None = None, description: str | None = None
) -> Self
Create PDF content from raw bytes.
Source code in src/llmling_agent/models/content.py
182 183 184 185 186 187 188 189 190 191 192 | |
PDFURLContent
¶
Bases: BasePDFContent
PDF from URL.
Source code in src/llmling_agent/models/content.py
160 161 162 163 164 165 166 167 168 169 170 | |
VideoContent
¶
Bases: BaseContent
Base for video content.
Source code in src/llmling_agent/models/content.py
264 265 266 267 268 269 270 271 | |
VideoURLContent
¶
Bases: VideoContent
Video from URL.
Source code in src/llmling_agent/models/content.py
274 275 276 277 278 279 280 281 | |