From 5035827a8072675fdd0357695814bbe97dcdbc61 Mon Sep 17 00:00:00 2001 From: fegloff Date: Tue, 17 Sep 2024 20:12:01 -0500 Subject: [PATCH] fix models enum issue --- src/modules/llms/llmsBase.ts | 4 ++-- src/modules/llms/utils/llmModelsManager.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/llms/llmsBase.ts b/src/modules/llms/llmsBase.ts index 15fb91a..a3b81e1 100644 --- a/src/modules/llms/llmsBase.ts +++ b/src/modules/llms/llmsBase.ts @@ -213,7 +213,7 @@ export abstract class LlmsBase implements PayableBot { continue } } - if (chatConversation.length === 0 && model !== LlmModelsEnum.O1) { + if (chatConversation.length === 0 && model !== this.modelsEnum.O1) { chatConversation.push({ role: 'system', content: config.openAi.chatGpt.chatCompletionContext, @@ -349,7 +349,7 @@ export abstract class LlmsBase implements PayableBot { ctx.chatAction = 'typing' const response = await this.chatCompletion(conversation, model, usesTools) if (response.completion) { - if (model === LlmModelsEnum.o1) { + if (model === this.modelsEnum.O1) { const msgs = splitTelegramMessage(response.completion.content as string) await ctx.api.editMessageText( ctx.chat.id, diff --git a/src/modules/llms/utils/llmModelsManager.ts b/src/modules/llms/utils/llmModelsManager.ts index 16f77c5..2d277c3 100644 --- a/src/modules/llms/utils/llmModelsManager.ts +++ b/src/modules/llms/utils/llmModelsManager.ts @@ -174,6 +174,7 @@ export type ModelCommand = (typeof LlmCommandsEnum)[keyof typeof LlmCommandsEnum export const isValidModel = llmModelManager.isValidModel.bind(llmModelManager) export const isValidCommand = llmModelManager.isValidCommand.bind(llmModelManager) -console.log(LlmCommandsEnum) +// console.log(LlmModelsEnum) +// console.log(LlmCommandsEnum) // Helper type for IntelliSense export type LlmModelsEnumType = typeof LlmModelsEnum