Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce generic gen_ai.output.type instead of gen_ai.openai.request.response_format #1757

Merged
merged 14 commits into from
Feb 3, 2025
Merged
Prev Previous commit
Next Next commit
feedback: deprecation and unnamed schema
lmolkova committed Jan 29, 2025
commit 43d97f3ce273283e387335f1fbe32d669a2b3a8b
6 changes: 4 additions & 2 deletions docs/attributes-registry/gen-ai.md
Original file line number Diff line number Diff line change
@@ -46,7 +46,9 @@ the client has requested output in a specific schema.
Semantic conventions for a specific GenAI system SHOULD document
how to populate this attribute based on the available request properties.

If the request does not include a schema or schema name is not available, this attribute SHOULD NOT be set.
If the request does not include a schema this attribute SHOULD NOT be set.
If a schema is provided but does not have a name, this attribute SHOULD
be set to `unnamed`.

**[3] `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.
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.
@@ -153,7 +155,7 @@ Describes deprecated `gen_ai.openai` attributes.

| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| <a id="gen-ai-openai-request-response-format" href="#gen-ai-openai-request-response-format">`gen_ai.openai.request.response_format`</a> | string | Deprecated, use `gen_ai.request.response_format`. | `text`; `json_object`; `json_schema` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `gen_ai.request.response_format`. |
| <a id="gen-ai-openai-request-response-format" href="#gen-ai-openai-request-response-format">`gen_ai.openai.request.response_format`</a> | string | Deprecated, use `gen_ai.output.type` and `gen_ai.output.json.schema.name`. | `text`; `json_object`; `json_schema` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `gen_ai.output.type` and `gen_ai.output.json.schema.name`. |
| <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. |

---
4 changes: 3 additions & 1 deletion docs/gen-ai/gen-ai-spans.md
Original file line number Diff line number Diff line change
@@ -96,7 +96,9 @@ the client has requested output in a specific schema.
Semantic conventions for a specific GenAI system SHOULD document
how to populate this attribute based on the available request properties.

If the request does not include a schema or schema name is not available, this attribute SHOULD NOT be set.
If the request does not include a schema this attribute SHOULD NOT be set.
If a schema is provided but does not have a name, this attribute SHOULD
be set to `unnamed`.

**[5] `gen_ai.output.json.schema.name`:** if and only if structured output with specific JSON schema was requested.

4 changes: 2 additions & 2 deletions model/gen-ai/deprecated/registry-deprecated.yaml
Original file line number Diff line number Diff line change
@@ -56,5 +56,5 @@ groups:
brief: 'JSON schema response format'
stability: experimental
brief: >
Deprecated, use `gen_ai.request.response_format`.
deprecated: "Replaced by `gen_ai.request.response_format`."
Deprecated, use `gen_ai.output.type` and `gen_ai.output.json.schema.name`.
deprecated: "Replaced by `gen_ai.output.type` and `gen_ai.output.json.schema.name`."
4 changes: 3 additions & 1 deletion model/gen-ai/registry.yaml
Original file line number Diff line number Diff line change
@@ -250,7 +250,9 @@ groups:
Semantic conventions for a specific GenAI system SHOULD document
how to populate this attribute based on the available request properties.

If the request does not include a schema or schema name is not available, this attribute SHOULD NOT be set.
If the request does not include a schema this attribute SHOULD NOT be set.
If a schema is provided but does not have a name, this attribute SHOULD
be set to `unnamed`.
examples: ['calendar_event', 'system.ResolverExecution']
- id: registry.gen_ai.openai
type: attribute_group