neatlogs 1.1.7 → 1.1.8

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.ts CHANGED
@@ -633,6 +633,6 @@ declare function registerCrewaiTask(task: {
633
633
  * SDK version. Kept in sync with package.json by the `version:sync` script
634
634
  * (runs automatically on `prebuild`). Do not edit by hand — bump package.json.
635
635
  */
636
- declare const __version__ = "1.1.7";
636
+ declare const __version__ = "1.1.8";
637
637
 
638
638
  export { type CachedPrompt, type InitOptions, type MaskFunction, PromptApiError, PromptClient, PromptClientError, PromptHandle, type PromptMessage, PromptNotFoundError, PromptTemplate, Span, type SpanKind, type SpanOptions, type TraceContextCarrier, type TraceOptions, UserPromptTemplate, __version__, bindTemplates, createPrompt, deletePrompt, fetchPrompt, flush, getMastraObservability, getPrompt, getSessionConfig, identify, init, injectTraceContext, isDebugEnabled, listPrompts, log, registerCrewaiTask, removeTag, saveAsVersion, shutdown, span, trace, updatePrompt };
package/dist/index.mjs CHANGED
@@ -5917,7 +5917,7 @@ function _resetMastraCache() {
5917
5917
  }
5918
5918
 
5919
5919
  // src/version.ts
5920
- var __version__ = "1.1.7";
5920
+ var __version__ = "1.1.8";
5921
5921
 
5922
5922
  // src/init.ts
5923
5923
  var logger13 = getLogger();
@@ -10083,8 +10083,20 @@ function recordUsage(span2, usage) {
10083
10083
  const prompt = tokenValue(usage.promptTokens ?? usage.inputTokens ?? usage.input_tokens);
10084
10084
  const completion = tokenValue(usage.completionTokens ?? usage.outputTokens ?? usage.output_tokens);
10085
10085
  const total = tokenValue(usage.totalTokens);
10086
+ const reasoning = tokenValue(
10087
+ usage.reasoningTokens ?? usage.outputTokens?.reasoning ?? usage.output_tokens?.reasoning
10088
+ );
10089
+ const cacheRead = tokenValue(
10090
+ usage.cachedInputTokens ?? usage.cacheReadInputTokens ?? usage.cache_read_input_tokens ?? usage.inputTokens?.cacheRead ?? usage.input_tokens?.cache_read
10091
+ );
10092
+ const cacheWrite = tokenValue(
10093
+ usage.cacheCreationInputTokens ?? usage.cacheWriteInputTokens ?? usage.cache_creation_input_tokens ?? usage.inputTokens?.cacheWrite ?? usage.input_tokens?.cache_write
10094
+ );
10086
10095
  if (prompt != null) span2.setAttribute("neatlogs.llm.token_count.prompt", prompt);
10087
10096
  if (completion != null) span2.setAttribute("neatlogs.llm.token_count.completion", completion);
10097
+ if (reasoning != null) span2.setAttribute("neatlogs.llm.token_count.reasoning", reasoning);
10098
+ if (cacheRead != null) span2.setAttribute("neatlogs.llm.token_count.cache_read", cacheRead);
10099
+ if (cacheWrite != null) span2.setAttribute("neatlogs.llm.token_count.cache_write", cacheWrite);
10088
10100
  if (total != null) span2.setAttribute("neatlogs.llm.token_count.total", total);
10089
10101
  else if (prompt != null && completion != null) {
10090
10102
  span2.setAttribute("neatlogs.llm.token_count.total", prompt + completion);