mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-22 02:47:19 +00:00
refactor(chatbot): make user parameter in startOrContinueChat type-safe
This commit is contained in:
@@ -5,6 +5,8 @@ import { paginateQuery, type PaginatedData } from '@shumai/core/src/pagination'
|
||||
import type { ChatRequest, ChatSessionInfo, ChatMessage } from '@shumai/dtos'
|
||||
import { ulid } from 'ulid'
|
||||
|
||||
type User = Prisma.UserGetPayload<Record<string, never>>
|
||||
|
||||
export function mapEntryToMessage(
|
||||
entryRecord: Prisma.AgentSessionEntryGetPayload<Record<string, never>>,
|
||||
): ChatMessage {
|
||||
@@ -77,9 +79,8 @@ export class ChatService {
|
||||
return parts.join('/')
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
async startOrContinueChat(
|
||||
user: any,
|
||||
user: User,
|
||||
req: ChatRequest,
|
||||
): Promise<{ sessionId: string; taskId: string }> {
|
||||
const {
|
||||
|
||||
Reference in New Issue
Block a user