@owlmeans/llm 0.1.18-rc.6 → 0.1.18-rc.7
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/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/llm",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-08-
|
|
4
|
+
"version": "0.1.18-rc.7",
|
|
5
|
+
"generatedAt": "2026-08-24T21:14:00.120Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -8,7 +8,7 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/llm
|
|
9
9
|
|
|
10
10
|
**Layer:** Core
|
|
11
|
-
**Install:** `"@owlmeans/llm": "^0.1.18-rc.
|
|
11
|
+
**Install:** `"@owlmeans/llm": "^0.1.18-rc.7"` in `dependencies` (plus the `@langchain/*` peers)
|
|
12
12
|
|
|
13
13
|
The inference runtime. Everything provider-specific is a **plugin**; the model itself only
|
|
14
14
|
owns the provider-independent parts (streaming discipline, retries, validation,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spectate.d.ts","sourceRoot":"","sources":["../../src/helpers/spectate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAe,MAAM,0BAA0B,CAAA;AAIjE,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"spectate.d.ts","sourceRoot":"","sources":["../../src/helpers/spectate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAe,MAAM,0BAA0B,CAAA;AAIjE,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAwC/D;;;GAGG;AACH,eAAO,MAAM,QAAQ,cAAe,YAAY,YAAY,MAAM,aAEvD,cAAc,EAAE,WACd,SAAS,UACV,MAAM,WACL,MAAM,cACH,MAAM,iEA+BnB,CAAA"}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { BaseMessage } from '@langchain/core/messages';
|
|
2
2
|
import { SpectatorContentType } from '@owlmeans/llm-common';
|
|
3
3
|
import { hasCacheActivity, readCacheUsage } from './cache.js';
|
|
4
|
+
/**
|
|
5
|
+
* The trace's `content` column is a string; LangChain content is a string-or-blocks union, and
|
|
6
|
+
* tool calls are arrays. Anything non-string must be stored as JSON — a plain string coercion
|
|
7
|
+
* downstream turns it into `[object Object]` and destroys the readable half of the trace
|
|
8
|
+
* (`raw` keeps the payload, but `content` is what trace readers query).
|
|
9
|
+
*/
|
|
10
|
+
const asText = (content) => typeof content === 'string' ? content : JSON.stringify(content) ?? '';
|
|
4
11
|
/** Normalize one prompt message into the spectator's storage shape. */
|
|
5
12
|
const describeInput = (msg, callType) => {
|
|
6
13
|
const entry = {
|
|
@@ -11,7 +18,7 @@ const describeInput = (msg, callType) => {
|
|
|
11
18
|
};
|
|
12
19
|
if (msg instanceof BaseMessage) {
|
|
13
20
|
entry.type = msg.type;
|
|
14
|
-
entry.content = msg.content;
|
|
21
|
+
entry.content = asText(msg.content);
|
|
15
22
|
entry.name = msg.name;
|
|
16
23
|
entry.contentType = typeof msg.content === 'string' ? SpectatorContentType.Text : SpectatorContentType.Json;
|
|
17
24
|
entry.usage = 'usage_metadata' in msg ? msg.usage_metadata : undefined;
|
|
@@ -19,11 +26,11 @@ const describeInput = (msg, callType) => {
|
|
|
19
26
|
}
|
|
20
27
|
else if (typeof msg === 'object' && 'content' in msg) {
|
|
21
28
|
entry.type = msg.role ?? 'unknown';
|
|
22
|
-
entry.content = msg.content ?? msg;
|
|
29
|
+
entry.content = asText(msg.content ?? msg);
|
|
23
30
|
entry.raw = JSON.stringify(msg);
|
|
24
31
|
}
|
|
25
32
|
else {
|
|
26
|
-
entry.content = msg;
|
|
33
|
+
entry.content = asText(msg);
|
|
27
34
|
entry.raw = JSON.stringify(msg);
|
|
28
35
|
}
|
|
29
36
|
return entry;
|
|
@@ -44,11 +51,11 @@ export const spectate = (spectator, callType) => async (input, message, action,
|
|
|
44
51
|
raw: JSON.stringify({ message, content: message.content, meta: message.response_metadata }),
|
|
45
52
|
};
|
|
46
53
|
if (message.tool_calls != null && message.tool_calls.length > 0) {
|
|
47
|
-
completion.content = message.tool_calls;
|
|
54
|
+
completion.content = asText(message.tool_calls);
|
|
48
55
|
completion.contentType = SpectatorContentType.ToolCall;
|
|
49
56
|
}
|
|
50
57
|
else {
|
|
51
|
-
completion.content = message.content;
|
|
58
|
+
completion.content = asText(message.content);
|
|
52
59
|
}
|
|
53
60
|
// Silent unless the provider reported cache activity, so it costs nothing when
|
|
54
61
|
// caching is off — and is the one signal that tells a stable prefix from a broken one.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spectate.js","sourceRoot":"","sources":["../../src/helpers/spectate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAG3D,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE7D,uEAAuE;AACvE,MAAM,aAAa,GAAG,CAAC,GAAmB,EAAE,QAAgB,EAAyB,EAAE;IACrF,MAAM,KAAK,GAA0B;QACnC,QAAQ;QACR,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,oBAAoB,CAAC,IAAI;KACvC,CAAA;IAED,IAAI,GAAG,YAAY,WAAW,EAAE,CAAC;QAC/B,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAA;QACrB,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"spectate.js","sourceRoot":"","sources":["../../src/helpers/sp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O,EAAE,IAAI,EAAE,OAAO,CAAC,iBAAiB,EAAE,CAAC;KAC5F,CAAA;IAED,IAAI,OAAO,CAAC,UAAU,IAAI,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChE,UAAU,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;QAC/C,UAAU,CAAC,WAAW,GAAG,oBAAoB,CAAC,QAAQ,CAAA;IACxD,CAAC;SAAM,CAAC;QACN,UAAU,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAC9C,CAAC;IAED,+EAA+E;IAC/E,uFAAuF;IACvF,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,CAAA;IACrC,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,CAAC,GAAG,CACT,iBAAiB,MAAM,WAAW,KAAK,CAAC,IAAI,aAAa,KAAK,CAAC,QAAQ,cAAc,KAAK,CAAC,KAAK,EAAE,CACnG,CAAA;IACH,CAAC;IAED,OAAO,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,GAAG,QAAQ,EAAE,UAAU,CAAC,EAAE,CAAC,CAAA;AAC3F,CAAC,CAAA"}
|
package/package.json
CHANGED
package/src/helpers/spectate.ts
CHANGED
|
@@ -5,6 +5,15 @@ import type { SpectatorEntryMessage } from '@owlmeans/llm-common'
|
|
|
5
5
|
import type { LlmSpectator, ModelInputItem } from '../types.js'
|
|
6
6
|
import { hasCacheActivity, readCacheUsage } from './cache.js'
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* The trace's `content` column is a string; LangChain content is a string-or-blocks union, and
|
|
10
|
+
* tool calls are arrays. Anything non-string must be stored as JSON — a plain string coercion
|
|
11
|
+
* downstream turns it into `[object Object]` and destroys the readable half of the trace
|
|
12
|
+
* (`raw` keeps the payload, but `content` is what trace readers query).
|
|
13
|
+
*/
|
|
14
|
+
const asText = (content: unknown): string =>
|
|
15
|
+
typeof content === 'string' ? content : JSON.stringify(content) ?? ''
|
|
16
|
+
|
|
8
17
|
/** Normalize one prompt message into the spectator's storage shape. */
|
|
9
18
|
const describeInput = (msg: ModelInputItem, callType: string): SpectatorEntryMessage => {
|
|
10
19
|
const entry: SpectatorEntryMessage = {
|
|
@@ -16,17 +25,17 @@ const describeInput = (msg: ModelInputItem, callType: string): SpectatorEntryMes
|
|
|
16
25
|
|
|
17
26
|
if (msg instanceof BaseMessage) {
|
|
18
27
|
entry.type = msg.type
|
|
19
|
-
entry.content = msg.content
|
|
28
|
+
entry.content = asText(msg.content)
|
|
20
29
|
entry.name = msg.name
|
|
21
30
|
entry.contentType = typeof msg.content === 'string' ? SpectatorContentType.Text : SpectatorContentType.Json
|
|
22
31
|
entry.usage = 'usage_metadata' in msg ? msg.usage_metadata as UsageMetadata : undefined
|
|
23
32
|
entry.raw = JSON.stringify({ message: msg, content: msg.content, meta: msg.response_metadata })
|
|
24
33
|
} else if (typeof msg === 'object' && 'content' in msg) {
|
|
25
34
|
entry.type = msg.role as string ?? 'unknown'
|
|
26
|
-
entry.content = msg.content
|
|
35
|
+
entry.content = asText(msg.content ?? msg)
|
|
27
36
|
entry.raw = JSON.stringify(msg)
|
|
28
37
|
} else {
|
|
29
|
-
entry.content = msg
|
|
38
|
+
entry.content = asText(msg)
|
|
30
39
|
entry.raw = JSON.stringify(msg)
|
|
31
40
|
}
|
|
32
41
|
|
|
@@ -58,10 +67,10 @@ export const spectate = (spectator: LlmSpectator, callType: string) =>
|
|
|
58
67
|
}
|
|
59
68
|
|
|
60
69
|
if (message.tool_calls != null && message.tool_calls.length > 0) {
|
|
61
|
-
completion.content = message.tool_calls
|
|
70
|
+
completion.content = asText(message.tool_calls)
|
|
62
71
|
completion.contentType = SpectatorContentType.ToolCall
|
|
63
72
|
} else {
|
|
64
|
-
completion.content = message.content
|
|
73
|
+
completion.content = asText(message.content)
|
|
65
74
|
}
|
|
66
75
|
|
|
67
76
|
// Silent unless the provider reported cache activity, so it costs nothing when
|