-
Notifications
You must be signed in to change notification settings - Fork 797
feat(langchain): implement emitting events in addition to current behavior #2889
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
Conversation
… to current behavior * Add "use_legacy_attributes" to Config and the Instrumentor constructor, defaulting to True; * emit events for user prompts and AI responses, following [OpenTelemetry semantic conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-events/\\\); * introduce a privacy safeguard by checking the OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT environment variable to enable or disable content capture in events; * implement comprehensive tests to verify the new functionality and ensure that, when use_legacy_attributes == True, the existing behavior remains unchanged;
- Introduce TypedDicts and dataclasses to standardize inputs for event handling; - Add `emit_event` method to encapsulate all event emission logic via `Event` instances; - Refactor instrumentation to use `emit_event`, improving clarity and maintainability.
Generated with ❤️ by ellipsis.dev |
…metry instrumentation for Langchain - Improved code organization and readability across event models and span utilities.
🚨 BugBot couldn't runSomething went wrong. Try again by commenting "bugbot run", or contact support (requestId: serverGenReqId_43b90518-6947-4e9b-bab1-c59574709513). |
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 think you're reverting several changes we've incorporated in callback_handler
, can you take a look?
🚨 BugBot couldn't runSomething went wrong. Try again by commenting "bugbot run", or contact support (requestId: serverGenReqId_93ce9dcb-576e-49c5-bb5d-654aa14c71db). |
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.
Noticed this file is empty. Is it intentional, or should it be removed?
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.
Hey @ronensc, I'm taking a look in my branch here, if any code was lost in the merges, I'll remove it if it isn't necessary anymore, thank you for point out.
Hey @nirga, I'll take a look here in the merges I did and fix if that's the case, sorry for the delay, I hadn't seen your comment. |
…avior (traceloop#2889) Co-authored-by: Nir Gazit <[email protected]>
|
||
@dont_throw |
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.
@LuizDMM Could you please clarify the reason for removing @dont_throw
from on_llm_end()
?
…avior (#2889) Co-authored-by: Nir Gazit <[email protected]>
✅ PR Requirements
📌 Issue Requirements