Skip to content

Commit

Permalink
fix models enum issue
Browse files Browse the repository at this point in the history
  • Loading branch information
fegloff committed Sep 18, 2024
1 parent 4325f1e commit 5035827
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/modules/llms/llmsBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion src/modules/llms/utils/llmModelsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5035827

Please sign in to comment.