You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[`gen_ai.operation.name`](/docs/attributes-registry/gen-ai.md)| string | The name of the operation being performed. [1]|`chat`; `text_completion`; `embeddings`|`Required`||
50
+
|[`gen_ai.system`](/docs/attributes-registry/gen-ai.md)| string | The Generative AI product as identified by the client or server instrumentation. [2]|`openai`|`Required`||
51
+
|[`gen_ai.agent.description`](/docs/attributes-registry/gen-ai.md)| string | Free-form description of the GenAI agent provided by the application. |`Helps with math problems`; `Generates fiction stories`|`Conditionally Required` If provided by the application. ||
52
+
|[`gen_ai.agent.name`](/docs/attributes-registry/gen-ai.md)| string | Human-readable name of the GenAI agent provided by the application. |`Math Tutor`; `Fiction Writer`|`Conditionally Required` If provided by the application. ||
53
+
|[`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md)| string | The name of the GenAI model a request is being made to. [3]|`gpt-4`|`Conditionally Required` If available. ||
54
+
|[`gen_ai.request.seed`](/docs/attributes-registry/gen-ai.md)| int | Requests with same seed value more likely to return same result. |`100`|`Conditionally Required` if applicable and if the request includes a seed ||
55
+
|[`server.port`](/docs/attributes-registry/server.md)| int | GenAI server port. [4]|`80`; `8080`; `443`|`Conditionally Required` If `server.address` is set. ||
56
+
|[`gen_ai.request.encoding_formats`](/docs/attributes-registry/gen-ai.md)| string[]| The encoding formats requested in an embeddings operation, if specified. [5]|`["base64"]`; `["float", "binary"]`|`Recommended`||
57
+
|[`gen_ai.request.frequency_penalty`](/docs/attributes-registry/gen-ai.md)| double | The frequency penalty setting for the GenAI request. |`0.1`|`Recommended`||
58
+
|[`gen_ai.request.max_tokens`](/docs/attributes-registry/gen-ai.md)| int | The maximum number of tokens the model generates for a request. |`100`|`Recommended`||
59
+
|[`gen_ai.request.presence_penalty`](/docs/attributes-registry/gen-ai.md)| double | The presence penalty setting for the GenAI request. |`0.1`|`Recommended`||
60
+
|[`gen_ai.request.stop_sequences`](/docs/attributes-registry/gen-ai.md)| string[]| List of sequences that the model will use to stop generating further tokens. |`["forest", "lived"]`|`Recommended`||
61
+
|[`gen_ai.request.temperature`](/docs/attributes-registry/gen-ai.md)| double | The temperature setting for the GenAI request. |`0.0`|`Recommended`||
62
+
|[`gen_ai.request.top_p`](/docs/attributes-registry/gen-ai.md)| double | The top_p sampling setting for the GenAI request. |`1.0`|`Recommended`||
63
+
|[`server.address`](/docs/attributes-registry/server.md)| string | GenAI server address. [6]|`example.com`; `10.1.2.80`; `/tmp/my.sock`|`Recommended`||
64
+
65
+
**[1]`gen_ai.operation.name`:** If one of the predefined values applies, but specific system uses a different name it's RECOMMENDED to document it in the semantic conventions for specific GenAI system and use system-specific name in the instrumentation. If a different name is not documented, instrumentation libraries SHOULD use applicable predefined value.
66
+
67
+
**[2]`gen_ai.system`:** The `gen_ai.system` describes a family of GenAI models with specific model identified
68
+
by `gen_ai.request.model` and `gen_ai.response.model` attributes.
69
+
70
+
The actual GenAI product may differ from the one identified by the client.
71
+
Multiple systems, including Azure OpenAI and Gemini, are accessible by OpenAI client
72
+
libraries. In such cases, the `gen_ai.system` is set to `openai` based on the
73
+
instrumentation's best knowledge, instead of the actual system. The `server.address`
74
+
attribute may help identify the actual system in use for `openai`.
75
+
76
+
For custom model, a custom friendly name SHOULD be used.
77
+
If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`.
78
+
79
+
**[3]`gen_ai.request.model`:** The name of the GenAI model a request is being made to. If the model is supplied by a vendor, then the value must be the exact name of the model requested. If the model is a fine-tuned custom model, the value should have a more specific name than the base model that's been fine-tuned.
80
+
81
+
**[4]`server.port`:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available.
82
+
83
+
**[5]`gen_ai.request.encoding_formats`:** In some GenAI systems the encoding formats are called embedding types. Also, some GenAI systems only accept a single format per request.
84
+
85
+
**[6]`server.address`:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.
86
+
87
+
---
88
+
89
+
`gen_ai.operation.name` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
90
+
91
+
| Value | Description | Stability |
92
+
|---|---|---|
93
+
|`chat`| Chat completion operation such as [OpenAI Chat API](https://platform.openai.com/docs/api-reference/chat)||
|`embeddings`| Embeddings operation such as [OpenAI Create embeddings API](https://platform.openai.com/docs/api-reference/embeddings/create)||
96
+
|`execute_tool`| Execute a tool ||
97
+
|`text_completion`| Text completions operation such as [OpenAI Completions API (Legacy)](https://platform.openai.com/docs/api-reference/completions)||
98
+
99
+
---
100
+
101
+
`gen_ai.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
|[`gen_ai.operation.name`](/docs/attributes-registry/gen-ai.md)| string | The name of the operation being performed. [1]|`chat`; `text_completion`; `embeddings`|`Required`||
@@ -52,16 +148,16 @@ Semantic conventions for individual GenAI systems and frameworks MAY specify dif
52
148
|[`gen_ai.agent.id`](/docs/attributes-registry/gen-ai.md)| string | The unique identifier of the GenAI agent. |`asst_5j66UpCpwteGg4YSxUnt7lPY`|`Conditionally Required` if applicable. ||
53
149
|[`gen_ai.agent.name`](/docs/attributes-registry/gen-ai.md)| string | Human-readable name of the GenAI agent provided by the application. |`Math Tutor`; `Fiction Writer`|`Conditionally Required` If provided by the application. ||
54
150
|[`gen_ai.output.type`](/docs/attributes-registry/gen-ai.md)| string | Represents the content type requested by the client. [4]|`text`; `json`; `image`|`Conditionally Required`[5]||
55
-
|[`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md)| string | The name of the GenAI model a request is being made to. [6]|`gpt-4`|`Conditionally Required` If provided by the application. ||
151
+
|[`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md)| string | The name of the GenAI model a request is being made to. [6]|`gpt-4`|`Conditionally Required` If available. ||
56
152
|[`gen_ai.request.seed`](/docs/attributes-registry/gen-ai.md)| int | Requests with same seed value more likely to return same result. |`100`|`Conditionally Required` if applicable and if the request includes a seed ||
57
-
|[`gen_ai.request.temperature`](/docs/attributes-registry/gen-ai.md)| double | The temperature setting for the GenAI request. |`0.0`|`Conditionally Required` If provided by the application. ||
58
-
|[`gen_ai.request.top_p`](/docs/attributes-registry/gen-ai.md)| double | The top_p sampling setting for the GenAI request. |`1.0`|`Conditionally Required` If provided by the application. ||
59
153
|[`server.port`](/docs/attributes-registry/server.md)| int | GenAI server port. [7]|`80`; `8080`; `443`|`Conditionally Required` If `server.address` is set. ||
60
154
|[`gen_ai.request.encoding_formats`](/docs/attributes-registry/gen-ai.md)| string[]| The encoding formats requested in an embeddings operation, if specified. [8]|`["base64"]`; `["float", "binary"]`|`Recommended`||
61
155
|[`gen_ai.request.frequency_penalty`](/docs/attributes-registry/gen-ai.md)| double | The frequency penalty setting for the GenAI request. |`0.1`|`Recommended`||
62
156
|[`gen_ai.request.max_tokens`](/docs/attributes-registry/gen-ai.md)| int | The maximum number of tokens the model generates for a request. |`100`|`Recommended`||
63
157
|[`gen_ai.request.presence_penalty`](/docs/attributes-registry/gen-ai.md)| double | The presence penalty setting for the GenAI request. |`0.1`|`Recommended`||
64
158
|[`gen_ai.request.stop_sequences`](/docs/attributes-registry/gen-ai.md)| string[]| List of sequences that the model will use to stop generating further tokens. |`["forest", "lived"]`|`Recommended`||
159
+
|[`gen_ai.request.temperature`](/docs/attributes-registry/gen-ai.md)| double | The temperature setting for the GenAI request. |`0.0`|`Recommended`||
160
+
|[`gen_ai.request.top_p`](/docs/attributes-registry/gen-ai.md)| double | The top_p sampling setting for the GenAI request. |`1.0`|`Recommended`||
65
161
|[`gen_ai.response.finish_reasons`](/docs/attributes-registry/gen-ai.md)| string[]| Array of reasons the model stopped generating tokens, corresponding to each generation received. |`["stop"]`; `["stop", "length"]`|`Recommended`||
66
162
|[`gen_ai.response.id`](/docs/attributes-registry/gen-ai.md)| string | The unique identifier for the completion. |`chatcmpl-123`|`Recommended`||
67
163
|[`gen_ai.response.model`](/docs/attributes-registry/gen-ai.md)| string | The name of the model that generated the response. [9]|`gpt-4-0613`|`Recommended`||
@@ -160,7 +256,7 @@ Additional output format details may be recorded in the future in the `gen_ai.ou
160
256
<!-- END AUTOGENERATED TEXT -->
161
257
<!-- endsemconv -->
162
258
163
-
## Agent Execute Tool Span
259
+
###Agent Execute Tool Span
164
260
165
261
If you are using some tools in your agent, refer to [Execute Tool Span](./gen-ai-spans.md#execute-tool-span).
0 commit comments