llmist 5.0.0 → 5.1.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.
@@ -34,7 +34,7 @@ import {
34
34
  init_strategy,
35
35
  init_stream_processor,
36
36
  resolveHintTemplate
37
- } from "./chunk-3SZIQI45.js";
37
+ } from "./chunk-YJKUWFIC.js";
38
38
 
39
39
  // src/index.ts
40
40
  init_builder();
@@ -1096,4 +1096,4 @@ export {
1096
1096
  resultWithFile,
1097
1097
  z
1098
1098
  };
1099
- //# sourceMappingURL=chunk-UBPZUVIN.js.map
1099
+ //# sourceMappingURL=chunk-F5QK5YVI.js.map
@@ -6258,13 +6258,24 @@ ${endPrefix}`
6258
6258
  observers: {
6259
6259
  ...hooks?.observers,
6260
6260
  onLLMCallStart: async (context) => {
6261
+ let inputTokens;
6262
+ try {
6263
+ if (this.client) {
6264
+ inputTokens = await this.client.countTokens(
6265
+ context.options.model,
6266
+ context.options.messages
6267
+ );
6268
+ }
6269
+ } catch {
6270
+ }
6261
6271
  onSubagentEvent({
6262
6272
  type: "llm_call_start",
6263
6273
  gadgetInvocationId: invocationId,
6264
6274
  depth,
6265
6275
  event: {
6266
6276
  iteration: context.iteration,
6267
- model: context.options.model
6277
+ model: context.options.model,
6278
+ inputTokens
6268
6279
  }
6269
6280
  });
6270
6281
  if (existingOnLLMCallStart) {
@@ -11707,4 +11718,4 @@ export {
11707
11718
  createEmptyStream,
11708
11719
  createErrorStream
11709
11720
  };
11710
- //# sourceMappingURL=chunk-3SZIQI45.js.map
11721
+ //# sourceMappingURL=chunk-YJKUWFIC.js.map