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:
10
10
- Functions calling with tools for chat completions
11
11
- Client side metrics
12
12
- Embeddings API calls
13
- - Following 1.28 .0 Gen AI Semantic Conventions
13
+ - Following 1.29 .0 Gen AI Semantic Conventions
14
14
15
15
## Installation
16
16
56
56
57
57
### Elastic specific semantic conventions
58
58
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
61
60
62
61
## Development
63
62
Original file line number Diff line number Diff line change 38
38
GEN_AI_USAGE_INPUT_TOKENS ,
39
39
GEN_AI_USAGE_OUTPUT_TOKENS ,
40
40
)
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
+
41
48
from opentelemetry .metrics import Histogram
42
49
from opentelemetry .trace import Span
43
50
from opentelemetry .util .types import Attributes
48
55
EVENT_GEN_AI_SYSTEM_MESSAGE = "gen_ai.system.message"
49
56
EVENT_GEN_AI_TOOL_MESSAGE = "gen_ai.tool.message"
50
57
51
- # not yet released attributes
52
- GEN_AI_REQUEST_ENCODING_FORMATS = "gen_ai.request.encoding_formats"
53
-
54
58
# As this is only used for a type annotation, only import from openai module
55
59
# when running type checker like pyright since we otherwise don't want to import
56
60
# it before the app.
You can’t perform that action at this time.
0 commit comments