Skip to content

Commit 05b4c17

Browse files
authored
Introduce gen_ai.request.seed as needed by cohere (#1710)
1 parent 07e99eb commit 05b4c17

File tree

5 files changed

+32
-7
lines changed

5 files changed

+32
-7
lines changed

.chloggen/genai-request-seed.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
change_type: 'enhancement'
2+
component: gen_ai
3+
note: Introduce gen_ai.request.seed and deprecated gen_ai.openai.request.seed
4+
5+
issues: [1710]

docs/attributes-registry/gen-ai.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- [GenAI Attributes](#genai-attributes)
1010
- [OpenAI Attributes](#openai-attributes)
1111
- [Deprecated GenAI Attributes](#deprecated-genai-attributes)
12+
- [Deprecated OpenAI GenAI Attributes](#deprecated-openai-genai-attributes)
1213

1314
## GenAI Attributes
1415

@@ -22,6 +23,7 @@ This document defines the attributes used to describe telemetry in the context o
2223
| <a id="gen-ai-request-max-tokens" href="#gen-ai-request-max-tokens">`gen_ai.request.max_tokens`</a> | int | The maximum number of tokens the model generates for a request. | `100` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
2324
| <a id="gen-ai-request-model" href="#gen-ai-request-model">`gen_ai.request.model`</a> | string | The name of the GenAI model a request is being made to. | `gpt-4` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
2425
| <a id="gen-ai-request-presence-penalty" href="#gen-ai-request-presence-penalty">`gen_ai.request.presence_penalty`</a> | double | The presence penalty setting for the GenAI request. | `0.1` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
26+
| <a id="gen-ai-request-seed" href="#gen-ai-request-seed">`gen_ai.request.seed`</a> | int | Requests with same seed value more likely to return same result. | `100` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
2527
| <a id="gen-ai-request-stop-sequences" href="#gen-ai-request-stop-sequences">`gen_ai.request.stop_sequences`</a> | string[] | List of sequences that the model will use to stop generating further tokens. | `["forest", "lived"]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
2628
| <a id="gen-ai-request-temperature" href="#gen-ai-request-temperature">`gen_ai.request.temperature`</a> | double | The temperature setting for the GenAI request. | `0.0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
2729
| <a id="gen-ai-request-top-k" href="#gen-ai-request-top-k">`gen_ai.request.top_k`</a> | double | The top_k sampling setting for the GenAI request. | `1.0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
@@ -88,7 +90,6 @@ Thie group defines attributes for OpenAI.
8890
| Attribute | Type | Description | Examples | Stability |
8991
|---|---|---|---|---|
9092
| <a id="gen-ai-openai-request-response-format" href="#gen-ai-openai-request-response-format">`gen_ai.openai.request.response_format`</a> | string | The response format that is requested. | `json` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
91-
| <a id="gen-ai-openai-request-seed" href="#gen-ai-openai-request-seed">`gen_ai.openai.request.seed`</a> | int | Requests with same seed value more likely to return same result. | `100` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
9293
| <a id="gen-ai-openai-request-service-tier" href="#gen-ai-openai-request-service-tier">`gen_ai.openai.request.service_tier`</a> | string | The service tier requested. May be a specific tier, default, or auto. | `auto`; `default` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
9394
| <a id="gen-ai-openai-response-service-tier" href="#gen-ai-openai-response-service-tier">`gen_ai.openai.response.service_tier`</a> | string | The service tier used for the response. | `scale`; `default` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
9495
| <a id="gen-ai-openai-response-system-fingerprint" href="#gen-ai-openai-response-system-fingerprint">`gen_ai.openai.response.system_fingerprint`</a> | string | A fingerprint to track any eventual change in the Generative AI environment. | `fp_44709d6fcb` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
@@ -122,3 +123,11 @@ Describes deprecated `gen_ai` attributes.
122123
| <a id="gen-ai-prompt" href="#gen-ai-prompt">`gen_ai.prompt`</a> | string | Deprecated, use Event API to report prompt contents. | `[{'role': 'user', 'content': 'What is the capital of France?'}]` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Removed, no replacement at this time. |
123124
| <a id="gen-ai-usage-completion-tokens" href="#gen-ai-usage-completion-tokens">`gen_ai.usage.completion_tokens`</a> | int | Deprecated, use `gen_ai.usage.output_tokens` instead. | `42` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `gen_ai.usage.output_tokens` attribute. |
124125
| <a id="gen-ai-usage-prompt-tokens" href="#gen-ai-usage-prompt-tokens">`gen_ai.usage.prompt_tokens`</a> | int | Deprecated, use `gen_ai.usage.input_tokens` instead. | `42` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `gen_ai.usage.input_tokens` attribute. |
126+
127+
## Deprecated OpenAI GenAI Attributes
128+
129+
Describes deprecated `gen_ai.openai` attributes.
130+
131+
| Attribute | Type | Description | Examples | Stability |
132+
|---|---|---|---|---|
133+
| <a id="gen-ai-openai-request-seed" href="#gen-ai-openai-request-seed">`gen_ai.openai.request.seed`</a> | int | Deprecated, use `gen_ai.request.seed`. | `100` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `gen_ai.request.seed` attribute. |

docs/gen-ai/openai.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ attributes and ones specific the OpenAI.
4040
| [`gen_ai.request.model`](/docs/attributes-registry/gen-ai.md) | string | The name of the GenAI model a request is being made to. [2] | `gpt-4` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
4141
| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [3] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` if the operation ended in an error | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
4242
| [`gen_ai.openai.request.response_format`](/docs/attributes-registry/gen-ai.md) | string | The response format that is requested. | `json` | `Conditionally Required` if the request includes a response_format | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
43-
| [`gen_ai.openai.request.seed`](/docs/attributes-registry/gen-ai.md) | int | Requests with same seed value more likely to return same result. | `100` | `Conditionally Required` if the request includes a seed | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
43+
| [`gen_ai.openai.request.seed`](/docs/attributes-registry/gen-ai.md) | int | Deprecated, use `gen_ai.request.seed`. | `100` | `Conditionally Required` if the request includes a seed | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `gen_ai.request.seed` attribute. |
4444
| [`gen_ai.openai.request.service_tier`](/docs/attributes-registry/gen-ai.md) | string | The service tier requested. May be a specific tier, default, or auto. | `auto`; `default` | `Conditionally Required` [4] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
4545
| [`gen_ai.openai.response.service_tier`](/docs/attributes-registry/gen-ai.md) | string | The service tier used for the response. | `scale`; `default` | `Conditionally Required` [5] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
4646
| [`server.port`](/docs/attributes-registry/server.md) | int | GenAI server port. [6] | `80`; `8080`; `443` | `Conditionally Required` If `server.address` is set. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

model/gen-ai/deprecated/registry-deprecated.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,14 @@ groups:
2828
deprecated: "Removed, no replacement at this time."
2929
brief: "Deprecated, use Event API to report completions contents."
3030
examples: ["[{'role': 'assistant', 'content': 'The capital of France is Paris.'}]"]
31+
- id: registry.gen_ai.openai.deprecated
32+
type: attribute_group
33+
brief: Describes deprecated `gen_ai.openai` attributes.
34+
display_name: Deprecated OpenAI GenAI Attributes
35+
attributes:
36+
- id: gen_ai.openai.request.seed
37+
stability: experimental
38+
type: int
39+
deprecated: Replaced by `gen_ai.request.seed` attribute.
40+
brief: "Deprecated, use `gen_ai.request.seed`."
41+
examples: [100]

model/gen-ai/registry.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ groups:
100100
note: >
101101
In some GenAI systems the encoding formats are called embedding types.
102102
Also, some GenAI systems only accept a single format per request.
103+
- id: gen_ai.request.seed
104+
stability: experimental
105+
type: int
106+
brief: Requests with same seed value more likely to return same result.
107+
examples: [100]
103108
- id: gen_ai.response.id
104109
stability: experimental
105110
type: string
@@ -168,11 +173,6 @@ groups:
168173
brief: >
169174
Thie group defines attributes for OpenAI.
170175
attributes:
171-
- id: gen_ai.openai.request.seed
172-
stability: experimental
173-
type: int
174-
brief: Requests with same seed value more likely to return same result.
175-
examples: [100]
176176
- id: gen_ai.openai.request.response_format
177177
stability: experimental
178178
type:

0 commit comments

Comments
 (0)