Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Patrice Chalin <chalin@users.noreply.github.com>
Co-authored-by: Liudmila Molkova <limolkova@microsoft.com>
Co-authored-by: Drew Robbins <drew@drewby.com>
  • Loading branch information
4 people committed Apr 1, 2024
1 parent 68ad466 commit f1fe748
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,6 @@
/model/metrics/gen-ai.yaml @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-llm-approvers
/model/trace/gen-ai.yaml @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-llm-approvers
/docs/gen-ai/ @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-llm-approvers
/docs/attributes-registry/gen-ai.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-llm-approvers
/docs/attributes-registry/llm.md @open-telemetry/specs-semconv-approvers @open-telemetry/semconv-llm-approvers

# TODO - Add semconv area experts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<!--- Hugo front matter used to generate the website version of this page:
linkTitle: LLM
--->

# Large Language Model (LLM)
# Large Language Model

<!-- toc -->

Expand Down
9 changes: 7 additions & 2 deletions docs/gen-ai/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
<!--- Hugo front matter used to generate the website version of this page:
linkTitle: AI
linkTitle: Generative AI
path_base_for_github_subdir:
from: content/en/docs/specs/semconv/ai/_index.md
from: tmp/semconv/docs/gen-ai/_index.md
to: gen-ai/README.md
--->

# Semantic Conventions for Generative AI systems

**Status**: [Experimental][DocumentStatus]

**Warning**:
The semantic conventions for GenAI and LLM are currently in development.
We encourage instrumentation libraries and telemetry consumers developers to
use the conventions in limited non-critical workloads and share the feedback

This document defines semantic conventions for the following kind of Generative AI systems:

* LLMs
Expand Down
8 changes: 5 additions & 3 deletions docs/gen-ai/llm-spans.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--- Hugo front matter used to generate the website version of this page:
linkTitle: LLM Calls
linkTitle: LLM requests
--->

# Semantic Conventions for LLM requests
Expand All @@ -18,8 +18,10 @@ linkTitle: LLM Calls

A request to an LLM is modeled as a span in a trace.

**Span kind:** MUST always be `CLIENT`.

The **span name** SHOULD be set to a low cardinality value describing an operation made to an LLM.
For example, the API name such as [Create chat completion](https://platform.openai.com/docs/api-reference/chat/create)
For example, the API name such as [Create chat completion](https://platform.openai.com/docs/api-reference/chat/create) could be represented as `ChatCompletions gpt-4` to include the API and the LLM.

## Configuration

Expand Down Expand Up @@ -78,7 +80,7 @@ The event name MUST be `gen_ai.content.completion`.
|---|---|---|---|---|
| [`gen_ai.completion`](../attributes-registry/gen-ai.md) | string | The full response received from the LLM. [1] | `[{'role': 'assistant', 'content': 'The capital of France is Paris.'}]` | Conditionally Required: if and only if corresponding event is enabled |

**[1]:** It's RECOMMENDED to format completions as JSON string matching [OpenAI messages format](https://platform.openai.com/docs/guides/text-generation)
**[1]:** It's RECOMMENDED to format completions as JSON string matching [OpenAI messages format](https://platform.openai.com/docs/guides/text-generation).
<!-- endsemconv -->

[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.22.0/specification/document-status.md
2 changes: 1 addition & 1 deletion model/registry/gen-ai.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ groups:
tag: llm-generic-response
- id: response.model
type: string
brief: The name of the LLM a response is being made to.
brief: The name of the LLM a response was generated from.
examples: ['gpt-4-0613']
tag: llm-generic-response
- id: response.finish_reasons
Expand Down
3 changes: 1 addition & 2 deletions model/trace/gen-ai.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ groups:
- ref: gen_ai.response.id
requirement_level: recommended
- ref: gen_ai.response.model
requirement_level:
conditionally_required: if response was received
recommended: if available
note: >
The name of the LLM serving a response. If the LLM is supplied by a vendor,
then the value must be the exact name of the model actually used. If the LLM is a
Expand Down

0 comments on commit f1fe748

Please sign in to comment.