@fallom/trace 0.2.1 → 0.2.3
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/dist/index.d.mts +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +246 -392
- package/dist/index.mjs +229 -375
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -21,6 +21,9 @@ interface TraceContext {
|
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Data structure for a trace sent to the Fallom API.
|
|
24
|
+
*
|
|
25
|
+
* SDK sends minimal structured data + raw attributes.
|
|
26
|
+
* Microservice extracts tokens, costs, previews, etc. from attributes.
|
|
24
27
|
*/
|
|
25
28
|
interface TraceData {
|
|
26
29
|
config_key: string;
|
|
@@ -37,9 +40,6 @@ interface TraceData {
|
|
|
37
40
|
duration_ms: number;
|
|
38
41
|
status: "OK" | "ERROR";
|
|
39
42
|
error_message?: string;
|
|
40
|
-
prompt_tokens?: number;
|
|
41
|
-
completion_tokens?: number;
|
|
42
|
-
total_tokens?: number;
|
|
43
43
|
time_to_first_token_ms?: number;
|
|
44
44
|
is_streaming?: boolean;
|
|
45
45
|
attributes?: Record<string, unknown>;
|
|
@@ -157,6 +157,9 @@ declare class FallomSession {
|
|
|
157
157
|
/**
|
|
158
158
|
* Wrap a Vercel AI SDK model to trace all calls (PostHog style).
|
|
159
159
|
* Returns the same model type with tracing injected.
|
|
160
|
+
*
|
|
161
|
+
* Note: This only captures tokens/timing, not prompt/completion content.
|
|
162
|
+
* Use wrapAISDK for full content tracing.
|
|
160
163
|
*/
|
|
161
164
|
traceModel<T>(model: T): T;
|
|
162
165
|
/** Wrap OpenAI client. Delegates to shared wrapper. */
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,9 @@ interface TraceContext {
|
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Data structure for a trace sent to the Fallom API.
|
|
24
|
+
*
|
|
25
|
+
* SDK sends minimal structured data + raw attributes.
|
|
26
|
+
* Microservice extracts tokens, costs, previews, etc. from attributes.
|
|
24
27
|
*/
|
|
25
28
|
interface TraceData {
|
|
26
29
|
config_key: string;
|
|
@@ -37,9 +40,6 @@ interface TraceData {
|
|
|
37
40
|
duration_ms: number;
|
|
38
41
|
status: "OK" | "ERROR";
|
|
39
42
|
error_message?: string;
|
|
40
|
-
prompt_tokens?: number;
|
|
41
|
-
completion_tokens?: number;
|
|
42
|
-
total_tokens?: number;
|
|
43
43
|
time_to_first_token_ms?: number;
|
|
44
44
|
is_streaming?: boolean;
|
|
45
45
|
attributes?: Record<string, unknown>;
|
|
@@ -157,6 +157,9 @@ declare class FallomSession {
|
|
|
157
157
|
/**
|
|
158
158
|
* Wrap a Vercel AI SDK model to trace all calls (PostHog style).
|
|
159
159
|
* Returns the same model type with tracing injected.
|
|
160
|
+
*
|
|
161
|
+
* Note: This only captures tokens/timing, not prompt/completion content.
|
|
162
|
+
* Use wrapAISDK for full content tracing.
|
|
160
163
|
*/
|
|
161
164
|
traceModel<T>(model: T): T;
|
|
162
165
|
/** Wrap OpenAI client. Delegates to shared wrapper. */
|