From ada867076aaa6e135b32a9c94267c09bc08a604a Mon Sep 17 00:00:00 2001 From: Mateusz Baginski Date: Wed, 25 Dec 2024 17:04:34 +0100 Subject: [PATCH] feat(sdk): add `files` entry to `SdkMessageV` --- .../dashboard/messages/dto/sdk-message-file.dto.ts | 12 ++++++++++++ .../dashboard/messages/dto/sdk-message.dto.ts | 2 ++ 2 files changed, 14 insertions(+) create mode 100644 packages/sdk/src/modules/dashboard/messages/dto/sdk-message-file.dto.ts diff --git a/packages/sdk/src/modules/dashboard/messages/dto/sdk-message-file.dto.ts b/packages/sdk/src/modules/dashboard/messages/dto/sdk-message-file.dto.ts new file mode 100644 index 00000000..95f87f5f --- /dev/null +++ b/packages/sdk/src/modules/dashboard/messages/dto/sdk-message-file.dto.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +import { SdkTableRowWithIdV } from '~/shared'; + +import { SdkBaseS3ResourceV } from '../../s3-files/dto/sdk-base-s3-resource.dto'; + +export const SdkMessageFileV = z.object({ + resource: SdkBaseS3ResourceV, +}) + .merge(SdkTableRowWithIdV); + +export type SdkProjectFileT = z.infer; diff --git a/packages/sdk/src/modules/dashboard/messages/dto/sdk-message.dto.ts b/packages/sdk/src/modules/dashboard/messages/dto/sdk-message.dto.ts index d376f40a..ae608aa4 100644 --- a/packages/sdk/src/modules/dashboard/messages/dto/sdk-message.dto.ts +++ b/packages/sdk/src/modules/dashboard/messages/dto/sdk-message.dto.ts @@ -7,6 +7,7 @@ import { } from '~/shared'; import { SdkUserListItemV } from '../../users/dto/sdk-user-list-item.dto'; +import { SdkMessageFileV } from './sdk-message-file.dto'; export const SdkMessageRoleV = z.enum(['user', 'assistant', 'system']); @@ -30,6 +31,7 @@ export const SdkMessageV = z aiModel: SdkTableRowWithIdNameV.nullable(), app: SdkTableRowWithIdNameV.nullable(), repliedMessage: SdkRepliedMessageV.nullable(), + files: z.array(SdkMessageFileV), }) .merge(SdkTableRowWithUuidV) .merge(SdkTableRowWithDatesV);