@cultured_computer/sight 0.3.4 → 0.3.6
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/README.md +47 -32
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/package.json +5 -3
- package/schema/sight-record-v1.schema.json +227 -0
package/README.md
CHANGED
|
@@ -1,29 +1,26 @@
|
|
|
1
1
|
# Sight
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
the situation was, what your agent
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
The SDK is in beta. Interfaces and rollout order may change without notice;
|
|
26
|
-
the record format itself is versioned and stable.
|
|
3
|
+
Sight records what your production assistant is being. Not traces of what
|
|
4
|
+
the model produced: the interaction itself, captured as a coupled record.
|
|
5
|
+
Each turn holds what the situation was, what your agent did, how the user
|
|
6
|
+
responded, and what it led to. Both actors, one record. Behavior lives in
|
|
7
|
+
the coupling, not in the transcript: a reply only means something next to
|
|
8
|
+
what happened after it.
|
|
9
|
+
|
|
10
|
+
The record also carries an environment channel: tool outcomes, world
|
|
11
|
+
signals, stimulus events with their timing. Behavior reads against what
|
|
12
|
+
the world actually did, not just against text.
|
|
13
|
+
|
|
14
|
+
The SDK captures out of band; responses are never modified or delayed.
|
|
15
|
+
From the record, the dashboard shows the worst conversations first (opened
|
|
16
|
+
on the transcript), joins outcomes back to the conversation that caused
|
|
17
|
+
them even when they arrive days later, and computes behavioural
|
|
18
|
+
measurements on top: the situations your deployment handles, voice
|
|
19
|
+
consistency, uptake, breaks, return behaviour. Every interpreted number
|
|
20
|
+
stays preliminary until it agrees with your own labels on your own traffic.
|
|
21
|
+
|
|
22
|
+
The SDK is in beta. The record format is versioned and stable; the surfaces
|
|
23
|
+
around it are still moving.
|
|
27
24
|
|
|
28
25
|
## Install
|
|
29
26
|
|
|
@@ -51,6 +48,11 @@ Sight.startSession({
|
|
|
51
48
|
|
|
52
49
|
Notes:
|
|
53
50
|
|
|
51
|
+
- `apiKey` is a project ingest key. Create a project in the
|
|
52
|
+
[dashboard](https://sight.cultured.computer/dashboard) and copy its key
|
|
53
|
+
(shown once) into `SIGHT_API_KEY`. That is the only required setup — the
|
|
54
|
+
ingest endpoint defaults to production; override it with `endpoint` only for
|
|
55
|
+
self-hosting or staging.
|
|
54
56
|
- `init` runs once at startup. `deployment` identifies the configuration this
|
|
55
57
|
traffic belongs to; all measurement is per deployment.
|
|
56
58
|
- `externalId` keys the session (one conversation). `externalUserId` is a
|
|
@@ -93,8 +95,8 @@ await Sight.emitOutcomeEvent({
|
|
|
93
95
|
|
|
94
96
|
## Capture environment events
|
|
95
97
|
|
|
96
|
-
Deployments that run alongside a non-dialogue channel
|
|
97
|
-
game state stream, an editor buffer
|
|
98
|
+
Deployments that run alongside a non-dialogue channel (a stimulus feed, a
|
|
99
|
+
game state stream, an editor buffer) can record that channel's events
|
|
98
100
|
against the conversation:
|
|
99
101
|
|
|
100
102
|
```ts
|
|
@@ -107,14 +109,14 @@ await Sight.captureEnvironmentEvents(events, {
|
|
|
107
109
|
|
|
108
110
|
The envelope is generalized: `source_type` and `event` are free strings whose
|
|
109
111
|
meaning is defined per deployment. The instrument attaches events to turns by
|
|
110
|
-
time
|
|
111
|
-
when the event carries a `causeProvenance` turn reference
|
|
112
|
+
time (the next turn's state corner, plus the causing turn's outcome corner
|
|
113
|
+
when the event carries a `causeProvenance` turn reference) and never
|
|
112
114
|
interprets them.
|
|
113
115
|
|
|
114
116
|
## Capture spans
|
|
115
117
|
|
|
116
|
-
Deployments that keep their own sub-turn structure
|
|
117
|
-
steps, per-call model usage inside a single turn
|
|
118
|
+
Deployments that keep their own sub-turn structure (tool calls, retrieval
|
|
119
|
+
steps, per-call model usage inside a single turn) can ship it as spans:
|
|
118
120
|
|
|
119
121
|
```ts
|
|
120
122
|
await Sight.captureSpans(
|
|
@@ -137,7 +139,7 @@ await Sight.captureSpans(
|
|
|
137
139
|
A span lands on the turn you name, or on the session's latest turn at/under
|
|
138
140
|
its `startedAt` when `turnIndex` is omitted. Parent structure rides the
|
|
139
141
|
batch: give a span a caller-local `spanId` and reference it from a sibling's
|
|
140
|
-
`parentSpanId`. `attributes` are metadata only
|
|
142
|
+
`parentSpanId`. `attributes` are metadata only: tool names and argument
|
|
141
143
|
shapes, never free-text conversation content. `Sight.captureSpan(span)` is
|
|
142
144
|
the single-span form.
|
|
143
145
|
|
|
@@ -148,11 +150,24 @@ modify responses, and it does not estimate what a different response would
|
|
|
148
150
|
have produced. Counterfactual evaluation requires logged propensities or a
|
|
149
151
|
live experiment.
|
|
150
152
|
|
|
153
|
+
## The record schema
|
|
154
|
+
|
|
155
|
+
Everything Sight captures exports in one published, versioned shape:
|
|
156
|
+
`schema/sight-record-v1.schema.json`, shipped in this package
|
|
157
|
+
(`@cultured_computer/sight/schema/record-v1`). One JSON line per
|
|
158
|
+
session; each turn carries the fixed four-field envelope — the
|
|
159
|
+
situation, the assistant's move, how the person took it, and what
|
|
160
|
+
followed — on both sides of the exchange, with provenance and
|
|
161
|
+
redaction built into the shape. A CI test keeps the schema and the
|
|
162
|
+
export bytes in lockstep. Formats that standardize the agent log stop
|
|
163
|
+
at the assistant's half; this one records the exchange and its
|
|
164
|
+
consequences. See [Data format](https://sight.cultured.computer/docs/data-format).
|
|
165
|
+
|
|
151
166
|
## Docs
|
|
152
167
|
|
|
153
168
|
- [Get started](https://sight.cultured.computer/docs/get-started):
|
|
154
169
|
install, initialise, verify capture.
|
|
155
|
-
- [
|
|
170
|
+
- [Cookbook](https://sight.cultured.computer/docs/examples):
|
|
156
171
|
runnable snippets, each with what it lands in the record.
|
|
157
172
|
- [SDK reference](https://sight.cultured.computer/docs/sdk-reference):
|
|
158
173
|
the full method surface.
|
package/dist/index.cjs
CHANGED
|
@@ -1290,6 +1290,9 @@ zod.z.object({
|
|
|
1290
1290
|
*/
|
|
1291
1291
|
startDate: zod.z.string().optional()
|
|
1292
1292
|
});
|
|
1293
|
+
zod.z.object({
|
|
1294
|
+
requestId: zod.z.string().uuid()
|
|
1295
|
+
});
|
|
1293
1296
|
zod.z.object({
|
|
1294
1297
|
deploymentSlug: zod.z.string().min(1),
|
|
1295
1298
|
/** Same (seed, startDate) the seeding job used — the plan is recomputed
|