From cc7a3661b7dccda04583947b54758dfe23afd0d0 Mon Sep 17 00:00:00 2001 From: JT2M0L3Y Date: Sun, 23 Feb 2025 21:24:35 -0700 Subject: [PATCH] Update: fix imports based on last pkg fix --- src/client.ts | 2 +- src/events/messageCreate.ts | 2 +- src/utils/events.ts | 2 +- src/utils/handlers/streamHandler.ts | 3 +-- src/utils/messageNormal.ts | 5 ++--- tests/queue.test.ts | 2 +- 6 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/client.ts b/src/client.ts index ba905c6..fdf22a3 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1,7 +1,7 @@ import { Client, GatewayIntentBits } from 'discord.js' import { Ollama } from 'ollama' import { createClient } from 'redis' -import { Queue } from './queues/queue.js' +import { Queue } from './components/index.js' import { UserMessage, registerEvents } from './utils/index.js' import Events from './events/index.js' import Keys from './keys.js' diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts index 5ec6fa0..186d320 100644 --- a/src/events/messageCreate.ts +++ b/src/events/messageCreate.ts @@ -1,6 +1,6 @@ import { TextChannel } from 'discord.js' -import { event, Events, normalMessage, UserMessage, clean } from '../utils/index.js' import { + event, Events, normalMessage, UserMessage, clean, getChannelInfo, getServerConfig, getUserConfig, openChannelInfo, openConfig, UserConfig, getAttachmentData, getTextFileAttachmentData } from '../utils/index.js' diff --git a/src/utils/events.ts b/src/utils/events.ts index 6bb34a4..3a33dd1 100644 --- a/src/utils/events.ts +++ b/src/utils/events.ts @@ -1,6 +1,6 @@ import type { ClientEvents, Awaitable, Client } from 'discord.js' import { Ollama } from 'ollama' -import { Queue } from '../queues/queue.js' +import { Queue } from '../components/index.js' // Export events through here to reduce amount of imports export { Events } from 'discord.js' diff --git a/src/utils/handlers/streamHandler.ts b/src/utils/handlers/streamHandler.ts index 48b5e6f..890a6b8 100644 --- a/src/utils/handlers/streamHandler.ts +++ b/src/utils/handlers/streamHandler.ts @@ -1,6 +1,5 @@ -import { ChatResponse } from "ollama" +import { ChatResponse, AbortableAsyncIterator } from "ollama" import { ChatParams } from "../index.js" -import { AbortableAsyncIterator } from "ollama/src/utils.js" /** * Method to query the Ollama client for async generation diff --git a/src/utils/messageNormal.ts b/src/utils/messageNormal.ts index 5659ccc..9d89582 100644 --- a/src/utils/messageNormal.ts +++ b/src/utils/messageNormal.ts @@ -1,8 +1,7 @@ import { Message, SendableChannels } from 'discord.js' -import { ChatResponse, Ollama } from 'ollama' +import { ChatResponse, Ollama, AbortableAsyncIterator } from 'ollama' import { ChatParams, UserMessage, streamResponse, blockResponse } from './index.js' -import { Queue } from '../queues/queue.js' -import { AbortableAsyncIterator } from 'ollama/src/utils.js' +import { Queue } from '../components/index.js' /** * Method to send replies as normal text on discord like any other user diff --git a/tests/queue.test.ts b/tests/queue.test.ts index 83c1e89..000a561 100644 --- a/tests/queue.test.ts +++ b/tests/queue.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { Queue } from '../src/queues/queue.js' +import { Queue } from '../src/components/index.js' /** * Queue test suite, tests the Queue class