fix bug deploy
Browse files
src/routes/triage.route.ts
CHANGED
|
@@ -246,17 +246,15 @@ export async function triageRoutes(
|
|
| 246 |
const totalExecutionTime = Date.now() - startTime;
|
| 247 |
|
| 248 |
// Add assistant response to conversation history
|
| 249 |
-
let assistantMessageId: string | undefined;
|
| 250 |
try {
|
| 251 |
// Use markdown message if available, otherwise fallback to recommendation.action
|
| 252 |
const assistantMessage = (triageResult as any).message || triageResult.recommendation.action;
|
| 253 |
-
|
| 254 |
activeSessionId,
|
| 255 |
user_id,
|
| 256 |
assistantMessage,
|
| 257 |
triageResult
|
| 258 |
);
|
| 259 |
-
assistantMessageId = assistantMessageObj.id;
|
| 260 |
} catch (error) {
|
| 261 |
logger.error({ error }, 'Failed to save conversation history');
|
| 262 |
// Continue even if saving fails
|
|
|
|
| 246 |
const totalExecutionTime = Date.now() - startTime;
|
| 247 |
|
| 248 |
// Add assistant response to conversation history
|
|
|
|
| 249 |
try {
|
| 250 |
// Use markdown message if available, otherwise fallback to recommendation.action
|
| 251 |
const assistantMessage = (triageResult as any).message || triageResult.recommendation.action;
|
| 252 |
+
await conversationService.addAssistantMessage(
|
| 253 |
activeSessionId,
|
| 254 |
user_id,
|
| 255 |
assistantMessage,
|
| 256 |
triageResult
|
| 257 |
);
|
|
|
|
| 258 |
} catch (error) {
|
| 259 |
logger.error({ error }, 'Failed to save conversation history');
|
| 260 |
// Continue even if saving fails
|
src/services/report-generation.service.ts
CHANGED
|
@@ -138,7 +138,7 @@ export class ReportGenerationService {
|
|
| 138 |
sessionData: any,
|
| 139 |
conversationHistory: any[],
|
| 140 |
toolExecutions: any[],
|
| 141 |
-
|
| 142 |
): Promise<ComprehensiveReport['report_content']> {
|
| 143 |
// Extract summary data
|
| 144 |
const mainConcerns: string[] = [];
|
|
|
|
| 138 |
sessionData: any,
|
| 139 |
conversationHistory: any[],
|
| 140 |
toolExecutions: any[],
|
| 141 |
+
_reportType: string
|
| 142 |
): Promise<ComprehensiveReport['report_content']> {
|
| 143 |
// Extract summary data
|
| 144 |
const mainConcerns: string[] = [];
|
src/services/tool-execution-tracker.service.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
import { SupabaseClient } from '@supabase/supabase-js';
|
| 2 |
import { logger } from '../utils/logger.js';
|
| 3 |
-
import { v4 as uuidv4 } from 'uuid';
|
| 4 |
|
| 5 |
export interface ToolExecution {
|
| 6 |
tool_name: string;
|
|
|
|
| 1 |
import { SupabaseClient } from '@supabase/supabase-js';
|
| 2 |
import { logger } from '../utils/logger.js';
|
|
|
|
| 3 |
|
| 4 |
export interface ToolExecution {
|
| 5 |
tool_name: string;
|
src/utils/tool-tracking-helper.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
import { ToolExecutionTrackerService, type ToolExecution } from '../services/tool-execution-tracker.service.js';
|
| 2 |
-
import { logger } from './logger.js';
|
| 3 |
import type { TriageResult } from '../types/index.js';
|
| 4 |
|
| 5 |
/**
|
|
@@ -13,7 +12,7 @@ export class ToolTrackingHelper {
|
|
| 13 |
static async trackCVExecution(
|
| 14 |
tracker: ToolExecutionTrackerService,
|
| 15 |
sessionId: string,
|
| 16 |
-
|
| 17 |
triageResult: TriageResult,
|
| 18 |
executionTime: number
|
| 19 |
): Promise<void> {
|
|
@@ -56,7 +55,7 @@ export class ToolTrackingHelper {
|
|
| 56 |
static async trackRAGExecution(
|
| 57 |
tracker: ToolExecutionTrackerService,
|
| 58 |
sessionId: string,
|
| 59 |
-
|
| 60 |
triageResult: TriageResult,
|
| 61 |
userText: string,
|
| 62 |
executionTime: number,
|
|
@@ -90,7 +89,7 @@ export class ToolTrackingHelper {
|
|
| 90 |
static async trackTriageRulesExecution(
|
| 91 |
tracker: ToolExecutionTrackerService,
|
| 92 |
sessionId: string,
|
| 93 |
-
|
| 94 |
triageResult: TriageResult,
|
| 95 |
userText: string,
|
| 96 |
executionTime: number
|
|
@@ -121,7 +120,7 @@ export class ToolTrackingHelper {
|
|
| 121 |
static async trackMapsExecution(
|
| 122 |
tracker: ToolExecutionTrackerService,
|
| 123 |
sessionId: string,
|
| 124 |
-
|
| 125 |
nearestClinic: any,
|
| 126 |
condition: string | undefined,
|
| 127 |
executionTime: number
|
|
|
|
| 1 |
import { ToolExecutionTrackerService, type ToolExecution } from '../services/tool-execution-tracker.service.js';
|
|
|
|
| 2 |
import type { TriageResult } from '../types/index.js';
|
| 3 |
|
| 4 |
/**
|
|
|
|
| 12 |
static async trackCVExecution(
|
| 13 |
tracker: ToolExecutionTrackerService,
|
| 14 |
sessionId: string,
|
| 15 |
+
_messageId: string,
|
| 16 |
triageResult: TriageResult,
|
| 17 |
executionTime: number
|
| 18 |
): Promise<void> {
|
|
|
|
| 55 |
static async trackRAGExecution(
|
| 56 |
tracker: ToolExecutionTrackerService,
|
| 57 |
sessionId: string,
|
| 58 |
+
_messageId: string,
|
| 59 |
triageResult: TriageResult,
|
| 60 |
userText: string,
|
| 61 |
executionTime: number,
|
|
|
|
| 89 |
static async trackTriageRulesExecution(
|
| 90 |
tracker: ToolExecutionTrackerService,
|
| 91 |
sessionId: string,
|
| 92 |
+
_messageId: string,
|
| 93 |
triageResult: TriageResult,
|
| 94 |
userText: string,
|
| 95 |
executionTime: number
|
|
|
|
| 120 |
static async trackMapsExecution(
|
| 121 |
tracker: ToolExecutionTrackerService,
|
| 122 |
sessionId: string,
|
| 123 |
+
_messageId: string,
|
| 124 |
nearestClinic: any,
|
| 125 |
condition: string | undefined,
|
| 126 |
executionTime: number
|