File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
instrumentation/elastic-opentelemetry-instrumentation-openai
src/opentelemetry/instrumentation/openai Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ We currently support the following features:
1010- Functions calling with tools for chat completions
1111- Client side metrics
1212- Embeddings API calls
13- - Following 1.28 .0 Gen AI Semantic Conventions
13+ - Following 1.29 .0 Gen AI Semantic Conventions
1414
1515## Installation
1616
5656
5757### Elastic specific semantic conventions
5858
59- - New ` embeddings ` value for ` gen_ai.operation.name `
60- - New ` gen_ai.request.encoding_formats ` attribute with openai specific values ` [[float], [base64]] `
59+ None at the moment
6160
6261## Development
6362
Original file line number Diff line number Diff line change 3838 GEN_AI_USAGE_INPUT_TOKENS ,
3939 GEN_AI_USAGE_OUTPUT_TOKENS ,
4040)
41+
42+ try :
43+ from opentelemetry .semconv ._incubating .attributes .gen_ai_attributes import GEN_AI_REQUEST_ENCODING_FORMATS
44+ except ImportError :
45+ # available since 1.29.0
46+ GEN_AI_REQUEST_ENCODING_FORMATS = "gen_ai.request.encoding_formats"
47+
4148from opentelemetry .metrics import Histogram
4249from opentelemetry .trace import Span
4350from opentelemetry .util .types import Attributes
4855EVENT_GEN_AI_SYSTEM_MESSAGE = "gen_ai.system.message"
4956EVENT_GEN_AI_TOOL_MESSAGE = "gen_ai.tool.message"
5057
51- # not yet released attributes
52- GEN_AI_REQUEST_ENCODING_FORMATS = "gen_ai.request.encoding_formats"
53-
5458# As this is only used for a type annotation, only import from openai module
5559# when running type checker like pyright since we otherwise don't want to import
5660# it before the app.
You can’t perform that action at this time.
0 commit comments