/claim #2456
This PR implements support for emitting OpenTelemetry-compliant events for prompt and completion logging.
✅ Adds:
use_legacy_attributes
config (default: true)emit_prompt_events
and emit_completion_events
(default: true)record_prompt_and_completion()
utility functioncompletion_wrappers.py
, chat_wrappers.py
, embeddings_wrappers.py
Fully backward compatible with legacy attributes.
[!IMPORTANT] Add OpenTelemetry-compliant prompt and completion event logging with configurable options and backward compatibility.
- Behavior:
- Adds OpenTelemetry-compliant event logging for prompt and completion events via
record_prompt_and_completion()
inutils.py
.- Configurable via
use_legacy_attributes
,emit_prompt_events
, andemit_completion_events
inconfig.py
.- Integrated into
completion_wrappers.py
,chat_wrappers.py
,embeddings_wrappers.py
.- Config:
- Adds
use_legacy_attributes
,emit_prompt_events
,emit_completion_events
toConfig
class inconfig.py
.- Utility Function:
- Adds
record_prompt_and_completion()
inutils.py
to emit events or set attributes based on config.This description was created by
for 502f1ab2d9e6d9f45d1471812ed3e693fdd1386c. It will automatically update as commits are pushed.
MrKrishnabhagat
@MrKrishnabhagat
Traceloop (YC W23)
@traceloop