cleaned_prod

This commit is contained in:
kenilkb 2026-07-27 09:30:05 +05:30
parent 61126a546a
commit c298b557c6

View File

@ -12,9 +12,9 @@ export interface CitationItem {
export class ChatService { export class ChatService {
private extractionService = new ExtractionService(); private extractionService = new ExtractionService();
private gatewayUrl = process.env.LLM_GATEWAY_URL || 'https://llm-devs.tech4biz.org/v1'; private gatewayUrl = process.env.LLM_GATEWAY_URL;
private apiKey = process.env.LLM_API_KEY || 'sk-TM-gxAudDVRTY-kq7_enEA'; private apiKey = process.env.LLM_API_KEY;
private modelId = process.env.LLM_MODEL_ID || 'deepseek-chat'; private modelId = process.env.LLM_MODEL_ID;
/** /**
* Process a user chat prompt with RBAC-scoped, unified RAG retrieval across Assets, Showcase Reels, Ecosystem Offerings, and Legal Documents. * Process a user chat prompt with RBAC-scoped, unified RAG retrieval across Assets, Showcase Reels, Ecosystem Offerings, and Legal Documents.
@ -613,31 +613,31 @@ Portal Navigation Guidelines:
// Strict Citation Filtering: Only include Verified Knowledge Source citations if user explicitly attached entities or asked for asset/resource recommendations // Strict Citation Filtering: Only include Verified Knowledge Source citations if user explicitly attached entities or asked for asset/resource recommendations
const isGeneralHelpQuery = promptLower.includes('password') || const isGeneralHelpQuery = promptLower.includes('password') ||
promptLower.includes('theme') || promptLower.includes('theme') ||
promptLower.includes('appearance') || promptLower.includes('appearance') ||
promptLower.includes('profile') || promptLower.includes('profile') ||
promptLower.includes('how to log') || promptLower.includes('how to log') ||
promptLower.includes('how to sign') || promptLower.includes('how to sign') ||
promptLower.includes('help'); promptLower.includes('help');
const hasAssetKeywords = promptLower.includes('asset') || const hasAssetKeywords = promptLower.includes('asset') ||
promptLower.includes('recommend') || promptLower.includes('recommend') ||
promptLower.includes('find') || promptLower.includes('find') ||
promptLower.includes('search') || promptLower.includes('search') ||
promptLower.includes('show') || promptLower.includes('show') ||
promptLower.includes('list') || promptLower.includes('list') ||
promptLower.includes('what are') || promptLower.includes('what are') ||
promptLower.includes('is there') || promptLower.includes('is there') ||
promptLower.includes('are there') || promptLower.includes('are there') ||
promptLower.includes('showcase') || promptLower.includes('showcase') ||
promptLower.includes('agreement') || promptLower.includes('agreement') ||
promptLower.includes('legal') || promptLower.includes('legal') ||
promptLower.includes('document') || promptLower.includes('document') ||
promptLower.includes('video') || promptLower.includes('video') ||
promptLower.includes('reel') || promptLower.includes('reel') ||
promptLower.includes('offering') || promptLower.includes('offering') ||
promptLower.includes('which are') || promptLower.includes('which are') ||
promptLower.includes('tell me more'); promptLower.includes('tell me more');
const finalCitations = (hasAttachedEntities || (hasAssetKeywords && !isGeneralHelpQuery)) const finalCitations = (hasAttachedEntities || (hasAssetKeywords && !isGeneralHelpQuery))
? Array.from(citationsMap.values()) ? Array.from(citationsMap.values())