Skip to content

Commit 86450f9

Browse files
authored
feat(ai): add docs for gen_ai.usage.input_tokens.cache_write (#15993)
1 parent c588fae commit 86450f9

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

includes/tracing/ai-agents-module/ai-client-span.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ Additional attributes on the span:
1818
| `gen_ai.request.temperature` | float | optional | Model configuration parameter. | `0.1` |
1919
| `gen_ai.request.top_p` | float | optional | Model configuration parameter. | `0.7` |
2020
| `gen_ai.response.tool_calls` | string | optional | The tool calls in the model's response. **[0]** | `"[{\"name\": \"random_number\", \"type\": \"function_call\", \"arguments\": \"...\"}]"` |
21-
| `gen_ai.response.text` | string | optional | The text representation of the model's responses. **[0]** | `"[\"The weather in Paris is rainy\", \"The weather in London is sunny\"]"` |
22-
| `gen_ai.usage.input_tokens.cached` | int | optional | The number of cached tokens used in the AI input (prompt) | `50` |
21+
| `gen_ai.response.text` | string | optional | The text representation of the model's responses. **[0]** | `"[\"The weather in Paris is rainy\", \"The weather in London is sunny\"]"` |
22+
| `gen_ai.usage.input_tokens.cache_write` | int | optional | The number of tokens written to the cache when processing the AI input (prompt). | `100` |
23+
| `gen_ai.usage.input_tokens.cached` | int | optional | The number of cached tokens used in the AI input (prompt) | `50` |
2324
| `gen_ai.usage.input_tokens` | int | optional | The number of tokens used in the AI input (prompt). | `10` |
2425
| `gen_ai.usage.output_tokens.reasoning` | int | optional | The number of tokens used for reasoning. | `30` |
2526
| `gen_ai.usage.output_tokens` | int | optional | The number of tokens used in the AI response. | `100` |

includes/tracing/ai-agents-module/invoke-agent-span.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ Additional attributes on the span:
2222
| `gen_ai.request.temperature` | float | optional | Model configuration parameter. | `0.1` |
2323
| `gen_ai.request.top_p` | float | optional | Model configuration parameter. | `0.7` |
2424
| `gen_ai.response.tool_calls` | string | optional | The tool calls in the model’s response. **[0]** | `"[{\"name\": \"random_number\", \"type\": \"function_call\", \"arguments\": \"...\"}]"` |
25-
| `gen_ai.response.text` | string | optional | The text representation of the model’s responses. **[0]** | `"[\"The weather in Paris is rainy\", \"The weather in London is sunny\"]"` |
26-
| `gen_ai.usage.input_tokens.cached` | int | optional | The number of cached tokens used in the AI input (prompt) | `50` |
25+
| `gen_ai.response.text` | string | optional | The text representation of the model's responses. **[0]** | `"[\"The weather in Paris is rainy\", \"The weather in London is sunny\"]"` |
26+
| `gen_ai.usage.input_tokens.cache_write` | int | optional | The number of tokens written to the cache when processing the AI input (prompt). | `100` |
27+
| `gen_ai.usage.input_tokens.cached` | int | optional | The number of cached tokens used in the AI input (prompt) | `50` |
2728
| `gen_ai.usage.input_tokens` | int | optional | The number of tokens used in the AI input (prompt). | `10` |
2829
| `gen_ai.usage.output_tokens.reasoning` | int | optional | The number of tokens used for reasoning. | `30` |
2930
| `gen_ai.usage.output_tokens` | int | optional | The number of tokens used in the AI response. | `100` |
3031
| `gen_ai.usage.total_tokens` | int | optional | The total number of tokens used to process the prompt. (input and output) | `190` |
3132

3233
- **[0]:** Span attributes only allow primitive data types (like `int`, `float`, `boolean`, `string`). This means you need to use a stringified version of a list of dictionaries. Do NOT set `[{"foo": "bar"}]` but rather the string `"[{\"foo\": \"bar\"}]"`.
33-
- **[1]:** Each message item uses the format `{role:"", content:""}`. The `role` can be `"user"`, `"assistant"`, or `"system"`. The `content` can be either a string or a list of dictionaries.
34+
- **[1]:** Each message item uses the format `{role:"", content:""}`. The `role` can be `"user"`, `"assistant"`, or `"system"`. The `content` can be either a string or a list of dictionaries.

0 commit comments

Comments
 (0)