Skip to content

Commit

Permalink
Merge pull request elizaOS#1408 from harperaa/1223-fix-todos
Browse files Browse the repository at this point in the history
fix: resolve TODO to make model more dynamic and generic
  • Loading branch information
shakkernerd authored Dec 26, 2024
2 parents e14b4f8 + ab3a49e commit 5bee33b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/client-discord/src/actions/chat_with_attachments.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { composeContext } from "@elizaos/core";
import { generateText, trimTokens } from "@elizaos/core";
import type { TiktokenModel } from "js-tiktoken";
import { models } from "@elizaos/core";
import { parseJSONObjectFromText } from "@elizaos/core";
import {
Expand Down Expand Up @@ -194,10 +195,12 @@ const summarizeAction = {
const context = composeContext({
state,
// make sure it fits, we can pad the tokens a bit
// Get the model's tokenizer based on the current model being used
template: trimTokens(
summarizationTemplate,
chunkSize + 500,
"gpt-4o-mini" // TODO: make this dynamic and generic
(model.model[ModelClass.SMALL] ||
"gpt-4o-mini") as TiktokenModel // Use the same model as generation; Fallback if no SMALL model configured
),
});

Expand Down

0 comments on commit 5bee33b

Please # to comment.