mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 15:19:01 +02:00
refactor(llm): remove deprecated validateEmbeddingProviders method and update session handling in chat services
This commit is contained in:
parent
3a55735cd5
commit
d8d5318ace
@ -154,14 +154,6 @@ export class AIServiceManager implements IAIServiceManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Use validateConfiguration() instead
|
|
||||||
*/
|
|
||||||
async validateEmbeddingProviders(): Promise<string | null> {
|
|
||||||
log.info('validateEmbeddingProviders is deprecated, use validateConfiguration instead');
|
|
||||||
return this.validateConfiguration();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ensure manager is initialized before using
|
* Ensure manager is initialized before using
|
||||||
*/
|
*/
|
||||||
@ -626,7 +618,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// Add validateEmbeddingProviders method
|
// Add validateEmbeddingProviders method
|
||||||
async validateEmbeddingProviders(): Promise<string | null> {
|
async validateEmbeddingProviders(): Promise<string | null> {
|
||||||
return getInstance().validateEmbeddingProviders();
|
return getInstance().validateConfiguration();
|
||||||
},
|
},
|
||||||
// Context and index related methods
|
// Context and index related methods
|
||||||
getContextExtractor() {
|
getContextExtractor() {
|
||||||
|
@ -139,13 +139,8 @@ class RestChatService {
|
|||||||
if (!session && req.method === 'POST') {
|
if (!session && req.method === 'POST') {
|
||||||
log.info(`No Chat Note found for ${chatNoteId}, creating a new Chat Note and session`);
|
log.info(`No Chat Note found for ${chatNoteId}, creating a new Chat Note and session`);
|
||||||
|
|
||||||
// Create a new Chat Note via the storage service
|
|
||||||
//const chatStorageService = (await import('../../llm/chat_storage_service.js')).default;
|
|
||||||
//const newChat = await chatStorageService.createChat('New Chat');
|
|
||||||
|
|
||||||
// Use the new Chat Note's ID for the session
|
// Use the new Chat Note's ID for the session
|
||||||
session = SessionsStore.createSession({
|
session = SessionsStore.createSession({
|
||||||
//title: newChat.title,
|
|
||||||
chatNoteId: chatNoteId
|
chatNoteId: chatNoteId
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
import log from "../../log.js";
|
import log from "../../log.js";
|
||||||
import { LLM_CONSTANTS } from '../constants/provider_constants.js';
|
import { LLM_CONSTANTS } from '../constants/provider_constants.js';
|
||||||
import { SEARCH_CONSTANTS } from '../constants/search_constants.js';
|
import { SEARCH_CONSTANTS } from '../constants/search_constants.js';
|
||||||
import { randomString } from "../../utils.js";
|
|
||||||
import type { ChatSession, ChatMessage } from '../interfaces/chat_session.js';
|
import type { ChatSession, ChatMessage } from '../interfaces/chat_session.js';
|
||||||
|
|
||||||
// In-memory storage for sessions
|
// In-memory storage for sessions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user