Skip to content

Commit 05f1c90

Browse files
committed
APICall + AgentLogger hotfix
1 parent 1655c00 commit 05f1c90

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@smythos/sre",
3-
"version": "1.5.53",
3+
"version": "1.5.54",
44
"description": "Smyth Runtime Environment",
55
"author": "Alaa-eddine KADDOURI",
66
"license": "MIT",

packages/core/src/subsystems/AgentManager/AgentLogger.class.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Agent } from './Agent.class';
22

3-
import { encode } from 'gpt-tokenizer';
3+
//import { encode } from 'gpt-tokenizer';
44
import { AgentCallLog } from '@sre/types/AgentLogger.types';
55
import { debounce, delay, getDayFormattedDate, uid } from '@sre/utils';
66
import { Logger } from '@sre/helpers/Log.helper';
@@ -93,10 +93,14 @@ class LogTransaction {
9393
if (sourceCptName) sourceId += `@${sourceCptName}@${curStepOrder}`;
9494
if (componentCptName) componentId += `@${componentCptName}@${nextStepOrder}`;
9595

96-
const inputTokensObj = encode(typeof firstData.input == 'string' ? firstData.input : JSON.stringify(firstData.input) || '');
97-
const outputTokensObj = encode(typeof firstData.output == 'string' ? firstData.output : JSON.stringify(firstData.output) || '');
98-
const inputTokens = inputTokensObj.length || undefined;
99-
const outputTokens = outputTokensObj.length || undefined;
96+
//const inputTokensObj = encode(typeof firstData.input == 'string' ? firstData.input : JSON.stringify(firstData.input) || '');
97+
//const outputTokensObj = encode(typeof firstData.output == 'string' ? firstData.output : JSON.stringify(firstData.output) || '');
98+
//const inputTokens = inputTokensObj.length || undefined;
99+
//const outputTokens = outputTokensObj.length || undefined;
100+
101+
//token length calculation uses high CPU and does not bring much value ==> disabled
102+
const inputTokens = undefined;
103+
const outputTokens = undefined;
100104

101105
const tags = firstData.tags || '';
102106
let raw_error =

0 commit comments

Comments
 (0)