Skip to content

Commit

Permalink
feat(sdk): add files entry to SdkMessageV
Browse files Browse the repository at this point in the history
  • Loading branch information
Mati365 committed Dec 25, 2024
1 parent d1d5b73 commit ada8670
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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<typeof SdkMessageFileV>;
Original file line number Diff line number Diff line change
Expand Up @@ -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']);

Expand All @@ -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);
Expand Down

0 comments on commit ada8670

Please sign in to comment.