mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: [Breaking] Simplified Content types to a single class with classmethod constructors. (#3252)
* ported Content to a new model * fixed linting * fixes * fixed data format handling * fix for 3.10 mypy * fix * fix int test
This commit is contained in:
committed by
GitHub
Unverified
parent
73761aa4a3
commit
83e6229c11
@@ -82,7 +82,7 @@ with open("path/to/your/image.jpg", "rb") as f:
|
||||
image_uri = f"data:image/jpeg;base64,{image_base64}"
|
||||
|
||||
# Use in DataContent
|
||||
DataContent(
|
||||
Content.from_uri(
|
||||
uri=image_uri,
|
||||
media_type="image/jpeg"
|
||||
)
|
||||
@@ -96,7 +96,7 @@ with open("path/to/your/image.jpg", "rb") as f:
|
||||
image_bytes = f.read()
|
||||
|
||||
# Use in DataContent
|
||||
DataContent(
|
||||
Content.from_data(
|
||||
data=image_bytes,
|
||||
media_type="image/jpeg"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user