fix: resolve TypeScript compilation errors in batch processing

- Fix type assertion for session access in batchProcessor.ts
- Add explicit type annotation for batchRequests array in processingScheduler.ts
- Import AIProcessingRequest type from Prisma client
- All TypeScript compilation errors resolved
This commit is contained in:
2025-07-05 16:54:58 +02:00
committed by Kaj Kowalski
parent 7d80ffe704
commit f2a3d87636
2 changed files with 3 additions and 2 deletions

View File

@ -152,7 +152,7 @@ export async function createBatchRequest(
},
{
role: "user",
content: formatMessagesForProcessing(request.session?.messages || []),
content: formatMessagesForProcessing((request as any).session?.messages || []),
},
],
temperature: 0.1,

View File

@ -5,6 +5,7 @@ import {
type SentimentCategory,
type SessionCategory,
AIRequestStatus,
type AIProcessingRequest,
} from "@prisma/client";
import cron from "node-cron";
import fetch from "node-fetch";
@ -877,7 +878,7 @@ async function createBatchRequestsForSessions(batchSize: number | null = null):
}
// Create AI processing requests for batch processing
const batchRequests = [];
const batchRequests: AIProcessingRequest[] = [];
for (const session of sessionsWithMessages) {
try {
// Get company's AI model