@butlerbot/sdk 0.0.6-alpha.0 → 0.0.6-alpha.2

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.
@@ -24,22 +24,95 @@ export type BaseAIResponseMetadataV4 = {
24
24
  /** Epoch time for when this happened (represents time of last action, meaning in streamed messages it'll hold the time the last chunk was sent) */
25
25
  timestamp: number;
26
26
  };
27
+ export type TokenUsageV4 = {
28
+ /**
29
+ * The total number of input (prompt) tokens used.
30
+ */
31
+ inputTokens: number | undefined;
32
+ /**
33
+ * Detailed information about the input tokens.
34
+ */
35
+ inputTokenDetails: {
36
+ /**
37
+ * The number of non-cached input (prompt) tokens used.
38
+ */
39
+ noCacheTokens: number | undefined;
40
+ /**
41
+ * The number of cached input (prompt) tokens read.
42
+ */
43
+ cacheReadTokens: number | undefined;
44
+ /**
45
+ * The number of cached input (prompt) tokens written.
46
+ */
47
+ cacheWriteTokens: number | undefined;
48
+ };
49
+ /**
50
+ * The number of total output (completion) tokens used.
51
+ */
52
+ outputTokens: number | undefined;
53
+ /**
54
+ * Detailed information about the output tokens.
55
+ */
56
+ outputTokenDetails: {
57
+ /**
58
+ * The number of text tokens used.
59
+ */
60
+ textTokens: number | undefined;
61
+ /**
62
+ * The number of reasoning tokens used.
63
+ */
64
+ reasoningTokens: number | undefined;
65
+ };
66
+ /**
67
+ * The total number of tokens used.
68
+ */
69
+ totalTokens: number | undefined;
70
+ /**
71
+ * Raw usage information from the provider.
72
+ *
73
+ * This is the usage information in the shape that the provider returns.
74
+ * It can include additional information that is not part of the standard usage information.
75
+ */
76
+ raw?: any;
77
+ };
78
+ export type ModelMessageCostV4 = {
79
+ inputCost: number;
80
+ outputCost: number;
81
+ totalCost: number;
82
+ inputCostDetails: {
83
+ noCacheCost: number;
84
+ cacheReadCost: number;
85
+ cacheWriteCost: number;
86
+ };
87
+ outputCostDetails: {
88
+ textCost: number;
89
+ reasoningCost: number;
90
+ };
91
+ };
27
92
  /** Response Metadata */
28
93
  export type ResponseStatusMetadataV4 = {
29
94
  /** Human-readable model name (e.g. "Claude-Sonnet") */
30
95
  model: string;
31
96
  /** Provider model identifier (e.g. "claude-sonnet-4-6") */
32
97
  modelId: string;
98
+ /** Model-specific information */
99
+ modelInfo: {
100
+ /** Maximum context length for this model */
101
+ contextLimit?: number;
102
+ };
33
103
  /** Token usage breakdown */
34
- tokens: {
35
- input: number;
36
- output: number;
37
- total: number;
38
- cachedInput: number;
39
- reasoningOutput: number;
104
+ tokens: TokenUsageV4;
105
+ /** The cost breakdown */
106
+ cost: {
107
+ /** The cost of the current turn */
108
+ turnCost?: ModelMessageCostV4;
109
+ /** The current user's usage cost */
110
+ dailyUsageCost: number;
111
+ /** The user's cost limit for the conversation (e.g., daily limit) */
112
+ dailyUsageCostLimit: number;
40
113
  };
41
114
  /** Usage budget info */
42
- usage: {
115
+ limit: {
43
116
  /** Current usage cost as a percentage of daily limit (0–1) */
44
117
  percentage: number;
45
118
  /** Human-readable percentage (e.g. "42.3%") */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@butlerbot/sdk",
3
- "version": "0.0.6-alpha.0",
3
+ "version": "0.0.6-alpha.2",
4
4
  "description": "The official ButlerBot SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",