Skip to content

Commit

Permalink
Updating top_k and top_p inclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
drewby committed Oct 1, 2024
1 parent cd49fc4 commit 4ffbd8c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
1 change: 0 additions & 1 deletion docs/attributes-registry/gen-ai.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ Thie group defines attributes for OpenAI.
| `gen_ai.openai.request.response_format` | string | The response format that is requested. | `json` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `gen_ai.openai.request.seed` | int | Requests with same seed value more likely to return same result. | `100` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `gen_ai.openai.request.service_tier` | string | The service tier requested. May be a specific tier, detault, or auto. | `auto`; `default`; `standard` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `gen_ai.openai.request.top_p` | double | The top_p sampling setting for the OpenAI request. | `1.0`; `0.1` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `gen_ai.openai.response.service_tier` | string | The service tier used for the response. | `standard` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

`gen_ai.openai.request.response_format` 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.
Expand Down
2 changes: 0 additions & 2 deletions docs/gen-ai/openai.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,13 @@ attributes and ones specific the OpenAI.
| [`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) |
| [`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) |
| [`gen_ai.openai.request.service_tier`](/docs/attributes-registry/gen-ai.md) | string | The service tier requested. May be a specific tier, detault, or auto. | `auto`; `default`; `standard` | `Conditionally Required` if the request includes a service_tier | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`gen_ai.openai.request.top_p`](/docs/attributes-registry/gen-ai.md) | double | The top_p sampling setting for the OpenAI request. | `1.0`; `0.1` | `Conditionally Required` if the request includes a top_p | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`gen_ai.openai.response.service_tier`](/docs/attributes-registry/gen-ai.md) | string | The service tier used for the response. | `standard` | `Conditionally Required` if the request includes a service_tier | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`server.port`](/docs/attributes-registry/server.md) | int | GenAI server port. [5] | `80`; `8080`; `443` | `Conditionally Required` If `server.address` is set. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`gen_ai.request.frequency_penalty`](/docs/attributes-registry/gen-ai.md) | double | The frequency penalty setting for the GenAI request. | `0.1` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`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` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`gen_ai.request.presence_penalty`](/docs/attributes-registry/gen-ai.md) | double | The presence penalty setting for the GenAI request. | `0.1` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`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` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`gen_ai.request.temperature`](/docs/attributes-registry/gen-ai.md) | double | The temperature setting for the GenAI request. | `0.0` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`gen_ai.request.top_k`](/docs/attributes-registry/gen-ai.md) | double | The top_k sampling setting for the GenAI request. | `1.0` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`gen_ai.request.top_p`](/docs/attributes-registry/gen-ai.md) | double | The top_p sampling setting for the GenAI request. | `1.0` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`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` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`gen_ai.response.id`](/docs/attributes-registry/gen-ai.md) | string | The unique identifier for the completion. | `chatcmpl-123` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
Expand Down
5 changes: 0 additions & 5 deletions model/gen-ai/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,6 @@ groups:
type: int
brief: Requests with same seed value more likely to return same result.
examples: [100]
- id: gen_ai.openai.request.top_p
stability: experimental
type: double
brief: The top_p sampling setting for the OpenAI request.
examples: [1.0, 0.1]
- id: gen_ai.openai.request.response_format
stability: experimental
type:
Expand Down
17 changes: 10 additions & 7 deletions model/gen-ai/spans.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
groups:
- id: trace.gen_ai.client
- id: trace.gen_ai.client.common
type: span
brief: >
Describes GenAI operation span.
Expand All @@ -20,8 +20,6 @@ groups:
requirement_level: recommended
- ref: gen_ai.request.top_p
requirement_level: recommended
- ref: gen_ai.request.top_k
requirement_level: recommended
- ref: gen_ai.request.stop_sequences
requirement_level: recommended
- ref: gen_ai.request.frequency_penalty
Expand Down Expand Up @@ -86,17 +84,22 @@ groups:
note: >
It's RECOMMENDED to format completions as JSON string matching [OpenAI messages format](https://platform.openai.com/docs/guides/text-generation)
- id: trace.gen_ai.client
extends: trace.gen_ai.client.common
brief: >
Describes a GenAI operation span.
attributes:
- ref: gen_ai.request.top_k
requirement_level: recommended

- id: trace.gen_ai.openai.client
extends: trace.gen_ai.client
extends: trace.gen_ai.client.common
brief: >
Describes an OpenAI operation span.
attributes:
- ref: gen_ai.openai.request.seed
requirement_level:
conditionally_required: if the request includes a seed
- ref: gen_ai.openai.request.top_p
requirement_level:
conditionally_required: if the request includes a top_p
- ref: gen_ai.openai.request.response_format
requirement_level:
conditionally_required: if the request includes a response_format
Expand Down

0 comments on commit 4ffbd8c

Please sign in to comment.