Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ We currently support the following features:
- Functions calling with tools for chat completions
- Client side metrics
- Embeddings API calls
- Following 1.28.0 Gen AI Semantic Conventions
- Following 1.29.0 Gen AI Semantic Conventions

## Installation

Expand Down Expand Up @@ -56,8 +56,7 @@ None

### Elastic specific semantic conventions

- New `embeddings` value for `gen_ai.operation.name`
- New `gen_ai.request.encoding_formats` attribute with openai specific values `[[float], [base64]]`
None at the moment

## Development

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@
GEN_AI_USAGE_INPUT_TOKENS,
GEN_AI_USAGE_OUTPUT_TOKENS,
)

try:
from opentelemetry.semconv._incubating.attributes.gen_ai_attributes import GEN_AI_REQUEST_ENCODING_FORMATS
except ImportError:
# available since 1.29.0
GEN_AI_REQUEST_ENCODING_FORMATS = "gen_ai.request.encoding_formats"

from opentelemetry.metrics import Histogram
from opentelemetry.trace import Span
from opentelemetry.util.types import Attributes
Expand All @@ -48,9 +55,6 @@
EVENT_GEN_AI_SYSTEM_MESSAGE = "gen_ai.system.message"
EVENT_GEN_AI_TOOL_MESSAGE = "gen_ai.tool.message"

# not yet released attributes
GEN_AI_REQUEST_ENCODING_FORMATS = "gen_ai.request.encoding_formats"

# As this is only used for a type annotation, only import from openai module
# when running type checker like pyright since we otherwise don't want to import
# it before the app.
Expand Down
Loading