-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat(langchain): add support for chain metadata in spans #175
Conversation
assert isinstance(metadata, Mapping), f"expected Mapping, found {type(metadata)}" | ||
# Yield out each metadata key and value | ||
for key, value in metadata.items(): | ||
yield f"{LC_METADATA_PREFIX}.{key}", value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I should do a dump here if it's not a primative?
@@ -0,0 +1,8 @@ | |||
# LangChain specific span attributes | |||
|
|||
LC_METADATA_PREFIX = "langchain.metadata" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively could make this a semcov... Might be somewhat unifying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding to semcov in #176
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Xander Song <axiomofjoy@gmail.com>
Adds the ability to serialize langchain metadata into the traces via a
metadata
semantic conventions