-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Description
Logfire (and other OTel consumers) currently only receive kind: image/video/audio/document-url
(but not the URL) or kind: binary-content
(but not the bytes):
pydantic-ai/pydantic_ai_slim/pydantic_ai/messages.py
Lines 329 to 335 in f955890
def otel_event(self) -> Event: | |
if isinstance(self.content, str): | |
content = self.content | |
else: | |
# TODO figure out what to record for images and audio | |
content = [part if isinstance(part, str) else {'kind': part.kind} for part in self.content] | |
return Event('gen_ai.user.message', body={'content': content, 'role': 'user'}) |
To render the LLM conversation accurately and aid in debugging, we should send the actual data along.
Note that URLs are typically not passed directly to the LLM, but downloaded by PydanticAI and sent as bytes. We could consider sending both the URL and the data to Logfire, especially as the URL may not always be available. We may need a size limit though.
References
No response
Metadata
Metadata
Assignees
Labels
No labels