mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 18:39:22 +08:00
fix chunking imports again
This commit is contained in:
parent
53c756be4f
commit
40bbdb2faa
@ -50,8 +50,8 @@ export interface ChunkOptions {
|
||||
* Default options for chunking
|
||||
*/
|
||||
async function getDefaultChunkOptions(): Promise<Required<ChunkOptions>> {
|
||||
// Import constants dynamically to avoid circular dependencies
|
||||
const { LLM_CONSTANTS } = await import('../../../routes/api/llm.js');
|
||||
// Import constants directly
|
||||
const { LLM_CONSTANTS } = await import('../constants/provider_constants.js');
|
||||
|
||||
return {
|
||||
maxChunkSize: LLM_CONSTANTS.CHUNKING.DEFAULT_SIZE,
|
||||
|
@ -4,6 +4,7 @@ import sql from "../../../sql.js";
|
||||
import becca from "../../../../becca/becca.js";
|
||||
import cls from "../../../../services/cls.js";
|
||||
import type { NoteEmbeddingContext } from "../types.js";
|
||||
import { LLM_CONSTANTS } from "../../../llm/constants/provider_constants.js";
|
||||
// Remove static imports that cause circular dependencies
|
||||
// import { storeNoteEmbedding, deleteNoteEmbeddings } from "./storage.js";
|
||||
|
||||
@ -120,8 +121,8 @@ export async function processNoteWithChunking(
|
||||
{
|
||||
// Adjust chunk size based on provider using constants
|
||||
maxChunkSize: provider.name === 'ollama' ?
|
||||
(await import('../../../llm/constants/provider_constants.js')).LLM_CONSTANTS.CHUNKING.OLLAMA_SIZE :
|
||||
(await import('../../../llm/constants/provider_constants.js')).LLM_CONSTANTS.CHUNKING.DEFAULT_SIZE,
|
||||
LLM_CONSTANTS.CHUNKING.OLLAMA_SIZE :
|
||||
LLM_CONSTANTS.CHUNKING.DEFAULT_SIZE,
|
||||
respectBoundaries: true
|
||||
}
|
||||
);
|
||||
|
@ -37,8 +37,8 @@ export async function cleanNoteContent(content: string, type: string, mime: stri
|
||||
// Trim the content
|
||||
content = content.trim();
|
||||
|
||||
// Import constants dynamically to avoid circular dependencies
|
||||
const { LLM_CONSTANTS } = await import('../../../routes/api/llm.js');
|
||||
// Import constants directly
|
||||
const { LLM_CONSTANTS } = await import('../constants/provider_constants.js');
|
||||
// Truncate if extremely long
|
||||
if (content.length > LLM_CONSTANTS.CONTENT.MAX_TOTAL_CONTENT_LENGTH) {
|
||||
content = content.substring(0, LLM_CONSTANTS.CONTENT.MAX_TOTAL_CONTENT_LENGTH) + ' [content truncated]';
|
||||
|
Loading…
x
Reference in New Issue
Block a user