You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add basic Open Telemetry instrumentation for model calls.
This commit wraps all LLM model calls in an Open Telemetry span that
abides by the (still nascent) semantic conventions for Generative AI
clients [0].
It's very similar in approach to what was done for `httr2`, and in fact
the two of them complement one another nicely:
r-lib/httr2#729.
For example:
library(otelsdk)
Sys.setenv(OTEL_TRACES_EXPORTER = "stderr")
chat <- ellmer::chat_databricks(model = "databricks-claude-3-7-sonnet")
chat$chat("Tell me a joke in the form of an SQL query.")
[0]: https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/
Signed-off-by: Aaron Jacobs <[email protected]>
0 commit comments