@aws-amplify/data-schema 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ClientSchema/ai/ClientConversation.js +6 -0
- package/dist/cjs/ClientSchema/ai/ClientConversation.js.map +1 -0
- package/dist/cjs/CustomOperation.js +22 -2
- package/dist/cjs/CustomOperation.js.map +1 -1
- package/dist/cjs/SchemaProcessor.js +41 -5
- package/dist/cjs/SchemaProcessor.js.map +1 -1
- package/dist/cjs/a.js +9 -1
- package/dist/cjs/a.js.map +1 -1
- package/dist/cjs/ai/ConversationSchemaTypes.js +210 -0
- package/dist/cjs/ai/ConversationSchemaTypes.js.map +1 -0
- package/dist/cjs/ai/ConversationType.js +27 -0
- package/dist/cjs/ai/ConversationType.js.map +1 -0
- package/dist/cjs/ai/ModelType.js +37 -0
- package/dist/cjs/ai/ModelType.js.map +1 -0
- package/dist/cjs/ai/types/ConversationMessageContent.js +6 -0
- package/dist/cjs/ai/types/ConversationMessageContent.js.map +1 -0
- package/dist/cjs/ai/types/ToolConfiguration.js +6 -0
- package/dist/cjs/ai/types/ToolConfiguration.js.map +1 -0
- package/dist/cjs/ai/types/ToolResultContent.js +6 -0
- package/dist/cjs/ai/types/ToolResultContent.js.map +1 -0
- package/dist/cjs/ai/types/contentBlocks.js +6 -0
- package/dist/cjs/ai/types/contentBlocks.js.map +1 -0
- package/dist/cjs/runtime/addSchemaToClient.js +2 -0
- package/dist/cjs/runtime/addSchemaToClient.js.map +1 -1
- package/dist/cjs/runtime/internals/APIClient.js +3 -3
- package/dist/cjs/runtime/internals/APIClient.js.map +1 -1
- package/dist/cjs/runtime/internals/ai/conversationMessageDeserializers.js +54 -0
- package/dist/cjs/runtime/internals/ai/conversationMessageDeserializers.js.map +1 -0
- package/dist/cjs/runtime/internals/ai/conversationMessageSerializers.js +58 -0
- package/dist/cjs/runtime/internals/ai/conversationMessageSerializers.js.map +1 -0
- package/dist/cjs/runtime/internals/ai/convertItemToConversation.js +22 -0
- package/dist/cjs/runtime/internals/ai/convertItemToConversation.js.map +1 -0
- package/dist/cjs/runtime/internals/ai/convertItemToConversationMessage.js +16 -0
- package/dist/cjs/runtime/internals/ai/convertItemToConversationMessage.js.map +1 -0
- package/dist/cjs/runtime/internals/ai/createCreateConversationFunction.js +18 -0
- package/dist/cjs/runtime/internals/ai/createCreateConversationFunction.js.map +1 -0
- package/dist/cjs/runtime/internals/ai/createGetConversationFunction.js +20 -0
- package/dist/cjs/runtime/internals/ai/createGetConversationFunction.js.map +1 -0
- package/dist/cjs/runtime/internals/ai/createListConversationsFunction.js +21 -0
- package/dist/cjs/runtime/internals/ai/createListConversationsFunction.js.map +1 -0
- package/dist/cjs/runtime/internals/ai/createListMessagesFunction.js +22 -0
- package/dist/cjs/runtime/internals/ai/createListMessagesFunction.js.map +1 -0
- package/dist/cjs/runtime/internals/ai/createOnMessageFunction.js +22 -0
- package/dist/cjs/runtime/internals/ai/createOnMessageFunction.js.map +1 -0
- package/dist/cjs/runtime/internals/ai/createSendMessageFunction.js +32 -0
- package/dist/cjs/runtime/internals/ai/createSendMessageFunction.js.map +1 -0
- package/dist/cjs/runtime/internals/index.js +5 -1
- package/dist/cjs/runtime/internals/index.js.map +1 -1
- package/dist/cjs/runtime/internals/operations/custom.js +17 -10
- package/dist/cjs/runtime/internals/operations/custom.js.map +1 -1
- package/dist/cjs/runtime/internals/utils/clientProperties/generateConversationsProperty.js +48 -0
- package/dist/cjs/runtime/internals/utils/clientProperties/generateConversationsProperty.js.map +1 -0
- package/dist/cjs/runtime/internals/utils/clientProperties/generateGenerationsProperty.js +22 -0
- package/dist/cjs/runtime/internals/utils/clientProperties/generateGenerationsProperty.js.map +1 -0
- package/dist/esm/ClientSchema/Core/ClientSchemaProperty.d.ts +1 -1
- package/dist/esm/ClientSchema/ai/ClientConversation.d.ts +7 -0
- package/dist/esm/ClientSchema/ai/ClientConversation.mjs +2 -0
- package/dist/esm/ClientSchema/ai/ClientConversation.mjs.map +1 -0
- package/dist/esm/ClientSchema/index.d.ts +12 -2
- package/dist/esm/CustomOperation.d.ts +33 -2
- package/dist/esm/CustomOperation.mjs +21 -2
- package/dist/esm/CustomOperation.mjs.map +1 -1
- package/dist/esm/ModelSchema.d.ts +3 -1
- package/dist/esm/SchemaProcessor.d.ts +1 -1
- package/dist/esm/SchemaProcessor.mjs +41 -5
- package/dist/esm/SchemaProcessor.mjs.map +1 -1
- package/dist/esm/a.d.ts +7 -2
- package/dist/esm/a.mjs +9 -1
- package/dist/esm/a.mjs.map +1 -1
- package/dist/esm/ai/ConversationSchemaTypes.d.ts +3 -0
- package/dist/esm/ai/ConversationSchemaTypes.mjs +208 -0
- package/dist/esm/ai/ConversationSchemaTypes.mjs.map +1 -0
- package/dist/esm/ai/ConversationType.d.ts +102 -0
- package/dist/esm/ai/ConversationType.mjs +25 -0
- package/dist/esm/ai/ConversationType.mjs.map +1 -0
- package/dist/esm/ai/ModelType.d.ts +30 -0
- package/dist/esm/ai/ModelType.mjs +34 -0
- package/dist/esm/ai/ModelType.mjs.map +1 -0
- package/dist/esm/ai/types/ConversationMessageContent.d.ts +27 -0
- package/dist/esm/ai/types/ConversationMessageContent.mjs +2 -0
- package/dist/esm/ai/types/ConversationMessageContent.mjs.map +1 -0
- package/dist/esm/ai/types/ToolConfiguration.d.ts +18 -0
- package/dist/esm/ai/types/ToolConfiguration.mjs +2 -0
- package/dist/esm/ai/types/ToolConfiguration.mjs.map +1 -0
- package/dist/esm/ai/types/ToolResultContent.d.ts +18 -0
- package/dist/esm/ai/types/ToolResultContent.mjs +2 -0
- package/dist/esm/ai/types/ToolResultContent.mjs.map +1 -0
- package/dist/esm/ai/types/contentBlocks.d.ts +19 -0
- package/dist/esm/ai/types/contentBlocks.mjs +2 -0
- package/dist/esm/ai/types/contentBlocks.mjs.map +1 -0
- package/dist/esm/runtime/addSchemaToClient.mjs +4 -0
- package/dist/esm/runtime/addSchemaToClient.mjs.map +1 -1
- package/dist/esm/runtime/addSchemaToClientWithInstance.mjs +2 -1
- package/dist/esm/runtime/addSchemaToClientWithInstance.mjs.map +1 -1
- package/dist/esm/runtime/bridge-types.d.ts +29 -3
- package/dist/esm/runtime/client/index.d.ts +35 -19
- package/dist/esm/runtime/internals/APIClient.mjs +3 -3
- package/dist/esm/runtime/internals/APIClient.mjs.map +1 -1
- package/dist/esm/runtime/internals/ai/conversationMessageDeserializers.d.ts +2 -0
- package/dist/esm/runtime/internals/ai/conversationMessageDeserializers.mjs +52 -0
- package/dist/esm/runtime/internals/ai/conversationMessageDeserializers.mjs.map +1 -0
- package/dist/esm/runtime/internals/ai/conversationMessageSerializers.d.ts +37 -0
- package/dist/esm/runtime/internals/ai/conversationMessageSerializers.mjs +54 -0
- package/dist/esm/runtime/internals/ai/conversationMessageSerializers.mjs.map +1 -0
- package/dist/esm/runtime/internals/ai/convertItemToConversation.d.ts +3 -0
- package/dist/esm/runtime/internals/ai/convertItemToConversation.mjs +20 -0
- package/dist/esm/runtime/internals/ai/convertItemToConversation.mjs.map +1 -0
- package/dist/esm/runtime/internals/ai/convertItemToConversationMessage.d.ts +7 -0
- package/dist/esm/runtime/internals/ai/convertItemToConversationMessage.mjs +14 -0
- package/dist/esm/runtime/internals/ai/convertItemToConversationMessage.mjs.map +1 -0
- package/dist/esm/runtime/internals/ai/createCreateConversationFunction.d.ts +3 -0
- package/dist/esm/runtime/internals/ai/createCreateConversationFunction.mjs +16 -0
- package/dist/esm/runtime/internals/ai/createCreateConversationFunction.mjs.map +1 -0
- package/dist/esm/runtime/internals/ai/createGetConversationFunction.d.ts +3 -0
- package/dist/esm/runtime/internals/ai/createGetConversationFunction.mjs +18 -0
- package/dist/esm/runtime/internals/ai/createGetConversationFunction.mjs.map +1 -0
- package/dist/esm/runtime/internals/ai/createListConversationsFunction.d.ts +3 -0
- package/dist/esm/runtime/internals/ai/createListConversationsFunction.mjs +19 -0
- package/dist/esm/runtime/internals/ai/createListConversationsFunction.mjs.map +1 -0
- package/dist/esm/runtime/internals/ai/createListMessagesFunction.d.ts +3 -0
- package/dist/esm/runtime/internals/ai/createListMessagesFunction.mjs +20 -0
- package/dist/esm/runtime/internals/ai/createListMessagesFunction.mjs.map +1 -0
- package/dist/esm/runtime/internals/ai/createOnMessageFunction.d.ts +3 -0
- package/dist/esm/runtime/internals/ai/createOnMessageFunction.mjs +20 -0
- package/dist/esm/runtime/internals/ai/createOnMessageFunction.mjs.map +1 -0
- package/dist/esm/runtime/internals/ai/createSendMessageFunction.d.ts +3 -0
- package/dist/esm/runtime/internals/ai/createSendMessageFunction.mjs +30 -0
- package/dist/esm/runtime/internals/ai/createSendMessageFunction.mjs.map +1 -0
- package/dist/esm/runtime/internals/index.d.ts +2 -0
- package/dist/esm/runtime/internals/index.mjs +2 -0
- package/dist/esm/runtime/internals/index.mjs.map +1 -1
- package/dist/esm/runtime/internals/operations/custom.d.ts +1 -1
- package/dist/esm/runtime/internals/operations/custom.mjs +17 -10
- package/dist/esm/runtime/internals/operations/custom.mjs.map +1 -1
- package/dist/esm/runtime/internals/utils/clientProperties/generateConversationsProperty.d.ts +3 -0
- package/dist/esm/runtime/internals/utils/clientProperties/generateConversationsProperty.mjs +46 -0
- package/dist/esm/runtime/internals/utils/clientProperties/generateConversationsProperty.mjs.map +1 -0
- package/dist/esm/runtime/internals/utils/clientProperties/generateGenerationsProperty.d.ts +3 -0
- package/dist/esm/runtime/internals/utils/clientProperties/generateGenerationsProperty.mjs +20 -0
- package/dist/esm/runtime/internals/utils/clientProperties/generateGenerationsProperty.mjs.map +1 -0
- package/dist/meta/cjs.tsbuildinfo +1 -1
- package/package.json +3 -1
- package/src/ClientSchema/Core/ClientSchemaProperty.ts +3 -1
- package/src/ClientSchema/ai/ClientConversation.ts +15 -0
- package/src/ClientSchema/index.ts +15 -1
- package/src/CustomOperation.ts +48 -5
- package/src/ModelSchema.ts +4 -1
- package/src/SchemaProcessor.ts +73 -8
- package/src/a.ts +10 -1
- package/src/ai/ConversationSchemaTypes.ts +253 -0
- package/src/ai/ConversationType.ts +135 -0
- package/src/ai/ModelType.ts +43 -0
- package/src/ai/types/ConversationMessageContent.ts +43 -0
- package/src/ai/types/ToolConfiguration.ts +24 -0
- package/src/ai/types/ToolResultContent.ts +28 -0
- package/src/ai/types/contentBlocks.ts +26 -0
- package/src/runtime/addSchemaToClient.ts +12 -0
- package/src/runtime/bridge-types.ts +41 -4
- package/src/runtime/client/index.ts +82 -23
- package/src/runtime/internals/APIClient.ts +3 -4
- package/src/runtime/internals/ai/conversationMessageDeserializers.ts +62 -0
- package/src/runtime/internals/ai/conversationMessageSerializers.ts +68 -0
- package/src/runtime/internals/ai/convertItemToConversation.ts +53 -0
- package/src/runtime/internals/ai/convertItemToConversationMessage.ts +18 -0
- package/src/runtime/internals/ai/createCreateConversationFunction.ts +44 -0
- package/src/runtime/internals/ai/createGetConversationFunction.ts +48 -0
- package/src/runtime/internals/ai/createListConversationsFunction.ts +46 -0
- package/src/runtime/internals/ai/createListMessagesFunction.ts +42 -0
- package/src/runtime/internals/ai/createOnMessageFunction.ts +41 -0
- package/src/runtime/internals/ai/createSendMessageFunction.ts +60 -0
- package/src/runtime/internals/index.ts +2 -0
- package/src/runtime/internals/operations/custom.ts +24 -12
- package/src/runtime/internals/utils/clientProperties/generateConversationsProperty.ts +91 -0
- package/src/runtime/internals/utils/clientProperties/generateGenerationsProperty.ts +41 -0
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
__modelMeta__,
|
|
9
9
|
} from '@aws-amplify/data-schema-types';
|
|
10
10
|
import type { Observable } from 'rxjs';
|
|
11
|
+
import type { ConversationRoute } from '../../ai/ConversationType';
|
|
11
12
|
import type {
|
|
12
13
|
ClientSchemaByEntityType,
|
|
13
14
|
ClientSchemaByEntityTypeBaseShape,
|
|
@@ -511,31 +512,45 @@ type ModelTypesClient<
|
|
|
511
512
|
// Omit any disabled operations
|
|
512
513
|
Omit<
|
|
513
514
|
{
|
|
514
|
-
create
|
|
515
|
+
create<
|
|
516
|
+
SelectionSet extends ReadonlyArray<ModelPath<FlatModel>> = never[],
|
|
517
|
+
>(
|
|
515
518
|
model: Model['createType'],
|
|
516
519
|
options?: {
|
|
520
|
+
selectionSet?: SelectionSet;
|
|
517
521
|
authMode?: AuthMode;
|
|
518
522
|
authToken?: string;
|
|
519
523
|
headers?: CustomHeaders;
|
|
520
524
|
},
|
|
521
|
-
)
|
|
522
|
-
|
|
525
|
+
): SingularReturnValue<
|
|
526
|
+
Prettify<ReturnValue<Model, FlatModel, SelectionSet>>
|
|
527
|
+
>;
|
|
528
|
+
update<
|
|
529
|
+
SelectionSet extends ReadonlyArray<ModelPath<FlatModel>> = never[],
|
|
530
|
+
>(
|
|
523
531
|
model: Model['updateType'],
|
|
524
532
|
options?: {
|
|
533
|
+
selectionSet?: SelectionSet;
|
|
525
534
|
authMode?: AuthMode;
|
|
526
535
|
authToken?: string;
|
|
527
536
|
headers?: CustomHeaders;
|
|
528
537
|
},
|
|
529
|
-
)
|
|
530
|
-
|
|
538
|
+
): SingularReturnValue<
|
|
539
|
+
Prettify<ReturnValue<Model, FlatModel, SelectionSet>>
|
|
540
|
+
>;
|
|
541
|
+
delete<
|
|
542
|
+
SelectionSet extends ReadonlyArray<ModelPath<FlatModel>> = never[],
|
|
543
|
+
>(
|
|
531
544
|
identifier: Model['deleteType'],
|
|
532
545
|
options?: {
|
|
546
|
+
selectionSet?: SelectionSet;
|
|
533
547
|
authMode?: AuthMode;
|
|
534
548
|
authToken?: string;
|
|
535
549
|
headers?: CustomHeaders;
|
|
536
550
|
},
|
|
537
|
-
)
|
|
538
|
-
|
|
551
|
+
): SingularReturnValue<
|
|
552
|
+
Prettify<ReturnValue<Model, FlatModel, SelectionSet>>
|
|
553
|
+
>;
|
|
539
554
|
get<SelectionSet extends ReadonlyArray<ModelPath<FlatModel>> = never[]>(
|
|
540
555
|
identifier: Model['identifier'],
|
|
541
556
|
options?: {
|
|
@@ -558,7 +573,6 @@ type ModelTypesClient<
|
|
|
558
573
|
headers?: CustomHeaders;
|
|
559
574
|
},
|
|
560
575
|
): ListReturnValue<Prettify<ReturnValue<Model, FlatModel, SelectionSet>>>;
|
|
561
|
-
|
|
562
576
|
onCreate<
|
|
563
577
|
SelectionSet extends ReadonlyArray<ModelPath<FlatModel>> = never[],
|
|
564
578
|
>(options?: {
|
|
@@ -610,33 +624,48 @@ type ModelTypesSSRCookies<
|
|
|
610
624
|
Model extends ClientSchemaByEntityTypeBaseShape['models'][string],
|
|
611
625
|
FlatModel extends Record<string, unknown> = ResolvedModel<Model['type']>,
|
|
612
626
|
> = IndexQueryMethods<Model> &
|
|
627
|
+
// Omit any disabled operations
|
|
613
628
|
Omit<
|
|
614
629
|
{
|
|
615
|
-
create
|
|
630
|
+
create<
|
|
631
|
+
SelectionSet extends ReadonlyArray<ModelPath<FlatModel>> = never[],
|
|
632
|
+
>(
|
|
616
633
|
model: Model['createType'],
|
|
617
634
|
options?: {
|
|
635
|
+
selectionSet?: SelectionSet;
|
|
618
636
|
authMode?: AuthMode;
|
|
619
637
|
authToken?: string;
|
|
620
638
|
headers?: CustomHeaders;
|
|
621
639
|
},
|
|
622
|
-
)
|
|
623
|
-
|
|
640
|
+
): SingularReturnValue<
|
|
641
|
+
Prettify<ReturnValue<Model, FlatModel, SelectionSet>>
|
|
642
|
+
>;
|
|
643
|
+
update<
|
|
644
|
+
SelectionSet extends ReadonlyArray<ModelPath<FlatModel>> = never[],
|
|
645
|
+
>(
|
|
624
646
|
model: Model['updateType'],
|
|
625
647
|
options?: {
|
|
648
|
+
selectionSet?: SelectionSet;
|
|
626
649
|
authMode?: AuthMode;
|
|
627
650
|
authToken?: string;
|
|
628
651
|
headers?: CustomHeaders;
|
|
629
652
|
},
|
|
630
|
-
)
|
|
631
|
-
|
|
653
|
+
): SingularReturnValue<
|
|
654
|
+
Prettify<ReturnValue<Model, FlatModel, SelectionSet>>
|
|
655
|
+
>;
|
|
656
|
+
delete<
|
|
657
|
+
SelectionSet extends ReadonlyArray<ModelPath<FlatModel>> = never[],
|
|
658
|
+
>(
|
|
632
659
|
identifier: Model['deleteType'],
|
|
633
660
|
options?: {
|
|
661
|
+
selectionSet?: SelectionSet;
|
|
634
662
|
authMode?: AuthMode;
|
|
635
663
|
authToken?: string;
|
|
636
664
|
headers?: CustomHeaders;
|
|
637
665
|
},
|
|
638
|
-
)
|
|
639
|
-
|
|
666
|
+
): SingularReturnValue<
|
|
667
|
+
Prettify<ReturnValue<Model, FlatModel, SelectionSet>>
|
|
668
|
+
>;
|
|
640
669
|
get<SelectionSet extends ReadonlyArray<ModelPath<FlatModel>> = never[]>(
|
|
641
670
|
identifier: Model['identifier'],
|
|
642
671
|
options?: {
|
|
@@ -668,36 +697,51 @@ type ModelTypesSSRRequest<
|
|
|
668
697
|
Model extends ClientSchemaByEntityTypeBaseShape['models'][string],
|
|
669
698
|
FlatModel extends Record<string, unknown> = ResolvedModel<Model['type']>,
|
|
670
699
|
> = IndexQueryMethods<Model, 'REQUEST'> &
|
|
700
|
+
// Omit any disabled operations
|
|
671
701
|
Omit<
|
|
672
702
|
{
|
|
673
|
-
create
|
|
703
|
+
create<
|
|
704
|
+
SelectionSet extends ReadonlyArray<ModelPath<FlatModel>> = never[],
|
|
705
|
+
>(
|
|
674
706
|
contextSpec: AmplifyServer.ContextSpec,
|
|
675
707
|
model: Model['createType'],
|
|
676
708
|
options?: {
|
|
709
|
+
selectionSet?: SelectionSet;
|
|
677
710
|
authMode?: AuthMode;
|
|
678
711
|
authToken?: string;
|
|
679
712
|
headers?: CustomHeaders;
|
|
680
713
|
},
|
|
681
|
-
)
|
|
682
|
-
|
|
714
|
+
): SingularReturnValue<
|
|
715
|
+
Prettify<ReturnValue<Model, FlatModel, SelectionSet>>
|
|
716
|
+
>;
|
|
717
|
+
update<
|
|
718
|
+
SelectionSet extends ReadonlyArray<ModelPath<FlatModel>> = never[],
|
|
719
|
+
>(
|
|
683
720
|
contextSpec: AmplifyServer.ContextSpec,
|
|
684
721
|
model: Model['updateType'],
|
|
685
722
|
options?: {
|
|
723
|
+
selectionSet?: SelectionSet;
|
|
686
724
|
authMode?: AuthMode;
|
|
687
725
|
authToken?: string;
|
|
688
726
|
headers?: CustomHeaders;
|
|
689
727
|
},
|
|
690
|
-
)
|
|
691
|
-
|
|
728
|
+
): SingularReturnValue<
|
|
729
|
+
Prettify<ReturnValue<Model, FlatModel, SelectionSet>>
|
|
730
|
+
>;
|
|
731
|
+
delete<
|
|
732
|
+
SelectionSet extends ReadonlyArray<ModelPath<FlatModel>> = never[],
|
|
733
|
+
>(
|
|
692
734
|
contextSpec: AmplifyServer.ContextSpec,
|
|
693
735
|
identifier: Model['deleteType'],
|
|
694
736
|
options?: {
|
|
737
|
+
selectionSet?: SelectionSet;
|
|
695
738
|
authMode?: AuthMode;
|
|
696
739
|
authToken?: string;
|
|
697
740
|
headers?: CustomHeaders;
|
|
698
741
|
},
|
|
699
|
-
)
|
|
700
|
-
|
|
742
|
+
): SingularReturnValue<
|
|
743
|
+
Prettify<ReturnValue<Model, FlatModel, SelectionSet>>
|
|
744
|
+
>;
|
|
701
745
|
get<SelectionSet extends ReadonlyArray<ModelPath<FlatModel>> = never[]>(
|
|
702
746
|
contextSpec: AmplifyServer.ContextSpec,
|
|
703
747
|
identifier: Model['identifier'],
|
|
@@ -781,7 +825,8 @@ export type CustomOperations<
|
|
|
781
825
|
OperationDefs extends ClientSchemaByEntityTypeBaseShape[
|
|
782
826
|
| 'queries'
|
|
783
827
|
| 'mutations'
|
|
784
|
-
| 'subscriptions'
|
|
828
|
+
| 'subscriptions'
|
|
829
|
+
| 'generations'],
|
|
785
830
|
Context extends ContextType = 'CLIENT',
|
|
786
831
|
> = {
|
|
787
832
|
[OpName in keyof OperationDefs]: {
|
|
@@ -857,6 +902,8 @@ export type ClientExtensions<T extends Record<any, any> = never> = {
|
|
|
857
902
|
queries: CustomQueries<T, 'CLIENT'>;
|
|
858
903
|
mutations: CustomMutations<T, 'CLIENT'>;
|
|
859
904
|
subscriptions: CustomSubscriptions<T, 'CLIENT'>;
|
|
905
|
+
conversations: ConversationRoutes<T>;
|
|
906
|
+
generations: Generations<T>;
|
|
860
907
|
};
|
|
861
908
|
|
|
862
909
|
export type ClientExtensionsSSRRequest<T extends Record<any, any> = never> = {
|
|
@@ -872,3 +919,15 @@ export type ClientExtensionsSSRCookies<T extends Record<any, any> = never> = {
|
|
|
872
919
|
queries: CustomQueries<T, 'COOKIES'>;
|
|
873
920
|
mutations: CustomMutations<T, 'COOKIES'>;
|
|
874
921
|
};
|
|
922
|
+
|
|
923
|
+
export type ConversationRoutes<
|
|
924
|
+
T extends Record<any, any>,
|
|
925
|
+
Schema extends ClientSchemaByEntityType<T> = ClientSchemaByEntityType<T>,
|
|
926
|
+
> = {
|
|
927
|
+
[ConversationName in keyof Schema['conversations']]: ConversationRoute;
|
|
928
|
+
};
|
|
929
|
+
|
|
930
|
+
export type Generations<
|
|
931
|
+
T extends Record<any, any>,
|
|
932
|
+
Schema extends ClientSchemaByEntityType<T> = ClientSchemaByEntityType<T>,
|
|
933
|
+
> = CustomOperations<Schema['generations']>;
|
|
@@ -248,7 +248,7 @@ export function initializeModel(
|
|
|
248
248
|
);
|
|
249
249
|
|
|
250
250
|
// if get is disabled on the related model
|
|
251
|
-
if ((client as any).models[relatedModelName]
|
|
251
|
+
if ((client as any).models[relatedModelName]?.get === undefined) {
|
|
252
252
|
break;
|
|
253
253
|
}
|
|
254
254
|
|
|
@@ -340,7 +340,7 @@ export function initializeModel(
|
|
|
340
340
|
);
|
|
341
341
|
|
|
342
342
|
// if list is disabled on the related model
|
|
343
|
-
if ((client as any).models[relatedModelName]
|
|
343
|
+
if ((client as any).models[relatedModelName]?.list === undefined) {
|
|
344
344
|
break;
|
|
345
345
|
}
|
|
346
346
|
|
|
@@ -411,7 +411,7 @@ export function initializeModel(
|
|
|
411
411
|
);
|
|
412
412
|
|
|
413
413
|
// if list is disabled on the related model
|
|
414
|
-
if ((client as any).models[relatedModelName]
|
|
414
|
+
if ((client as any).models[relatedModelName]?.list === undefined) {
|
|
415
415
|
break;
|
|
416
416
|
}
|
|
417
417
|
|
|
@@ -1242,7 +1242,6 @@ export function buildGraphQLVariables(
|
|
|
1242
1242
|
throw new Error(
|
|
1243
1243
|
'Internal error: Attempted to build variables for observeQuery. Please report this error.',
|
|
1244
1244
|
);
|
|
1245
|
-
break;
|
|
1246
1245
|
default: {
|
|
1247
1246
|
const exhaustiveCheck: never = operation;
|
|
1248
1247
|
throw new Error(`Unhandled operation case: ${exhaustiveCheck}`);
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { fromBase64 } from '@smithy/util-base64';
|
|
5
|
+
import type { ConversationMessageContent } from '../../../ai/types/ConversationMessageContent';
|
|
6
|
+
|
|
7
|
+
export const deserializeContent = (
|
|
8
|
+
content: Record<string, any>[],
|
|
9
|
+
): ConversationMessageContent[] =>
|
|
10
|
+
content.map((block) => {
|
|
11
|
+
if (block.image) {
|
|
12
|
+
return deserializeImageBlock(block);
|
|
13
|
+
}
|
|
14
|
+
if (block.toolUse) {
|
|
15
|
+
return deserializeToolUseBlock(block);
|
|
16
|
+
}
|
|
17
|
+
if (block.toolResult) {
|
|
18
|
+
return deserializeToolResultBlock(block);
|
|
19
|
+
}
|
|
20
|
+
return removeNullsFromBlock(block) as ConversationMessageContent;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const deserializeImageBlock = ({ image }: Record<'image', any>) => ({
|
|
24
|
+
image: {
|
|
25
|
+
...image,
|
|
26
|
+
source: {
|
|
27
|
+
...image.source,
|
|
28
|
+
bytes: fromBase64(image.source.bytes),
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const deserializeJsonBlock = ({ json }: Record<'json', any>) => ({
|
|
34
|
+
json: JSON.parse(json),
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const deserializeToolUseBlock = ({ toolUse }: Record<'toolUse', any>) => ({
|
|
38
|
+
toolUse: {
|
|
39
|
+
...toolUse,
|
|
40
|
+
input: JSON.parse(toolUse.input),
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const deserializeToolResultBlock = ({
|
|
45
|
+
toolResult,
|
|
46
|
+
}: Record<'toolResult', any>) => ({
|
|
47
|
+
toolResult: {
|
|
48
|
+
toolUseId: toolResult.toolUseId,
|
|
49
|
+
content: toolResult.content.map((toolResultBlock: Record<string, any>) => {
|
|
50
|
+
if (toolResultBlock.image) {
|
|
51
|
+
return deserializeImageBlock(toolResultBlock);
|
|
52
|
+
}
|
|
53
|
+
if (toolResultBlock.json) {
|
|
54
|
+
return deserializeJsonBlock(toolResultBlock);
|
|
55
|
+
}
|
|
56
|
+
return removeNullsFromBlock(toolResultBlock);
|
|
57
|
+
}),
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const removeNullsFromBlock = (block: Record<string, any>) =>
|
|
62
|
+
Object.fromEntries(Object.entries(block).filter(([_, v]) => v !== null));
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { toBase64 } from '@smithy/util-base64';
|
|
5
|
+
import type {
|
|
6
|
+
ConversationMessageContent,
|
|
7
|
+
ConversationMessageImageContent,
|
|
8
|
+
ConversationMessageToolResultContent,
|
|
9
|
+
} from '../../../ai/types/ConversationMessageContent';
|
|
10
|
+
import type { ToolConfiguration } from '../../../ai/types/ToolConfiguration';
|
|
11
|
+
import type { ToolResultJsonContent } from '../../../ai/types/ToolResultContent';
|
|
12
|
+
|
|
13
|
+
export const serializeAiContext = (aiContext: string | Record<string, any>) =>
|
|
14
|
+
JSON.stringify(aiContext);
|
|
15
|
+
|
|
16
|
+
export const serializeContent = (content: ConversationMessageContent[]) =>
|
|
17
|
+
content.map((block) => {
|
|
18
|
+
if (block.image) {
|
|
19
|
+
return serializeImageBlock(block);
|
|
20
|
+
}
|
|
21
|
+
if (block.toolResult) {
|
|
22
|
+
return serializeToolResultBlock(block);
|
|
23
|
+
}
|
|
24
|
+
return block;
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export const serializeToolConfiguration = ({ tools }: ToolConfiguration) => ({
|
|
28
|
+
tools: Object.entries(tools).map(([name, tool]) => ({
|
|
29
|
+
toolSpec: {
|
|
30
|
+
name,
|
|
31
|
+
description: tool.description,
|
|
32
|
+
inputSchema: {
|
|
33
|
+
json: JSON.stringify(tool.inputSchema.json),
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
})),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const serializeImageBlock = ({ image }: ConversationMessageImageContent) => ({
|
|
40
|
+
image: {
|
|
41
|
+
...image,
|
|
42
|
+
source: {
|
|
43
|
+
...image.source,
|
|
44
|
+
bytes: toBase64(image.source.bytes),
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const serializeJsonBlock = ({ json }: ToolResultJsonContent) => ({
|
|
50
|
+
json: JSON.stringify(json),
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const serializeToolResultBlock = ({
|
|
54
|
+
toolResult,
|
|
55
|
+
}: ConversationMessageToolResultContent) => ({
|
|
56
|
+
toolResult: {
|
|
57
|
+
...toolResult,
|
|
58
|
+
content: toolResult.content.map((toolResultBlock) => {
|
|
59
|
+
if (toolResultBlock.image) {
|
|
60
|
+
return serializeImageBlock(toolResultBlock);
|
|
61
|
+
}
|
|
62
|
+
if (toolResultBlock.json) {
|
|
63
|
+
return serializeJsonBlock(toolResultBlock);
|
|
64
|
+
}
|
|
65
|
+
return toolResultBlock;
|
|
66
|
+
}),
|
|
67
|
+
},
|
|
68
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import type { Conversation } from '../../../ai/ConversationType';
|
|
5
|
+
import type {
|
|
6
|
+
BaseBrowserClient,
|
|
7
|
+
BaseClient,
|
|
8
|
+
ClientInternalsGetter,
|
|
9
|
+
ModelIntrospectionSchema,
|
|
10
|
+
SchemaModel,
|
|
11
|
+
} from '../../bridge-types';
|
|
12
|
+
import { createListMessagesFunction } from './createListMessagesFunction';
|
|
13
|
+
import { createOnMessageFunction } from './createOnMessageFunction';
|
|
14
|
+
import { createSendMessageFunction } from './createSendMessageFunction';
|
|
15
|
+
|
|
16
|
+
export const convertItemToConversation = (
|
|
17
|
+
client: BaseClient,
|
|
18
|
+
modelIntrospection: ModelIntrospectionSchema,
|
|
19
|
+
conversationId: string,
|
|
20
|
+
conversationRouteName: string,
|
|
21
|
+
conversationMessageModel: SchemaModel,
|
|
22
|
+
getInternals: ClientInternalsGetter,
|
|
23
|
+
): Conversation => {
|
|
24
|
+
if (!conversationId) {
|
|
25
|
+
throw new Error(
|
|
26
|
+
`An error occurred converting a ${conversationRouteName} conversation: Missing ID`,
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
id: conversationId,
|
|
31
|
+
onMessage: createOnMessageFunction(
|
|
32
|
+
client as BaseBrowserClient,
|
|
33
|
+
modelIntrospection,
|
|
34
|
+
conversationId,
|
|
35
|
+
conversationRouteName,
|
|
36
|
+
getInternals,
|
|
37
|
+
),
|
|
38
|
+
sendMessage: createSendMessageFunction(
|
|
39
|
+
client,
|
|
40
|
+
modelIntrospection,
|
|
41
|
+
conversationId,
|
|
42
|
+
conversationRouteName,
|
|
43
|
+
getInternals,
|
|
44
|
+
),
|
|
45
|
+
listMessages: createListMessagesFunction(
|
|
46
|
+
client,
|
|
47
|
+
modelIntrospection,
|
|
48
|
+
conversationId,
|
|
49
|
+
conversationMessageModel,
|
|
50
|
+
getInternals,
|
|
51
|
+
),
|
|
52
|
+
};
|
|
53
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { deserializeContent } from './conversationMessageDeserializers';
|
|
5
|
+
|
|
6
|
+
export const convertItemToConversationMessage = ({
|
|
7
|
+
content,
|
|
8
|
+
createdAt,
|
|
9
|
+
id,
|
|
10
|
+
conversationId,
|
|
11
|
+
role,
|
|
12
|
+
}: any) => ({
|
|
13
|
+
content: deserializeContent(content),
|
|
14
|
+
conversationId,
|
|
15
|
+
createdAt,
|
|
16
|
+
id,
|
|
17
|
+
role,
|
|
18
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import type { ConversationRoute } from '../../../ai/ConversationType';
|
|
5
|
+
import type { SingularReturnValue } from '../../../runtime/client';
|
|
6
|
+
import type {
|
|
7
|
+
BaseClient,
|
|
8
|
+
ClientInternalsGetter,
|
|
9
|
+
ModelIntrospectionSchema,
|
|
10
|
+
SchemaModel,
|
|
11
|
+
} from '../../bridge-types';
|
|
12
|
+
import { getFactory } from '../operations/get';
|
|
13
|
+
import { convertItemToConversation } from './convertItemToConversation';
|
|
14
|
+
|
|
15
|
+
export const createCreateConversationFunction =
|
|
16
|
+
(
|
|
17
|
+
client: BaseClient,
|
|
18
|
+
modelIntrospection: ModelIntrospectionSchema,
|
|
19
|
+
conversationRouteName: string,
|
|
20
|
+
conversationModel: SchemaModel,
|
|
21
|
+
conversationMessageModel: SchemaModel,
|
|
22
|
+
getInternals: ClientInternalsGetter,
|
|
23
|
+
): ConversationRoute['create'] =>
|
|
24
|
+
async () => {
|
|
25
|
+
const get = getFactory(
|
|
26
|
+
client,
|
|
27
|
+
modelIntrospection,
|
|
28
|
+
conversationModel,
|
|
29
|
+
'CREATE',
|
|
30
|
+
getInternals,
|
|
31
|
+
) as () => SingularReturnValue<Record<string, any>>;
|
|
32
|
+
const { data, errors } = await get();
|
|
33
|
+
return {
|
|
34
|
+
data: convertItemToConversation(
|
|
35
|
+
client,
|
|
36
|
+
modelIntrospection,
|
|
37
|
+
data?.id,
|
|
38
|
+
conversationRouteName,
|
|
39
|
+
conversationMessageModel,
|
|
40
|
+
getInternals,
|
|
41
|
+
),
|
|
42
|
+
errors,
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import type { ConversationRoute } from '../../../ai/ConversationType';
|
|
5
|
+
import type { SingularReturnValue } from '../../../runtime/client';
|
|
6
|
+
import type {
|
|
7
|
+
BaseClient,
|
|
8
|
+
ClientInternalsGetter,
|
|
9
|
+
ModelIntrospectionSchema,
|
|
10
|
+
SchemaModel,
|
|
11
|
+
} from '../../bridge-types';
|
|
12
|
+
import { getFactory } from '../operations/get';
|
|
13
|
+
import { convertItemToConversation } from './convertItemToConversation';
|
|
14
|
+
|
|
15
|
+
export const createGetConversationFunction =
|
|
16
|
+
(
|
|
17
|
+
client: BaseClient,
|
|
18
|
+
modelIntrospection: ModelIntrospectionSchema,
|
|
19
|
+
conversationRouteName: string,
|
|
20
|
+
conversationModel: SchemaModel,
|
|
21
|
+
conversationMessageModel: SchemaModel,
|
|
22
|
+
getInternals: ClientInternalsGetter,
|
|
23
|
+
): ConversationRoute['get'] =>
|
|
24
|
+
async ({ id }) => {
|
|
25
|
+
const get = getFactory(
|
|
26
|
+
client,
|
|
27
|
+
modelIntrospection,
|
|
28
|
+
conversationModel,
|
|
29
|
+
'GET',
|
|
30
|
+
getInternals,
|
|
31
|
+
) as (
|
|
32
|
+
args?: Record<string, any>,
|
|
33
|
+
) => SingularReturnValue<Record<string, any>>;
|
|
34
|
+
const { data, errors } = await get({ id });
|
|
35
|
+
return {
|
|
36
|
+
data: data
|
|
37
|
+
? convertItemToConversation(
|
|
38
|
+
client,
|
|
39
|
+
modelIntrospection,
|
|
40
|
+
data.id,
|
|
41
|
+
conversationRouteName,
|
|
42
|
+
conversationMessageModel,
|
|
43
|
+
getInternals,
|
|
44
|
+
)
|
|
45
|
+
: data,
|
|
46
|
+
errors,
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import type { ConversationRoute } from '../../../ai/ConversationType';
|
|
5
|
+
import type { ListReturnValue } from '../../../runtime/client';
|
|
6
|
+
import type {
|
|
7
|
+
BaseClient,
|
|
8
|
+
ClientInternalsGetter,
|
|
9
|
+
ModelIntrospectionSchema,
|
|
10
|
+
SchemaModel,
|
|
11
|
+
} from '../../bridge-types';
|
|
12
|
+
import { listFactory } from '../operations/list';
|
|
13
|
+
import { convertItemToConversation } from './convertItemToConversation';
|
|
14
|
+
|
|
15
|
+
export const createListConversationsFunction =
|
|
16
|
+
(
|
|
17
|
+
client: BaseClient,
|
|
18
|
+
modelIntrospection: ModelIntrospectionSchema,
|
|
19
|
+
conversationRouteName: string,
|
|
20
|
+
conversationModel: SchemaModel,
|
|
21
|
+
conversationMessageModel: SchemaModel,
|
|
22
|
+
getInternals: ClientInternalsGetter,
|
|
23
|
+
): ConversationRoute['list'] =>
|
|
24
|
+
async (input) => {
|
|
25
|
+
const list = listFactory(
|
|
26
|
+
client,
|
|
27
|
+
modelIntrospection,
|
|
28
|
+
conversationModel,
|
|
29
|
+
getInternals,
|
|
30
|
+
) as (args?: Record<string, any>) => ListReturnValue<Record<string, any>>;
|
|
31
|
+
const { data, nextToken, errors } = await list(input);
|
|
32
|
+
return {
|
|
33
|
+
data: data.map((datum: Record<string, any>) => {
|
|
34
|
+
return convertItemToConversation(
|
|
35
|
+
client,
|
|
36
|
+
modelIntrospection,
|
|
37
|
+
datum.id,
|
|
38
|
+
conversationRouteName,
|
|
39
|
+
conversationMessageModel,
|
|
40
|
+
getInternals,
|
|
41
|
+
);
|
|
42
|
+
}),
|
|
43
|
+
nextToken,
|
|
44
|
+
errors,
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import type {
|
|
5
|
+
Conversation,
|
|
6
|
+
ConversationMessage,
|
|
7
|
+
} from '../../../ai/ConversationType';
|
|
8
|
+
import type { ListReturnValue } from '../../../runtime/client';
|
|
9
|
+
import type {
|
|
10
|
+
BaseClient,
|
|
11
|
+
ClientInternalsGetter,
|
|
12
|
+
ModelIntrospectionSchema,
|
|
13
|
+
SchemaModel,
|
|
14
|
+
} from '../../bridge-types';
|
|
15
|
+
import { listFactory } from '../operations/list';
|
|
16
|
+
import { convertItemToConversationMessage } from './convertItemToConversationMessage';
|
|
17
|
+
|
|
18
|
+
export const createListMessagesFunction =
|
|
19
|
+
(
|
|
20
|
+
client: BaseClient,
|
|
21
|
+
modelIntrospection: ModelIntrospectionSchema,
|
|
22
|
+
conversationId: string,
|
|
23
|
+
conversationMessageModel: SchemaModel,
|
|
24
|
+
getInternals: ClientInternalsGetter,
|
|
25
|
+
): Conversation['listMessages'] =>
|
|
26
|
+
async (input) => {
|
|
27
|
+
const list = listFactory(
|
|
28
|
+
client,
|
|
29
|
+
modelIntrospection,
|
|
30
|
+
conversationMessageModel,
|
|
31
|
+
getInternals,
|
|
32
|
+
) as (args?: Record<string, any>) => ListReturnValue<ConversationMessage>;
|
|
33
|
+
const { data, nextToken, errors } = await list({
|
|
34
|
+
...input,
|
|
35
|
+
filter: { conversationId: { eq: conversationId } },
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
data: data.map((item: any) => convertItemToConversationMessage(item)),
|
|
39
|
+
nextToken,
|
|
40
|
+
errors,
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import type { Observable, Subscription } from 'rxjs';
|
|
5
|
+
import type { Conversation } from '../../../ai/ConversationType';
|
|
6
|
+
import type {
|
|
7
|
+
BaseClient,
|
|
8
|
+
ClientInternalsGetter,
|
|
9
|
+
ModelIntrospectionSchema,
|
|
10
|
+
} from '../../bridge-types';
|
|
11
|
+
import { customOpFactory } from '../operations/custom';
|
|
12
|
+
import { convertItemToConversationMessage } from './convertItemToConversationMessage';
|
|
13
|
+
|
|
14
|
+
export const createOnMessageFunction =
|
|
15
|
+
(
|
|
16
|
+
client: BaseClient,
|
|
17
|
+
modelIntrospection: ModelIntrospectionSchema,
|
|
18
|
+
conversationId: string,
|
|
19
|
+
conversationRouteName: string,
|
|
20
|
+
getInternals: ClientInternalsGetter,
|
|
21
|
+
): Conversation['onMessage'] =>
|
|
22
|
+
(handler): Subscription => {
|
|
23
|
+
const { conversations } = modelIntrospection;
|
|
24
|
+
// Safe guard for standalone function. When called as part of client generation, this should never be falsy.
|
|
25
|
+
if (!conversations) {
|
|
26
|
+
return {} as Subscription;
|
|
27
|
+
}
|
|
28
|
+
const subscribeSchema =
|
|
29
|
+
conversations[conversationRouteName].message.subscribe;
|
|
30
|
+
const subscribeOperation = customOpFactory(
|
|
31
|
+
client,
|
|
32
|
+
modelIntrospection,
|
|
33
|
+
'subscription',
|
|
34
|
+
subscribeSchema,
|
|
35
|
+
false,
|
|
36
|
+
getInternals,
|
|
37
|
+
) as (args?: Record<string, any>) => Observable<any>;
|
|
38
|
+
return subscribeOperation({ conversationId }).subscribe((data) => {
|
|
39
|
+
handler(convertItemToConversationMessage(data));
|
|
40
|
+
});
|
|
41
|
+
};
|