-
Notifications
You must be signed in to change notification settings - Fork 590
feat(pydantic-ai): Support ImageUrl content type in span instrumentation #5629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ericapisani
merged 9 commits into
master
from
ep/pydantic-ai-support-base64-images-in-url-46s
Mar 11, 2026
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6347fc7
feat(pydantic-ai): Support ImageUrl content type in span instrumentation
ericapisani 9c24bd9
Merge branch 'master' into ep/pydantic-ai-support-base64-images-in-ur…
ericapisani 2f01be8
fix(pydantic-ai): Fix DATA_URL_BASE64_REGEX to match complex MIME types
ericapisani eb4393d
test(pydantic-ai): Add tests for data URLs with optional parameters
ericapisani e7623d1
fix(pydantic-ai): Clean up unused imports and strengthen test assertion
ericapisani 592b100
ref(pydantic-ai): Remove mime_type from ImageUrl span data and consol…
ericapisani 684cd6f
fix(pydantic-ai): Convert ImageUrl.url to string before regex match
ericapisani c88649e
Merge branch 'master' into ep/pydantic-ai-support-base64-images-in-ur…
ericapisani 7b90b66
remove unnecessary if statement
ericapisani File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 +1,8 @@ | ||
| import re | ||
|
|
||
| SPAN_ORIGIN = "auto.ai.pydantic_ai" | ||
|
|
||
| # Matches data URLs with base64-encoded content, e.g. "data:image/png;base64,iVBORw0K..." | ||
| DATA_URL_BASE64_REGEX = re.compile( | ||
| r"^data:(?:[a-zA-Z0-9][a-zA-Z0-9.+\-]*/[a-zA-Z0-9][a-zA-Z0-9.+\-]*)(?:;[a-zA-Z0-9\-]+=[^;,]*)*;base64,(?:[A-Za-z0-9+/\-_]+={0,2})$" | ||
| ) | ||
ericapisani marked this conversation as resolved.
Show resolved
Hide resolved
cursor[bot] marked this conversation as resolved.
Show resolved
Hide resolved
ericapisani marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.