risicare 0.9.2 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +183 -0
- package/README.md +37 -19
- package/dist/frameworks/instructor.cjs +46 -1
- package/dist/frameworks/instructor.cjs.map +1 -1
- package/dist/frameworks/instructor.js +46 -1
- package/dist/frameworks/instructor.js.map +1 -1
- package/dist/frameworks/langchain.cjs +46 -1
- package/dist/frameworks/langchain.cjs.map +1 -1
- package/dist/frameworks/langchain.js +46 -1
- package/dist/frameworks/langchain.js.map +1 -1
- package/dist/frameworks/langgraph.cjs +46 -1
- package/dist/frameworks/langgraph.cjs.map +1 -1
- package/dist/frameworks/langgraph.js +46 -1
- package/dist/frameworks/langgraph.js.map +1 -1
- package/dist/frameworks/llamaindex.cjs +46 -1
- package/dist/frameworks/llamaindex.cjs.map +1 -1
- package/dist/frameworks/llamaindex.js +46 -1
- package/dist/frameworks/llamaindex.js.map +1 -1
- package/dist/index.cjs +329 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -5
- package/dist/index.d.ts +14 -5
- package/dist/index.js +329 -15
- package/dist/index.js.map +1 -1
- package/dist/providers/anthropic/index.cjs +117 -8
- package/dist/providers/anthropic/index.cjs.map +1 -1
- package/dist/providers/anthropic/index.js +117 -8
- package/dist/providers/anthropic/index.js.map +1 -1
- package/dist/providers/bedrock/index.cjs +64 -4
- package/dist/providers/bedrock/index.cjs.map +1 -1
- package/dist/providers/bedrock/index.js +64 -4
- package/dist/providers/bedrock/index.js.map +1 -1
- package/dist/providers/cerebras/index.cjs +64 -4
- package/dist/providers/cerebras/index.cjs.map +1 -1
- package/dist/providers/cerebras/index.js +64 -4
- package/dist/providers/cerebras/index.js.map +1 -1
- package/dist/providers/cohere/index.cjs +64 -4
- package/dist/providers/cohere/index.cjs.map +1 -1
- package/dist/providers/cohere/index.js +64 -4
- package/dist/providers/cohere/index.js.map +1 -1
- package/dist/providers/google/index.cjs +64 -4
- package/dist/providers/google/index.cjs.map +1 -1
- package/dist/providers/google/index.js +64 -4
- package/dist/providers/google/index.js.map +1 -1
- package/dist/providers/groq/index.cjs +64 -4
- package/dist/providers/groq/index.cjs.map +1 -1
- package/dist/providers/groq/index.js +64 -4
- package/dist/providers/groq/index.js.map +1 -1
- package/dist/providers/huggingface/index.cjs +64 -4
- package/dist/providers/huggingface/index.cjs.map +1 -1
- package/dist/providers/huggingface/index.js +64 -4
- package/dist/providers/huggingface/index.js.map +1 -1
- package/dist/providers/mistral/index.cjs +64 -4
- package/dist/providers/mistral/index.cjs.map +1 -1
- package/dist/providers/mistral/index.js +64 -4
- package/dist/providers/mistral/index.js.map +1 -1
- package/dist/providers/ollama/index.cjs +64 -4
- package/dist/providers/ollama/index.cjs.map +1 -1
- package/dist/providers/ollama/index.js +64 -4
- package/dist/providers/ollama/index.js.map +1 -1
- package/dist/providers/openai/index.cjs +102 -6
- package/dist/providers/openai/index.cjs.map +1 -1
- package/dist/providers/openai/index.js +102 -6
- package/dist/providers/openai/index.js.map +1 -1
- package/dist/providers/together/index.cjs +64 -4
- package/dist/providers/together/index.cjs.map +1 -1
- package/dist/providers/together/index.js +64 -4
- package/dist/providers/together/index.js.map +1 -1
- package/dist/providers/vercel-ai/index.cjs +48 -3
- package/dist/providers/vercel-ai/index.cjs.map +1 -1
- package/dist/providers/vercel-ai/index.js +48 -3
- package/dist/providers/vercel-ai/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,189 @@ Pre-1.0 (0.x): the MINOR number is the breaking signal. A change that can
|
|
|
6
6
|
break an existing caller ships as a MINOR bump. Other fixes and additions ship
|
|
7
7
|
as PATCH bumps.
|
|
8
8
|
|
|
9
|
+
## [0.10.0] — 2026-10-23
|
|
10
|
+
|
|
11
|
+
### ⚠ Behaviour change — prompt and completion content is captured by default (R9)
|
|
12
|
+
|
|
13
|
+
**What changes for you.** If you upgrade and change nothing, `init()` now sends the text of your
|
|
14
|
+
prompts and completions to Risicare, and Risicare stores it. From 0.5.2 to 0.9.2 this text stayed in
|
|
15
|
+
your process unless you set `traceContent: true` or `RISICARE_TRACE_CONTENT=true`. Now
|
|
16
|
+
`traceContent` defaults to `true`. This covers the provider patches and the content keys that you
|
|
17
|
+
set by hand (for example `span.setAttribute('gen_ai.prompt.0.content', ...)`). Only `patchOpenAI`
|
|
18
|
+
and `patchAnthropic` write prompt and completion text; the other providers write none, as before.
|
|
19
|
+
The model, the token counts, the latency, the cost, the roles, the errors and your own attributes
|
|
20
|
+
are sent in both cases, as before.
|
|
21
|
+
|
|
22
|
+
**To keep the old behaviour, turn capture off explicitly:**
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
init({ apiKey: 'rsk-...', traceContent: false });
|
|
26
|
+
// or: RISICARE_TRACE_CONTENT=false
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The option wins over the environment variable, in both directions. When the variable is set, a value
|
|
30
|
+
other than `true`, `1` or `yes` turns capture off (`on` does not turn it on). When it is not set, the
|
|
31
|
+
default applies. With capture off, each content-keyed attribute is replaced with
|
|
32
|
+
`<risicare:content-omitted>`, as in 0.5.2 and later.
|
|
33
|
+
|
|
34
|
+
**The project switch.** You can also turn off content capture in the project settings. The gateway
|
|
35
|
+
then drops the content of that project, also when the SDK sends it. The SDK switch stays. Use it
|
|
36
|
+
when prompt and completion text must not leave your process: the project switch acts after the text
|
|
37
|
+
has left.
|
|
38
|
+
|
|
39
|
+
With `traceContent: false`, the SDK still sends the status message, the exception message, the stack
|
|
40
|
+
trace (which repeats the message), `error.message` and `exception.message`. Only the project switch
|
|
41
|
+
masks them, at the gateway. Error diagnosis needs them, and an error message can contain part of a
|
|
42
|
+
prompt.
|
|
43
|
+
|
|
44
|
+
**A second `init()`.** The first `init()` still wins. When a later `init()` gives a different
|
|
45
|
+
`traceContent`, the SDK now writes a console warning that names both values, so that an early `init()` (for example in a
|
|
46
|
+
library) cannot make your capture setting void in silence. Call `shutdown()` first to change it.
|
|
47
|
+
|
|
48
|
+
**Why this is a MINOR change.** In 0.x the MINOR number is the breaking signal (see the top of this
|
|
49
|
+
file), and a changed default is a breaking change. So the release that carries this entry is a MINOR
|
|
50
|
+
release, not a PATCH.
|
|
51
|
+
|
|
52
|
+
### Added — cached and reasoning token counts (R31)
|
|
53
|
+
|
|
54
|
+
**What changes for you.** The LLM span now has the cached and reasoning token counts when the
|
|
55
|
+
provider response gives them. The SDK sends three new attributes with the OpenTelemetry GenAI names:
|
|
56
|
+
|
|
57
|
+
- `gen_ai.usage.cache_read.input_tokens`: the input tokens that the provider read from its prompt
|
|
58
|
+
cache.
|
|
59
|
+
- `gen_ai.usage.cache_write.input_tokens`: the input tokens that the provider wrote to its prompt
|
|
60
|
+
cache. OpenTelemetry renamed this key from `cache_creation` to `cache_write` on 2026-08-20. The
|
|
61
|
+
SDK uses the new name.
|
|
62
|
+
- `gen_ai.usage.reasoning.output_tokens`: the output tokens that the model used for reasoning.
|
|
63
|
+
|
|
64
|
+
The SDK reads these fields:
|
|
65
|
+
|
|
66
|
+
- `patchOpenAI`, `chat.completions.create`, with and without `stream: true`:
|
|
67
|
+
`usage.prompt_tokens_details.cached_tokens`, `usage.prompt_tokens_details.cache_write_tokens` and
|
|
68
|
+
`usage.completion_tokens_details.reasoning_tokens`. A stream gives them only in its usage chunk,
|
|
69
|
+
so set `stream_options: { include_usage: true }`.
|
|
70
|
+
- `patchAnthropic`, `messages.create`, with and without `stream: true`:
|
|
71
|
+
`usage.cache_read_input_tokens`, `usage.cache_creation_input_tokens` and
|
|
72
|
+
`usage.output_tokens_details.thinking_tokens`. A stream gives them in `message_start` and in
|
|
73
|
+
`message_delta`. The counts of `message_delta` are cumulative, so a count there replaces the count
|
|
74
|
+
of `message_start`.
|
|
75
|
+
|
|
76
|
+
The SDK sends a key only when the response gives an integer for its field. A real 0 is sent. When
|
|
77
|
+
the response does not give a count, or gives null, the key is absent. The SDK does not calculate or
|
|
78
|
+
estimate a count.
|
|
79
|
+
|
|
80
|
+
`gen_ai.usage.prompt_tokens`, `gen_ai.usage.completion_tokens`, `gen_ai.usage.total_tokens` and the
|
|
81
|
+
cost do not change. The OpenAI prompt count includes the cached tokens. The Anthropic
|
|
82
|
+
`input_tokens` does not include the cache tokens, and the SDK sends it unchanged. The three keys are
|
|
83
|
+
not content: `traceContent: false` keeps them. The other providers do not send these keys yet.
|
|
84
|
+
|
|
85
|
+
### Changed — with content capture off, the content gate strips the content keys of more frameworks
|
|
86
|
+
|
|
87
|
+
**What changes for you.** This change applies only when `traceContent: false`. With
|
|
88
|
+
`traceContent: true`, the SDK sends the same values as before.
|
|
89
|
+
|
|
90
|
+
With `traceContent: false`, the SDK replaces the value of a content attribute with
|
|
91
|
+
`<risicare:content-omitted>` before the span leaves your process. The SDK now uses the same rule
|
|
92
|
+
as the ingest gateway (content-key spec v2, R41) and as the Python SDK. Before this change, the SDK
|
|
93
|
+
sent the keys below, and only the gateway removed them. The SDK now replaces these values:
|
|
94
|
+
|
|
95
|
+
- Vercel AI SDK: `ai.prompt`, `ai.prompt.messages`, `ai.prompt.tools`, `ai.response.text`,
|
|
96
|
+
`ai.response.object`, `ai.response.toolCalls`, `ai.response.reasoning`, `ai.response.files`,
|
|
97
|
+
`ai.toolCall.args`, `ai.toolCall.result`, `ai.value`, `ai.values` and the older `ai.result.text`,
|
|
98
|
+
`ai.result.object` and `ai.result.toolCalls`.
|
|
99
|
+
- Google ADK: `gcp.vertex.agent.llm_request`, `gcp.vertex.agent.llm_response`,
|
|
100
|
+
`gcp.vertex.agent.tool_call_args`, `gcp.vertex.agent.tool_response` and `gcp.vertex.agent.data`.
|
|
101
|
+
- Pydantic AI: `pydantic_ai.all_messages`, `final_result`, `model_request_parameters`,
|
|
102
|
+
`tool_arguments` and `tool_response`.
|
|
103
|
+
- OpenLLMetry CrewAI: each key that starts with `crewai.`, for example `crewai.task.description`
|
|
104
|
+
and `crewai.crew.tasks`. The SDK keeps a key whose last segment the KEEP rule names (a role, a
|
|
105
|
+
name, an id, a type, a model, a count, a length or a token count), for example
|
|
106
|
+
`crewai.agent.role` and `crewai.crew.task_count`.
|
|
107
|
+
- Mastra: `mastra.<span type>.input` and `mastra.<span type>.output`.
|
|
108
|
+
- OpenInference, OpenLLMetry and Semantic Kernel: `agent.goal`, `agent.backstory`, `llm.tools`,
|
|
109
|
+
`llm.available_functions`, `gen_ai.task.input`, `gen_ai.task.output` and
|
|
110
|
+
`sk.available_functions`.
|
|
111
|
+
- Lists of tool definitions: the `description`, `parameters` and `json_schema` of each tool in
|
|
112
|
+
`llm.tools.*`, `llm.request.functions.*` and `gen_ai.tool.definitions.*`, and `tool.parameters`.
|
|
113
|
+
The SDK keeps the `description` of one tool on a tool span (`tool.description`).
|
|
114
|
+
- The arguments of a LiteLLM function call (`gen_ai.completion.<i>.function_call.arguments`) and the
|
|
115
|
+
text of an OpenInference prompt (`llm.prompts.<i>.prompt.text`).
|
|
116
|
+
|
|
117
|
+
Span events: an event with the name `gen_ai.user.message`, `gen_ai.system.message`,
|
|
118
|
+
`gen_ai.assistant.message`, `gen_ai.tool.message` or `gen_ai.choice`, or a name that starts with
|
|
119
|
+
`gen_ai.content.`, holds one message. These are the OpenTelemetry v1.36 message events and the
|
|
120
|
+
OpenLLMetry content events. In such an event, the SDK now replaces the value of each attribute, also
|
|
121
|
+
`message`, `body`, `tool.result` and `tool_calls`. It keeps only these keys: `gen_ai.system`,
|
|
122
|
+
`gen_ai.provider.name`, the keys of the exact KEEP list (for example
|
|
123
|
+
`gen_ai.response.content_type`), and a key whose last segment the KEEP rule names (for example
|
|
124
|
+
`role`, `id`, `index` and `finish_reason`). The event name does not change. The attributes of other
|
|
125
|
+
events (also the `exception` event of `recordException`) and of links use the key rule, as before.
|
|
126
|
+
|
|
127
|
+
The `mask` callback does not change. With `traceContent: false`, the SDK still sends the status message, the exception message, the stack
|
|
128
|
+
trace (which repeats the message), `error.message` and `exception.message`. Only the project switch
|
|
129
|
+
masks them, at the gateway.
|
|
130
|
+
Each key of the SDK's own corpus (`tests/fixtures/content-keys-v2.json`) has the same
|
|
131
|
+
result as before. If a dashboard or a custom exporter reads one of the keys above while capture is
|
|
132
|
+
off, it now gets the marker.
|
|
133
|
+
|
|
134
|
+
**Your own objects are not changed.** The gate replaced values in place, so the object that you gave to
|
|
135
|
+
`addEvent()` and `addLink()` was changed too (later, on the export worker). The gate now strips a copy. The span
|
|
136
|
+
that is sent is stripped as before.
|
|
137
|
+
|
|
138
|
+
**Kept, as the gateway keeps them:** `crewai.agent.llm` (a model name) and `crewai.crew.process`
|
|
139
|
+
(sequential or hierarchical). Their last segments `llm` and `process` are KEEP segments.
|
|
140
|
+
|
|
141
|
+
**The request parameters (content-key corpus version 4).** With `traceContent: false`, the SDK now
|
|
142
|
+
applies the value rule of the joint content-key corpus version 4
|
|
143
|
+
(`tests/fixtures/content-keys-v4.json`, a byte-identical copy of the gateway's file). The rule
|
|
144
|
+
applies to `llm.invocation_parameters`, the OpenInference request parameters. The SDK keeps this
|
|
145
|
+
key, and it reads its value as a JSON object or as the JSON text of a JSON object:
|
|
146
|
+
|
|
147
|
+
- The SDK replaces the value of each of these keys with the marker, at every depth of the value:
|
|
148
|
+
`additional_instructions`, `chat_history`, `contents`, `documents`, `functions`, `input`,
|
|
149
|
+
`input_text`, `instructions`, `message`, `messages`, `preamble`, `prediction`, `prompt`, `system`,
|
|
150
|
+
`system_instruction`, `texts`, `tool_config` and `tools`. A key also matches when it has the same
|
|
151
|
+
letters after `A` to `Z` become lower case and each `_` is removed, so `systemInstruction`,
|
|
152
|
+
`SYSTEM` and `inputText` match. Other letters do not change. A dotted key matches when one of its
|
|
153
|
+
parts matches (`app.prompt`).
|
|
154
|
+
- The SDK applies the key rule to each other entry, with the key path
|
|
155
|
+
`llm.invocation_parameters.<path>`. For example, `extra_body.metadata.content` gets the marker,
|
|
156
|
+
and `temperature`, `max_tokens` and `response_format` stay.
|
|
157
|
+
- Text at any depth that starts with `{` or `[` (after spaces, tabs and line ends) is JSON text. The
|
|
158
|
+
SDK reads it with the same rule and, when a value in it gets the marker, writes it back as compact
|
|
159
|
+
JSON. When the text is not valid JSON (for example, text that was cut, a number such as `1e400`,
|
|
160
|
+
or a stop sequence such as `[/INST]`), the SDK replaces it with the marker.
|
|
161
|
+
- A flat key `llm.invocation_parameters.<path>` gets the same rule: the marker when a part of
|
|
162
|
+
`<path>` matches a listed key or the key rule marks the key; else the SDK reads its value as
|
|
163
|
+
above.
|
|
164
|
+
- The SDK writes the JSON text of the whole value back as compact JSON.
|
|
165
|
+
- When the value is not a JSON object (for example, text that is not JSON, an array or a number),
|
|
166
|
+
the SDK replaces the whole value with the marker.
|
|
167
|
+
|
|
168
|
+
The rule also applies to the attributes of an event or a link, and to a nested value at the path
|
|
169
|
+
`llm` > `invocation_parameters`. When `llm` holds JSON text, the SDK reads the text; when the text
|
|
170
|
+
starts as JSON and is not valid JSON (for example, text that was cut at the attribute length limit),
|
|
171
|
+
the SDK replaces it with the marker. The SDK reads an object through its JSON form, so your own
|
|
172
|
+
object does not change. Before this change, the SDK sent the value of `llm.invocation_parameters`
|
|
173
|
+
whole, and only the gateway replaced the content keys in it. The gateway applies the same rule to
|
|
174
|
+
the request parameters; it does not read JSON text at `llm`.
|
|
175
|
+
|
|
176
|
+
**This is a MINOR change.** With capture off, more attribute values now reach Risicare and your own
|
|
177
|
+
exporters as `<risicare:content-omitted>`. A reader that used those values must change.
|
|
178
|
+
|
|
179
|
+
### Fixed — content capture never fails a call because of a message that it cannot read
|
|
180
|
+
|
|
181
|
+
**What changes for you.** With `traceContent: true`, `patchOpenAI` and `patchAnthropic` read the
|
|
182
|
+
role and the text of your messages before they call the provider. When a property access of a
|
|
183
|
+
message threw (for example a class instance whose `role` getter throws), your call threw that error
|
|
184
|
+
and the request was not sent. Now the SDK does that reading in the same guard as its reading of the
|
|
185
|
+
response. Your call goes to the provider with the messages unchanged. The span gets
|
|
186
|
+
`risicare.observer_error` with the error class name. The message keys that the SDK read before the
|
|
187
|
+
error stay on the span (for example the role of a message whose block type failed); the rest of that
|
|
188
|
+
message and the messages after it are not recorded. The span status does not change. With
|
|
189
|
+
`traceContent: false`,
|
|
190
|
+
the SDK does not read the messages, as before.
|
|
191
|
+
|
|
9
192
|
## [0.9.2] — 2026-10-17
|
|
10
193
|
|
|
11
194
|
### Changed — the npm tarball now carries CHANGELOG.md (issue #95)
|
package/README.md
CHANGED
|
@@ -43,8 +43,10 @@ await shutdown();
|
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
The SDK sends one span for the agent function and one span for the LLM call,
|
|
46
|
-
in the same trace. The LLM span has the model, the latency, the token counts
|
|
47
|
-
|
|
46
|
+
in the same trace. The LLM span has the model, the latency, the token counts,
|
|
47
|
+
the cost and, by default, the prompt and completion text (see
|
|
48
|
+
[Prompt content is captured by default](#prompt-content-is-captured-by-default)).
|
|
49
|
+
You see them in the [Risicare dashboard](https://app.risicare.ai).
|
|
48
50
|
|
|
49
51
|
## Two hosts
|
|
50
52
|
|
|
@@ -99,21 +101,31 @@ import * as risicare from 'risicare';
|
|
|
99
101
|
import type { Span, Tracer } from 'risicare';
|
|
100
102
|
```
|
|
101
103
|
|
|
102
|
-
## Prompt content is
|
|
104
|
+
## Prompt content is captured by default
|
|
103
105
|
|
|
104
|
-
**`traceContent` defaults to `
|
|
105
|
-
|
|
106
|
-
errors, and any attributes you set — is captured
|
|
107
|
-
dashboard, cost tracking and error diagnosis all work
|
|
106
|
+
**`traceContent` defaults to `true`.** The SDK sends your prompts and
|
|
107
|
+
completions to Risicare, and Risicare stores them. Everything else — model,
|
|
108
|
+
token counts, latency, cost, errors, and any attributes you set — is captured
|
|
109
|
+
as normal, so the dashboard, cost tracking and error diagnosis all work.
|
|
108
110
|
|
|
109
|
-
To
|
|
111
|
+
To stop the capture of prompt and completion text, set it off in your code or
|
|
112
|
+
in the environment:
|
|
110
113
|
|
|
111
114
|
```typescript
|
|
112
|
-
init({ apiKey: 'rsk-...', traceContent:
|
|
113
|
-
// or set RISICARE_TRACE_CONTENT=
|
|
115
|
+
init({ apiKey: 'rsk-...', traceContent: false });
|
|
116
|
+
// or set RISICARE_TRACE_CONTENT=false
|
|
114
117
|
```
|
|
115
118
|
|
|
116
|
-
|
|
119
|
+
The argument wins over the environment variable. You can also turn off content
|
|
120
|
+
capture in the project settings. The gateway then drops content for that
|
|
121
|
+
project, also when the SDK still sends it.
|
|
122
|
+
|
|
123
|
+
With `traceContent: false`, the SDK still sends the status message, the
|
|
124
|
+
exception message, the stack trace (which repeats the message), `error.message`
|
|
125
|
+
and `exception.message`. Only the project switch masks them, at the gateway.
|
|
126
|
+
Error diagnosis needs them, and an error message can contain part of a prompt.
|
|
127
|
+
|
|
128
|
+
**Which providers capture text.** With `traceContent` on (the default):
|
|
117
129
|
|
|
118
130
|
- `patchOpenAI` and `patchAnthropic` capture the prompt and the completion text.
|
|
119
131
|
They write the first 10 messages to `gen_ai.prompt.N.role` and
|
|
@@ -129,14 +141,20 @@ init({ apiKey: 'rsk-...', traceContent: true });
|
|
|
129
141
|
|
|
130
142
|
**Error text is not covered by this switch.** The error message from a
|
|
131
143
|
provider can contain your prompt text. For example, a 400 error can repeat
|
|
132
|
-
part of the prompt.
|
|
133
|
-
|
|
144
|
+
part of the prompt.
|
|
145
|
+
With `traceContent: false`, the SDK still sends the status message, the
|
|
146
|
+
exception message, the stack trace (which repeats the message), `error.message`
|
|
147
|
+
and `exception.message`. Only the project switch masks them, at the gateway.
|
|
148
|
+
|
|
149
|
+
**Upgrading from 0.9.2 or earlier?** This is a behaviour change. From 0.5.2
|
|
150
|
+
to 0.9.2 the default was `false`: prompts and completions stayed in your
|
|
151
|
+
process unless you opted in. Now they are sent unless you stop them. To keep
|
|
152
|
+
the old behaviour, add `traceContent: false` or set
|
|
153
|
+
`RISICARE_TRACE_CONTENT=false`.
|
|
134
154
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
stop a `span.setAttribute('gen_ai.prompt.0.content', ...)` from reaching us.
|
|
139
|
-
Both are fixed together.
|
|
155
|
+
The flag covers content that you set by hand too (since 0.5.2). For example,
|
|
156
|
+
`traceContent: false` stops a `span.setAttribute('gen_ai.prompt.0.content', ...)`
|
|
157
|
+
from reaching us. In 0.5.0 and earlier the flag did not do this.
|
|
140
158
|
|
|
141
159
|
When capture is off, content-bearing attributes are **replaced** with
|
|
142
160
|
`<risicare:content-omitted>` rather than removed, so "no prompt was sent" stays
|
|
@@ -151,7 +169,7 @@ on every content-bearing field of every span before export, for every
|
|
|
151
169
|
exporter:
|
|
152
170
|
|
|
153
171
|
```typescript
|
|
154
|
-
init({ apiKey: 'rsk-...',
|
|
172
|
+
init({ apiKey: 'rsk-...', mask: (key, value) => value });
|
|
155
173
|
```
|
|
156
174
|
|
|
157
175
|
|
|
@@ -131,6 +131,51 @@ function hasCredentials(url) {
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
// src/masking.ts
|
|
135
|
+
var CONTENT_IN_JSON_OBJECT = /* @__PURE__ */ new Map([
|
|
136
|
+
[
|
|
137
|
+
"llm.invocation_parameters",
|
|
138
|
+
/* @__PURE__ */ new Set([
|
|
139
|
+
"additionalinstructions",
|
|
140
|
+
// OpenAI assistants run
|
|
141
|
+
"chathistory",
|
|
142
|
+
// Cohere
|
|
143
|
+
"contents",
|
|
144
|
+
// Gemini
|
|
145
|
+
"documents",
|
|
146
|
+
// Cohere RAG
|
|
147
|
+
"functions",
|
|
148
|
+
"input",
|
|
149
|
+
"inputtext",
|
|
150
|
+
// Bedrock Titan
|
|
151
|
+
"instructions",
|
|
152
|
+
"message",
|
|
153
|
+
// Cohere
|
|
154
|
+
"messages",
|
|
155
|
+
"preamble",
|
|
156
|
+
// Cohere
|
|
157
|
+
"prediction",
|
|
158
|
+
// OpenAI predicted output
|
|
159
|
+
"prompt",
|
|
160
|
+
"system",
|
|
161
|
+
// Anthropic
|
|
162
|
+
"systeminstruction",
|
|
163
|
+
// Gemini
|
|
164
|
+
"texts",
|
|
165
|
+
// Cohere embed
|
|
166
|
+
"toolconfig",
|
|
167
|
+
// Gemini
|
|
168
|
+
"tools"
|
|
169
|
+
])
|
|
170
|
+
]
|
|
171
|
+
]);
|
|
172
|
+
var VALUE_RULE_PREFIXES = new Set(
|
|
173
|
+
[...CONTENT_IN_JSON_OBJECT.keys()].flatMap((key) => {
|
|
174
|
+
const segments = key.split(".");
|
|
175
|
+
return segments.slice(1).map((_, i) => segments.slice(0, i + 1).join("."));
|
|
176
|
+
})
|
|
177
|
+
);
|
|
178
|
+
|
|
134
179
|
// src/exporters/batch.ts
|
|
135
180
|
var MAX_TIMEOUT_MS = 2 ** 31 - 1;
|
|
136
181
|
var MAX_BATCH_BYTES = 8 * 1024 * 1024;
|
|
@@ -267,7 +312,7 @@ var SUPPLEMENTAL_RULES = [
|
|
|
267
312
|
];
|
|
268
313
|
|
|
269
314
|
// src/version.ts
|
|
270
|
-
var SDK_VERSION = "0.
|
|
315
|
+
var SDK_VERSION = "0.10.0";
|
|
271
316
|
|
|
272
317
|
// src/exporters/quota.ts
|
|
273
318
|
var QUOTA_REASON = "monthly_quota_exceeded";
|