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
Copy file name to clipboardExpand all lines: docs/gen-ai/gen-ai-agent-spans.md
+10-35Lines changed: 10 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,24 +56,18 @@ Semantic conventions for individual GenAI systems and frameworks MAY specify dif
56
56
|[`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. ||
57
57
|[`gen_ai.agent.id`](/docs/attributes-registry/gen-ai.md)| string | The unique identifier of the GenAI agent. |`asst_5j66UpCpwteGg4YSxUnt7lPY`|`Conditionally Required` if applicable. ||
58
58
|[`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. ||
59
-
|[`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]||
60
59
|[`gen_ai.request.choice.count`](/docs/attributes-registry/gen-ai.md)| int | The target number of candidate completions to return. |`3`|`Conditionally Required` if available, in the request, and !=1 ||
61
-
|[`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. ||
60
+
|[`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md)| string | The name of the GenAI model a request is being made to. [4]|`gpt-4`|`Conditionally Required` If available. ||
62
61
|[`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 ||
63
-
|[`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. ||
64
-
|[`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. ||
65
-
|[`server.port`](/docs/attributes-registry/server.md)| int | GenAI server port. [7]|`80`; `8080`; `443`|`Conditionally Required` If `server.address` is set. ||
66
-
|[`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`||
62
+
|[`server.port`](/docs/attributes-registry/server.md)| int | GenAI server port. [5]|`80`; `8080`; `443`|`Conditionally Required` If `server.address` is set. ||
63
+
|[`gen_ai.request.encoding_formats`](/docs/attributes-registry/gen-ai.md)| string[]| The encoding formats requested in an embeddings operation, if specified. [6]|`["base64"]`; `["float", "binary"]`|`Recommended`||
67
64
|[`gen_ai.request.frequency_penalty`](/docs/attributes-registry/gen-ai.md)| double | The frequency penalty setting for the GenAI request. |`0.1`|`Recommended`||
68
65
|[`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`||
69
66
|[`gen_ai.request.presence_penalty`](/docs/attributes-registry/gen-ai.md)| double | The presence penalty setting for the GenAI request. |`0.1`|`Recommended`||
70
67
|[`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`||
71
-
|[`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`||
72
-
|[`gen_ai.response.id`](/docs/attributes-registry/gen-ai.md)| string | The unique identifier for the completion. |`chatcmpl-123`|`Recommended`||
73
-
|[`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`||
74
-
|[`gen_ai.usage.input_tokens`](/docs/attributes-registry/gen-ai.md)| int | The number of tokens used in the GenAI input (prompt). |`100`|`Recommended`||
75
-
|[`gen_ai.usage.output_tokens`](/docs/attributes-registry/gen-ai.md)| int | The number of tokens used in the GenAI response (completion). |`180`|`Recommended`||
76
-
|[`server.address`](/docs/attributes-registry/server.md)| string | GenAI server address. [10]|`example.com`; `10.1.2.80`; `/tmp/my.sock`|`Recommended`||
68
+
|[`gen_ai.request.temperature`](/docs/attributes-registry/gen-ai.md)| double | The temperature setting for the GenAI request. |`0.0`|`Recommended`||
69
+
|[`gen_ai.request.top_p`](/docs/attributes-registry/gen-ai.md)| double | The top_p sampling setting for the GenAI request. |`1.0`|`Recommended`||
70
+
|[`server.address`](/docs/attributes-registry/server.md)| string | GenAI server address. [7]|`example.com`; `10.1.2.80`; `/tmp/my.sock`|`Recommended`||
77
71
78
72
**[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.
79
73
@@ -93,21 +87,13 @@ If none of these options apply, the `gen_ai.system` SHOULD be set to `_OTHER`.
93
87
the canonical name of exception that occurred, or another low-cardinality error identifier.
94
88
Instrumentations SHOULD document the list of errors they report.
95
89
96
-
**[4]`gen_ai.output.type`:** This attribute SHOULD be used when the client requests output of a specific type. The model may return zero or more outputs of this type.
97
-
This attribute specifies the output modality and not the actual output format. For example, if an image is requested, the actual output could be a URL pointing to an image file.
98
-
Additional output format details may be recorded in the future in the `gen_ai.output.{type}.*` attributes.
90
+
**[4]`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.
99
91
100
-
**[5]`gen_ai.output.type`:**when applicable and if the request includes an output format.
92
+
**[5]`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.
101
93
102
-
**[6]`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.
94
+
**[6]`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.
103
95
104
-
**[7]`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.
105
-
106
-
**[8]`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.
107
-
108
-
**[9]`gen_ai.response.model`:** If available. The name of the GenAI model that provided the response. If the model is supplied by a vendor, then the value must be the exact name of the model actually used. 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.
109
-
110
-
**[10]`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.
96
+
**[7]`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.
111
97
112
98
---
113
99
@@ -132,17 +118,6 @@ Additional output format details may be recorded in the future in the `gen_ai.ou
132
118
133
119
---
134
120
135
-
`gen_ai.output.type` 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.
|`text`| Plain text ||
143
-
144
-
---
145
-
146
121
`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.
0 commit comments