- Python
- JS
We provide a It can also be used as a decorator:
using_prompt_template context manager to add a prompt template (including its version and variables) to the current OpenTelemetry Context. OpenInference auto-instrumentors will read this Context and pass the prompt template fields as span attributes, following the OpenInference semantic conventions. Its inputs must be of the following type:- Template: non-empty string.
- Version: non-empty string.
- Variables: a dictionary with string keys. This dictionary will be serialized to JSON when saved to the OTEL Context and remain a JSON string when sent as a span attribute.

