Skip to content

Commit 5307537

Browse files
committed
hotfix : SDK not reporting tokens usage
1 parent 34b7909 commit 5307537

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

examples/01-agent-code-skill/04.1-chat-planner-coder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Agent, Chat, Component, Model, TAgentMode, TLLMEvent } from '@smythos/sdk';
22
import chalk from 'chalk';
33
import * as readline from 'readline';
4-
import { EmitUnit, PluginAPI, PluginBase, TokenLoom } from 'tokenloom';
4+
import { EmitUnit, PluginBase, TokenLoom } from 'tokenloom';
55

66
//Show the tasks list and status to the user at every step before performing the tasks, and also give a tasks status summary after tasks.
77
//When you display the tasks list to a user show it in a concise way with a summary and checkboxes for each task.

packages/sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@smythos/sdk",
3-
"version": "1.1.4",
3+
"version": "1.1.5",
44
"description": "SRE SDK",
55
"keywords": [
66
"smythos",

packages/sdk/src/Agent/Agent.class.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ class AgentCommand {
203203

204204
conversation.on(TLLMEvent.ToolCall, toolCallHandler);
205205
conversation.on(TLLMEvent.ToolResult, toolResultHandler);
206+
conversation.on(TLLMEvent.Usage, usageHandler);
206207
conversation.on(TLLMEvent.End, endHandler);
207208
conversation.on(TLLMEvent.Error, errorHandler);
208209
conversation.on(TLLMEvent.Content, contentHandler);

packages/sdk/src/LLM/Chat.class.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ class ChatCommand {
137137

138138
this._conversation.on(TLLMEvent.ToolCall, toolCallHandler);
139139
this._conversation.on(TLLMEvent.ToolResult, toolResultHandler);
140+
this._conversation.on(TLLMEvent.Usage, usageHandler);
140141
this._conversation.on(TLLMEvent.End, endHandler);
141142
this._conversation.on(TLLMEvent.Error, errorHandler);
142143
this._conversation.on(TLLMEvent.Content, contentHandler);

0 commit comments

Comments
 (0)