aws-observability / aws-otel-dotnet-instrumentation

Apache License 2.0
0 stars 6 forks source link

Added support for BedrockRuntime GenAI attributes #133

Open ezhang6811 opened 6 days ago

ezhang6811 commented 6 days ago

Description of changes: Updated local OTEL repo to support the following GenAI attributes for BedrockRuntime InvokeModel calls: gen_ai.request.max_tokens gen_ai.request.temperature gen_ai.request.top_p gen_ai.usage.input_tokens gen_ai.usage.output_tokens gen_ai.response.finish_reasons

E2E testing below shows that these additional GenAI attributes are made visible with the InvokeModel call for each of the 6 models supported by Bedrock. GenAI attributes are incomplete for several models because the Bedrock API for .NET does not expose the response headers in the API response, leaving only what's available in the response body for extraction. See this doc for more details.

Amazon Titan:

image

Anthropic Claude:

image

Meta Llama:

image

Cohere Command:

image

AI21 Labs Jamba:

image

Mistral AI:

image

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.