Langtrace and DSPy Integration Guide
DSPy
.Experiments
tab in Langtrace to view your experiments.inject_additional_attributes
.
This way Langtrace knows that you are running an experiment:
experiment
- Experiment name. Ex: experiment 1
.description
- Some useful description about the experiment.run_id
- When you want to associate traces to a specific runs, pass a unique run ID. This is useful when you are running Evaluate()
as part of your experiment where the traces specific to the Evaluate()
will appear as an individual entry.Evaluate()
. Note: Currently the score ranges it supports are between 0 and 100. So if you have scores that do not fall within this range, it could cause some UI issues.
TRACE_DSPY_CHECKPOINT=false
DSPy
.
DSPy Caching
Span Grouping for ThreadpoolExecutor
ThreadPoolExecutor
. The contextvars module is used to copy the current context and run the optimized CoT module within the copied context. By passing contextvars.copy_context().run
to the executor.submit
method, the current tracing context is propagated to the child span ensuring that the spans are grouped together in the trace.