File tree 1 file changed +4
-1
lines changed
packages/client-discord/src/actions
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 1
1
import { composeContext } from "@elizaos/core" ;
2
2
import { generateText , trimTokens } from "@elizaos/core" ;
3
+ import type { TiktokenModel } from "js-tiktoken" ;
3
4
import { models } from "@elizaos/core" ;
4
5
import { parseJSONObjectFromText } from "@elizaos/core" ;
5
6
import {
@@ -194,10 +195,12 @@ const summarizeAction = {
194
195
const context = composeContext ( {
195
196
state,
196
197
// make sure it fits, we can pad the tokens a bit
198
+ // Get the model's tokenizer based on the current model being used
197
199
template : trimTokens (
198
200
summarizationTemplate ,
199
201
chunkSize + 500 ,
200
- "gpt-4o-mini" // TODO: make this dynamic and generic
202
+ ( model . model [ ModelClass . SMALL ] ||
203
+ "gpt-4o-mini" ) as TiktokenModel // Use the same model as generation; Fallback if no SMALL model configured
201
204
) ,
202
205
} ) ;
203
206
You can’t perform that action at this time.
0 commit comments