fix false truncation
This commit is contained in:
@@ -129,15 +129,15 @@ class AuditService {
|
||||
this.addEntry(
|
||||
phase,
|
||||
'ai-decision',
|
||||
{ prompt: this.truncatePrompt(aiPrompt) },
|
||||
{ response: this.truncateResponse(aiResponse) },
|
||||
{ prompt: this.createPromptSummary(aiPrompt) }, // Summary for display only
|
||||
{ response: aiResponse }, // STORE FULL RESPONSE - NO TRUNCATION
|
||||
confidence,
|
||||
startTime,
|
||||
{
|
||||
...metadata,
|
||||
reasoning,
|
||||
aiPrompt: aiPrompt,
|
||||
aiResponse: aiResponse,
|
||||
aiPrompt: aiPrompt, // Full prompt in metadata
|
||||
aiResponse: aiResponse, // Full response in metadata
|
||||
decisionBasis: 'ai-analysis'
|
||||
}
|
||||
);
|
||||
@@ -425,13 +425,13 @@ class AuditService {
|
||||
if (type === 'input') {
|
||||
if (data.prompt) {
|
||||
const promptPreview = data.prompt.slice(0, 80).replace(/\n/g, ' ');
|
||||
return `KI-Prompt: ${promptPreview}...`;
|
||||
return `KI-Prompt: ${promptPreview}${data.prompt.length > 80 ? ' [Vorschau]' : ''}`;
|
||||
}
|
||||
return 'KI-Analyse angefordert';
|
||||
} else {
|
||||
if (data.response) {
|
||||
const responsePreview = data.response.slice(0, 80).replace(/\n/g, ' ');
|
||||
return `KI-Antwort: ${responsePreview}...`;
|
||||
return `KI-Antwort: ${responsePreview}${data.response.length > 80 ? ' [Vorschau]' : ''}`;
|
||||
}
|
||||
return 'KI-Analyse abgeschlossen';
|
||||
}
|
||||
@@ -446,8 +446,10 @@ class AuditService {
|
||||
}
|
||||
|
||||
case 'tool-added-to-phase':
|
||||
if (type === 'input') {
|
||||
return `${data.toolName} → ${data.phaseId} (${data.taskRelevance}% Relevanz, ${data.priority})`;
|
||||
if (type === 'output') {
|
||||
const justificationPreview = data.justification ?
|
||||
data.justification.slice(0, 60).replace(/\n/g, ' ') + (data.justification.length > 60 ? ' [Vorschau]' : '') : 'Hinzugefügt';
|
||||
return `Begründung: ${justificationPreview}`;
|
||||
} else {
|
||||
const justificationPreview = data.justification ?
|
||||
data.justification.slice(0, 60).replace(/\n/g, ' ') + '...' : 'Hinzugefügt';
|
||||
@@ -512,6 +514,11 @@ class AuditService {
|
||||
return String(data);
|
||||
}
|
||||
|
||||
private createPromptSummary(prompt: string): string {
|
||||
if (!prompt || prompt.length <= 200) return prompt;
|
||||
return prompt.slice(0, 200) + ' [Eingabe-Vorschau]';
|
||||
}
|
||||
|
||||
private generateSpecificReasoning(
|
||||
action: string,
|
||||
input: any,
|
||||
@@ -572,16 +579,6 @@ class AuditService {
|
||||
}
|
||||
}
|
||||
|
||||
private truncatePrompt(prompt: string): string {
|
||||
if (!prompt || prompt.length <= 200) return prompt;
|
||||
return prompt.slice(0, 200) + '...[gekürzt]';
|
||||
}
|
||||
|
||||
private truncateResponse(response: string): string {
|
||||
if (!response || response.length <= 300) return response;
|
||||
return response.slice(0, 300) + '...[gekürzt]';
|
||||
}
|
||||
|
||||
private getPhaseDisplayName(phaseId: string): string {
|
||||
const phaseNames: Record<string, string> = {
|
||||
'preparation': 'Vorbereitung',
|
||||
|
||||
Reference in New Issue
Block a user