{ "console.log('Final LLM model used (default):', llmModel ? llmModel.name : '无');": "console.log('Final LLM model used (default):', llmModel ? llmModel.name : '无');", "`data: ${JSON.stringify({ type: 'error', data: '请在模型管理中添加LLM模型并配置API密钥' })}\\n\\n`,": "`data: ${JSON.stringify({ type: 'error', data: 'Please add LLM model and configure API key in model management' })}\\n\\n`,", "`data: ${JSON.stringify({ type: 'error', data: error.message || '服务器错误' })}\\n\\n`,": "`data: ${JSON.stringify({ type: 'error', data: error.message || 'Server Error' })}\\n\\n`,", "`data: ${JSON.stringify({ type: 'error', data: '未找到LLM模型配置' })}\\n\\n`,": "`data: ${JSON.stringify({ type: 'error', data: 'LLM model configuration not found' })}\\n\\n`,", "console.log('ユーザーID:', userId);": "console.log('User ID:', userId);", "console.log('API Key プレフィックス:', modelConfig.apiKey?.substring(0, 10) + '...');": "console.log('API Key prefix:', modelConfig.apiKey?.substring(0, 10) + '...');", "提供されたテキスト内容を、ユーザーの指示に基づいて修正または改善してください。": "Correct or improve the provided text content based on your instructions.", "挨拶や結びの言葉(「わかりました、こちらが...」など)は含めず、修正後の内容のみを直接出力してください。": "Please do not include any greetings or closing words (such as \"Okay, this is...\") and directly output only the revised content.", "コンテキスト(現在の内容):": "Context (current contents):", "ユーザーの指示:": "User instructions:", "1. **段落与结构**:": "1. **Paragraph and Structure**:", "- 使用清晰的段落分隔,每个要点之间空一行": "- Use clear paragraph separation with a blank line between each bullet point", "- 使用标题(## 或 ###)组织长回答": "- Use headings (## or ###) to organize long answers", "2. **文本格式**:": "2. **Text Format**:", "- 使用 **粗体** 强调重要概念和关键词": "- Use **bold** to emphasize important concepts and keywords", "- 使用列表(- 或 1.)组织多个要点": "- Use lists (- or 1.) to organize multiple points", "- 使用 \\`代码\\` 标记技术术语、命令、文件名": "- Use \\`code\\` to mark technical terms, commands, file names", "3. **代码展示**:": "3. **Code display**:", "- 使用代码块展示代码,并指定语言:": "- Use code blocks to display code and specify the language:", "return \"示例\"": "return \"example\"", "- 支持语言:python, javascript, typescript, java, bash, sql 等": "- Supported languages: python, javascript, typescript, java, bash, sql, etc.", "4. **图表与可视化**:": "4. **Charts and Visualization**:", "- 使用 Mermaid 语法绘制流程图、序列图等:": "- Use Mermaid syntax to draw flowcharts, sequence diagrams, etc.:", "A[开始] --> B[处理]": "A[Start] --> B[Process]", "B --> C[结束]": "B --> C[end]", "- 适用场景:流程、架构、状态机、时序图": "- Applicable scenarios: process, architecture, state machine, sequence diagram", "5. **其他要求**:": "5. **Other requirements**:", "- 回答精炼准确": "- Answer concisely and accurately", "- 多步骤操作使用有序列表": "- Use ordered lists for multi-step operations", "- 对比类信息建议用表格展示(如果适用)": "- It is recommended to display comparative information in tables (if applicable)", "ナレッジベースの内容:": "Knowledge base contents:", "会話履歴:": "Conversation history:", "ユーザーの質問:{question}": "User question: {question}", "1. **段落と構造**:": "1. **Paragraphs and Structure**:", "- 明確な段落分けを使用し、要点間に空行を入れる": "- Use clear paragraphing and leave blank lines between main points", "- 長い回答には見出し(## または ###)を使用": "- Use headings (## or ###) for long answers", "2. **テキスト書式**:": "2. **Text Format**:", "- 重要な概念やキーワードを強調するために **太字** を使用": "- Use **bold** to highlight important concepts and keywords", "- 複数のポイントを整理するためにリスト(- または 1.)を使用": "- Use lists (- or 1.) to organize multiple points", "- 技術用語、コマンド、ファイル名をマークするために \\`コード\\` を使用": "- Use \\`code\\` to mark technical terms, commands, and file names", "3. **コード表示**:": "3. **Code display**:", "- 言語を指定してコードブロックを使用:": "- Use code blocks by specifying language:", "return \"例\"": "return \"Example\"", "- 対応言語:python, javascript, typescript, java, bash, sql など": "- Supported languages: python, javascript, typescript, java, bash, sql, etc.", "4. **図表とチャート**:": "4. **Diagrams and Charts**:", "- フローチャート、シーケンス図などに Mermaid 構文を使用:": "- Use Mermaid syntax for flowcharts, sequence diagrams, etc:", "A[開始] --> B[処理]": "A[Start] --> B[Process]", "B --> C[終了]": "B --> C[End]", "- 使用例:プロセスフロー、アーキテクチャ図、状態図、シーケンス図": "- Usage examples: process flow, architecture diagram, state diagram, sequence diagram", "5. **その他の要件**:": "5. **Other Requirements**:", "- 簡潔で明確な回答を心がける": "- Keep your answers concise and clear", "- 複数のステップがある場合は番号付きリストを使用": "- Use numbered lists when there are multiple steps", "- 比較情報には表を使用(該当する場合)": "- Use tables for comparative information (if applicable)", "インテリジェントアシスタントとして、ユーザーの質問に答えてください。": "Become an intelligent assistant and answer users' questions.", "只返回标题文本。不要包含任何解释性文字或前导词(如“标题是:”)。": "Only the title text is returned. Do not include any explanatory text or leading words (such as \"The title is:\").", "语言:Chinese": "Language: Chinese", "文本内容:": "Text content:", "タイトルテキストのみを返してください。説明文や前置き(例:「タイトルは:」)は含めないでください。": "Please return only the title text. Do not include descriptive text or prefaces (e.g. \"The title is:\").", "言語:Japanese": "Language: Japanese", "テキスト:": "text:", "return `根据以下对话片段,生成一个简短、描述性的标题(不超过50个字符),总结讨论的主题。": "return `Based on the following conversation snippet, generate a short, descriptive title (no more than 50 characters) summarizing the topic of the discussion.", "只返回标题文本。不要包含任何前导词。": "Only the title text is returned. Do not include any leading words.", "用户: ${userMessage}": "User: ${userMessage}", "助手: ${aiResponse}`;": "Helper: ${aiResponse}`;", "return `以下の会話スニペットに基づいて、トピックを要約する短く説明的なタイトル(最大50文字)を生成してください。": "return `Generate a short, descriptive title (up to 50 characters) that summarizes the topic based on the conversation snippet below.", "タイトルのみを返してください。前置きは不要です。": "Please return only the title. No preface necessary.", "ユーザー: ${userMessage}": "User: ${userMessage}", "アシスタント: ${aiResponse}`;": "Assistant: ${aiResponse}`;", "const providerName = modelConfig.providerName || '不明';": "const providerName = modelConfig.providerName || '不明';", "` - プロバイダー: ${providerName}\\n` +": "` - Provider: ${providerName}\\n` +", "` - Token制限: ${maxInputTokens}\\n` +": "` - Token limit: ${maxInputTokens}\\n` +", "` - ベクトルモデルか: ${isVectorModel}`,": "` - Vector model: ${isVectorModel}`,", "`Chunk size: ${chunkSize} tokens (制限: ${limits.maxInputTokens})`,": "`Chunk size: ${chunkSize} tokens (制限: ${limits.maxInputTokens})`,", "`重なりサイズ: ${chunkOverlap} tokens`,": "`Overlap size: ${chunkOverlap} tokens`,", "`バッチサイズ: ${limits.maxBatchSize}`,": "`Batch size: ${limits.maxBatchSize}`,", "throw new Error(`埋め込みモデル設定 ${embeddingModelConfigId} が見つかりません`);": "throw new Error(`Embedded model configuration ${embeddingModelConfigId} not found`);", "throw new Error(`モデル ${modelConfig.name} は無効化されているため、埋め込みベクトルを生成できません`);": "throw new Error(`Unable to generate embedding vector because model ${modelConfig.name} is disabled`);", "throw new Error(`モデル ${modelConfig.name} に baseUrl が設定されていません`);": "throw new Error(`baseUrl not set for model ${modelConfig.name}`);", "`総計 ${totalLength} 文字、平均 ${Math.round(avgLength)} 文字、` +": "`Total ${totalLength} characters, average ${Math.round(avgLength)} characters, ` +", "`モデル制限: ${modelConfig.maxInputTokens || 8192} tokens`": "`Model limit: ${modelConfig.maxInputTokens || 8192} tokens`", "`テキスト長がモデルの制限。` +": "`Text length is a limitation of the model. ` +", "`現在: ${texts.length} 個のテキストで計 ${totalLength} 文字、` +": "`Currently: ${texts.length} texts totaling ${totalLength} characters, ` +", "`モデル制限: ${modelConfig.maxInputTokens || 8192} tokens。` +": "`Model limit: ${modelConfig.maxInputTokens || 8192} tokens. ` +", "`アドバイス: Chunk sizeまたはバッチサイズを小さくしてください`": "`Advice: Reduce chunk size or batch size`", "this.logger.error(`リクエストパラメータ: model=${modelConfig.modelId}, inputLength=${texts[0]?.length}`);": "this.logger.error(`Request parameters: model=${modelConfig.modelId}, inputLength=${texts[0]?.length}`);", "throw new Error(`埋め込み API の呼び出しに失敗しました: ${response.statusText} - ${errorText}`);": "throw new Error(`Embedded API call failed: ${response.statusText} - ${errorText}`);", "if (error.message && (error.message.includes('context length') || error.message.includes('コンテキスト長 exceeds limit ') || error.message.includes('コンテキスト長 exceeds limit '))) {": "if (error.message && (error.message.includes('context length') || error.message.includes('context length exceeds limit ') || error.message.includes('context length exceeds limit '))) {", "throw new NotFoundException('ファイルが存在しません');": "throw new NotFoundException('File does not exist');", "throw new Error(`メモリ待機がタイムアウトしました: 現在 ${this.getMemoryUsage().heapUsed}MB > ${this.MAX_MEMORY_MB * 0.85}MB`);": "throw new Error(`Memory wait timed out: Currently ${this.getMemoryUsage().heapUsed}MB > ${this.MAX_MEMORY_MB * 0.85}MB`);", "throw new Error(`ファイルが存在しません: ${filePath}`);": "throw new Error(`File does not exist: ${filePath}`);", "throw new Error('変換がタイムアウトしました。ファイルが大きすぎる可能性があります');": "throw new Error('Conversion timed out. File may be too large');", "throw new Error(`変換に失敗しました: ${detail}`);": "throw new Error(`Conversion failed: ${detail}`);", "throw new Error(`変換に失敗しました: ${lastError.message}`);": "throw new Error(`Conversion failed: ${lastError.message}`);", "throw new Error('LibreOffice サービスが実行されていません。サービスの状態を確認してください');": "throw new Error('LibreOffice service is not running. Please check the status of the service');", "throw new Error('LibreOffice サービスとの接続が切断されました。サービスが不安定である可能性があります');": "throw new Error('The connection to the LibreOffice service has been lost. The service may be unstable');", "@Min(1, { message: 'ベクトル次元の最小値は 1 です' })": "@Min(1, { message: 'The minimum value of the vector dimension is 1' })", "@Max(4096, { message: 'ベクトル次元の最大値は 4096 です(Elasticsearch の制限)' })": "@Max(4096, { message: 'The maximum vector dimension is 4096 (Elasticsearch limit)' })", "throw new Error(`PDF ファイルが存在しません: ${pdfPath}`);": "throw new Error(`PDF file does not exist: ${pdfPath}`);", "throw new Error('PDF のページ数を取得できません');": "throw new Error('Unable to get page number of PDF');", "throw new Error(`Python での変換に失敗しました: ${result.error}`);": "throw new Error(`Python conversion failed: ${result.error}`);", "throw new Error(`PDF から画像への変換に失敗しました: ${error.message}`);": "throw new Error(`PDF to image conversion failed: ${error.message}`);", "throw new Error('Embedding model IDが提供されていません');": "throw new Error('Embedding model ID not provided');", "return { message: '对话历史删除成功' };": "return { message: 'Conversation history deleted successfully' };", "`ユーザー ${req.user.id} がファイルをアップロードしました: ${file.originalname} (${this.formatBytes(file.size)})`,": "`User ${req.user.id} uploaded file: ${file.originalname} (${this.formatBytes(file.size)})`,", "console.log('パスワード:', randomPassword);": "console.log('Password:', randomPassword);", "console.log('=== updateLanguage デバッグ ===');": "console.log('=== updateLanguage Debug ===');", "console.log('=== getLanguage デバッグ ===');": "console.log('=== getLanguage Debug ===');", "page: pageIndex ? ` (第 ${pageIndex} ページ)` : '',": "page: pageIndex ? ` (th page ${pageIndex})` : '',", "if (errorCode === 429 || errorMessage.includes('rate limit') || errorMessage.includes('リクエストが多すぎます')) {": "if (errorCode === 429 || errorMessage.includes('rate limit') || errorMessage.includes('Too many requests')) {", "return { isGood: false, reason: `ファイルが小さすぎます (${sizeKB.toFixed(2)}KB)`, score: 0 };": "return { isGood: false, reason: `File is too small (${sizeKB.toFixed(2)}KB)`, score: 0 };", "return { isGood: false, reason: `ファイルが大きすぎます (${sizeKB.toFixed(2)}KB)`, score: 0 };": "return { isGood: false, reason: `File is too large (${sizeKB.toFixed(2)}KB)`, score: 0 };", "reason: `クォータ不足: 残り $${quota.remaining.toFixed(2)}, 必要 $${estimatedCost.toFixed(2)}`,": "reason: `Insufficient quota: remaining $${quota.remaining.toFixed(2)}, required $${estimatedCost.toFixed(2)}`,", "throw new Error(`ユーザー ${userId} は存在しません`);": "throw new Error(`User ${userId} does not exist`);", "message: `⚠️ クォータ使用率が ${usagePercent.toFixed(1)}% に達しました。残り $${quota.remaining.toFixed(2)}`,": "message: `⚠️ Quota usage has reached ${usagePercent.toFixed(1)}%. Remaining $${quota.remaining.toFixed(2)}`,", "message: `💡 クォータ使用率 ${usagePercent.toFixed(1)}%。コストの管理に注意してください`,": "message: `💡 Quota usage ${usagePercent.toFixed(1)}%. Be careful with controlling costs`,", "return `${seconds.toFixed(0)}秒`;": "return `${seconds.toFixed(0)}秒`;", "return `${minutes}分${remainingSeconds.toFixed(0)}秒`;": "return `${minutes}分${remainingSeconds.toFixed(0)}秒`;", "this.updateStatus('converting', 10, 'ドキュメント形式を変換中...');": "this.updateStatus('converting', 10, 'Converting document format...');", "this.updateStatus('splitting', 30, 'PDF を画像に変換中...');": "this.updateStatus('splitting', 30, 'Converting PDF to image...');", "throw new Error('PDF から画像への変換に失敗しました。画像が生成されませんでした');": "throw new Error('PDF to image conversion failed. No image was generated');", "this.updateStatus('checking', 40, 'クォータを確認し、コストを見積もり中...');": "this.updateStatus('checking', 40, 'Checking quotas and estimating costs...');", "this.updateStatus('analyzing', 50, 'ビジョンモデルを使用してページをAnalyzing...');": "this.updateStatus('analyzing', 50, 'Analyzing the page using the vision model...');", "this.updateStatus('completed', 100, '処理が完了しました。一時ファイルをクリーンアップ中...');": "this.updateStatus('completed', 100, 'Processing completed. Cleaning up temporary files...');", "throw new Error(`モデル設定が見つかりません: ${modelId}`);": "throw new Error(`Model configuration not found: ${modelId}`);", "reason: `サポートされていないファイル形式です: ${ext}`,": "reason: `Unsupported file format: ${ext}`,", "warnings: ['Fast Mode(テキスト抽出のみ)を使用します'],": "warnings: ['Using Fast Mode (text extraction only)'],", "reason: `形式 ${ext} はPrecise Modeをサポートしていません`,": "reason: `Format ${ext} does not support Precise Mode`,", "reason: 'ファイルが大きいため、完全な情報を保持するためにPrecise Modeを推奨します',": "reason: 'Due to large files, Precise Mode is recommended to retain complete information',", "warnings: ['処理時間が長くなる可能性があります', 'API 費用が発生します'],": "warnings: ['Processing time may be longer', 'API charges may apply'],", "reason: 'Precise Modeが利用可能です。テキストと画像の混合コンテンツを保持できます',": "reason: 'Precise Mode is available. Can hold mixed content of text and images',", "warnings: ['API 費用が発生します'],": "warnings: ['API charges will apply']," }