@aws-amplify/graphql-api-construct 1.16.0 → 1.16.1-ai-next.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.jsii +19 -19
- package/CHANGELOG.md +4 -0
- package/lib/amplify-dynamodb-table-wrapper.js +1 -1
- package/lib/amplify-graphql-api.js +1 -1
- package/lib/amplify-graphql-definition.js +1 -1
- package/lib/sql-model-datasource-strategy.js +1 -1
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/conversation_handler_construct.d.ts +19 -1
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/conversation_handler_construct.js +36 -2
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/index.d.ts +2 -2
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/index.js +1 -1
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/bedrock_converse_adapter.d.ts +11 -4
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/bedrock_converse_adapter.js +279 -67
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_message_history_retriever.js +34 -8
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_turn_executor.d.ts +2 -2
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_turn_executor.js +17 -4
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_turn_response_sender.d.ts +17 -3
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_turn_response_sender.js +56 -18
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/default_handler.d.ts +1 -1
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/event-tools-provider/event_tools_provider.js +2 -2
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/event-tools-provider/graphql_tool.d.ts +7 -7
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/event-tools-provider/graphql_tool.js +3 -2
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/executable_tool_factory.d.ts +7 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/executable_tool_factory.js +16 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/graphql_request_executor.d.ts +2 -1
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/graphql_request_executor.js +4 -2
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/index.d.ts +3 -2
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/index.js +4 -2
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/types.d.ts +71 -14
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/types.js +1 -1
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/README.md +4 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/ai/conversation/index.d.ts +23 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/ai/conversation/index.js +10 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/ai/conversation/v1.d.ts +22 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/ai/conversation/v1.js +11 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/auth/index.d.ts +118 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/auth/index.js +10 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/auth/v1.d.ts +117 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/auth/v1.js +31 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/custom/index.d.ts +23 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/custom/index.js +10 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/custom/v1.d.ts +22 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/custom/v1.js +11 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/function/index.d.ts +23 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/function/index.js +10 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/function/v1.d.ts +22 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/function/v1.js +11 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/graphql/index.d.ts +59 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/graphql/index.js +12 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/graphql/v1.d.ts +59 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/graphql/v1.js +25 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/index.d.ts +515 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/index.js +112 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/platform/index.d.ts +2 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/platform/index.js +18 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/platform/stack_metadata_schemas.d.ts +42 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/platform/stack_metadata_schemas.js +22 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/stack/index.d.ts +28 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/stack/index.js +10 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/stack/v1.d.ts +27 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/stack/v1.js +12 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/storage/index.d.ts +33 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/storage/index.js +10 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/storage/v1.d.ts +32 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/storage/v1.js +33 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/package.json +27 -0
- package/node_modules/@aws-amplify/ai-constructs/package.json +9 -2
- package/node_modules/@aws-amplify/graphql-auth-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/package.json +11 -11
- package/node_modules/@aws-amplify/graphql-conversation-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/conversation-directive-configuration.d.ts +4 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/conversation-directive-configuration.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/message-model.d.ts +5 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/message-model.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/message-model.js +61 -3
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/message-model.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/name-values.d.ts +2 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/name-values.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/name-values.js +4 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/name-values.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-response-stream-pipeline-definition.d.ts +3 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-response-stream-pipeline-definition.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-response-stream-pipeline-definition.js +58 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-response-stream-pipeline-definition.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/index.d.ts +5 -2
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/index.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/index.js +9 -3
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/index.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/list-conversations-init-resolver-definition.d.ts +3 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/list-conversations-init-resolver-definition.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/list-conversations-init-resolver-definition.js +24 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/list-conversations-init-resolver-definition.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/{list-messages-init-resolver.d.ts → list-messages-init-resolver-definition.d.ts} +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/list-messages-init-resolver-definition.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/{list-messages-init-resolver.js → list-messages-init-resolver-definition.js} +2 -2
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/list-messages-init-resolver-definition.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/list-messages-post-processing-resolver-definition.d.ts +3 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/list-messages-post-processing-resolver-definition.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/list-messages-post-processing-resolver-definition.js +10 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/list-messages-post-processing-resolver-definition.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/send-message-pipeline-definition.js +5 -2
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/send-message-pipeline-definition.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/templates/assistant-streaming-mutation-resolver-fn.template.js +95 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/templates/invoke-lambda-resolver-fn.template.js +6 -4
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/templates/list-conversations-init-set-index-resolver-fn.template.js +12 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/templates/list-messages-init-set-index-resolver-fn.template.js +36 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/templates/list-messages-post-processing-resolver-fn.template.js +12 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/templates/set-updated-at-conversation-table-fn.template.js +31 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-field-handler.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-field-handler.js +8 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-field-handler.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-prepare-handler.d.ts +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-prepare-handler.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-prepare-handler.js +6 -2
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-prepare-handler.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-resolver-generator.d.ts +3 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-resolver-generator.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-resolver-generator.js +26 -3
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-resolver-generator.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/package.json +9 -9
- package/node_modules/@aws-amplify/graphql-default-value-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-default-value-transformer/package.json +6 -6
- package/node_modules/@aws-amplify/graphql-function-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-function-transformer/package.json +5 -5
- package/node_modules/@aws-amplify/graphql-generation-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/package.json +5 -5
- package/node_modules/@aws-amplify/graphql-http-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-http-transformer/package.json +5 -5
- package/node_modules/@aws-amplify/graphql-index-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-index-transformer/package.json +6 -6
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/assets/mapping-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/package.json +9 -9
- package/node_modules/@aws-amplify/graphql-model-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-notification-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-patching-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/package.json +5 -5
- package/node_modules/@aws-amplify/graphql-predictions-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-predictions-transformer/lib/predictionsLambdaFunction.zip +0 -0
- package/node_modules/@aws-amplify/graphql-predictions-transformer/package.json +5 -5
- package/node_modules/@aws-amplify/graphql-relational-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-relational-transformer/package.json +7 -7
- package/node_modules/@aws-amplify/graphql-searchable-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/streaming-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-searchable-transformer/package.json +6 -6
- package/node_modules/@aws-amplify/graphql-sql-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-sql-transformer/package.json +6 -6
- package/node_modules/@aws-amplify/graphql-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-transformer/package.json +17 -17
- package/node_modules/@aws-amplify/graphql-transformer-core/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/package.json +3 -3
- package/node_modules/graphql-transformer-common/API.md +1 -0
- package/node_modules/graphql-transformer-common/CHANGELOG.md +4 -0
- package/node_modules/graphql-transformer-common/lib/TypescriptSchemaConstants.d.ts +1 -0
- package/node_modules/graphql-transformer-common/lib/TypescriptSchemaConstants.d.ts.map +1 -1
- package/node_modules/graphql-transformer-common/lib/TypescriptSchemaConstants.js +1 -0
- package/node_modules/graphql-transformer-common/lib/TypescriptSchemaConstants.js.map +1 -1
- package/node_modules/graphql-transformer-common/package.json +2 -2
- package/package.json +20 -20
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/list-messages-init-resolver.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/list-messages-init-resolver.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/templates/list-messages-init-resolver-fn.template.js +0 -8
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"name-values.js","sourceRoot":"","sources":["../../src/graphql-types/name-values.ts"],"names":[],"mappings":";;;;;;AAAA,2EAAqD;AACrD,0DAAkC;AAGrB,QAAA,0CAA0C,GAAG,gBAAgB,CAAC;AAC9D,QAAA,wBAAwB,GAAG,kDAAkD,CAAC;AAC9E,QAAA,8CAA8C,GAAG,IAAI,CAAC;AAE5D,MAAM,uBAAuB,GAAG,CAAC,MAA0C,EAAE,EAAE,CACpF,eAAe,IAAA,sCAA8B,EAAC,MAAM,CAAC,EAAE,CAAC;AAD7C,QAAA,uBAAuB,2BACsB;AAEnD,MAAM,8BAA8B,GAAG,CAAC,MAA0C,EAAE,EAAE,CAC3F,sBAAsB,IAAA,sCAA8B,EAAC,MAAM,CAAC,EAAE,CAAC;AADpD,QAAA,8BAA8B,kCACsB;AAE1D,MAAM,+BAA+B,GAAG,CAAC,MAA0C,EAAE,EAAE,CAC5F,4BAA4B,IAAA,sCAA8B,EAAC,MAAM,CAAC,EAAE,CAAC;AAD1D,QAAA,+BAA+B,mCAC2B;AAEhE,MAAM,6BAA6B,GAAG,CAAC,MAA0C,EAAE,EAAE,CAC1F,0BAA0B,IAAA,sCAA8B,EAAC,MAAM,CAAC,EAAE,CAAC;AADxD,QAAA,6BAA6B,iCAC2B;AAE9D,MAAM,oBAAoB,GAAG,CAAC,MAA0C,EAAE,EAAE,CACjF,GAAG,IAAA,sCAA8B,EAAC,MAAM,CAAC,kCAAkC,CAAC;AADjE,QAAA,oBAAoB,wBAC6C;AAEvE,MAAM,kCAAkC,GAAG,CAAC,MAA0C,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E,CAAC;AAD1D,QAAA,+BAA+B,mCAC2B;AAEhE,MAAM,6BAA6B,GAAG,CAAC,MAA0C,EAAE,EAAE,CAC1F,0BAA0B,IAAA,sCAA8B,EAAC,MAAM,CAAC,EAAE,CAAC;AADxD,QAAA,6BAA6B,iCAC2B;AAE9D,MAAM,sCAAsC,GAAG,CAAC,MAA0C,EAAE,EAAE,CACnG,gCAAgC,IAAA,sCAA8B,EAAC,MAAM,CAAC,EAAE,CAAC;AAD9D,QAAA,sCAAsC,0CACwB;AAEpE,MAAM,oBAAoB,GAAG,CAAC,MAA0C,EAAE,EAAE,CACjF,GAAG,IAAA,sCAA8B,EAAC,MAAM,CAAC,kCAAkC,CAAC;AADjE,QAAA,oBAAoB,wBAC6C;AAEvE,MAAM,kCAAkC,GAAG,CAAC,MAA0C,EAAE,EAAE,CAC/F,yBAAyB,IAAA,sCAA8B,EAAC,MAAM,CAAC,EAAE,CAAC;AADvD,QAAA,kCAAkC,sCACqB;AAE7D,MAAM,mCAAmC,GAAG,CAAC,MAA0C,EAAE,EAAE,CAChG,0BAA0B,IAAA,mBAAS,EAAC,IAAA,sCAA8B,EAAC,MAAM,CAAC,CAAC,EAAE,CAAC;AADnE,QAAA,mCAAmC,uCACgC;AAEzE,MAAM,4CAA4C,GAAG,CAAC,MAA0C,EAAE,EAAE,CACzG,2BAA2B,IAAA,sCAA8B,EAAC,MAAM,CAAC,aAAa,CAAC;AADpE,QAAA,4CAA4C,gDACwB;AAE1E,MAAM,8BAA8B,GAAG,CAAC,MAA0C,EAAE,EAAE,CAAC,IAAA,oCAAO,EAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAAlH,QAAA,8BAA8B,kCAAoF"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"assistant-response-stream-pipeline-definition.d.ts","sourceRoot":"","sources":["../../src/resolvers/assistant-response-stream-pipeline-definition.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,kBAAkB,EAEnB,MAAM,gCAAgC,CAAC;AAMxC,eAAO,MAAM,yCAAyC,EAAE,kBAKvD,CAAC"}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.assistantResponseStreamPipelineDefinition = void 0;
|
4
|
+
const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-core");
|
5
|
+
const resolver_function_definition_1 = require("./resolver-function-definition");
|
6
|
+
const graphql_transformer_common_1 = require("graphql-transformer-common");
|
7
|
+
exports.assistantResponseStreamPipelineDefinition = {
|
8
|
+
requestSlots: [init(), auth(), verifySessionOwner()],
|
9
|
+
dataSlot: data(),
|
10
|
+
responseSlots: [],
|
11
|
+
field: (config) => ({ typeName: 'Mutation', fieldName: fieldName(config) }),
|
12
|
+
};
|
13
|
+
function init() {
|
14
|
+
return (0, resolver_function_definition_1.createResolverFunctionDefinition)({
|
15
|
+
slotName: 'init',
|
16
|
+
fileName: 'init-resolver-fn.template.js',
|
17
|
+
generateTemplate: (_, code) => graphql_transformer_core_1.MappingTemplate.inlineTemplateFromString(code),
|
18
|
+
substitutions: (_, ctx) => ({
|
19
|
+
GRAPHQL_API_ENDPOINT: ctx.api.graphqlUrl,
|
20
|
+
}),
|
21
|
+
});
|
22
|
+
}
|
23
|
+
function auth() {
|
24
|
+
return (0, resolver_function_definition_1.createResolverFunctionDefinition)({
|
25
|
+
slotName: 'auth',
|
26
|
+
fileName: 'auth-resolver-fn.template.js',
|
27
|
+
generateTemplate: templateGenerator('auth'),
|
28
|
+
});
|
29
|
+
}
|
30
|
+
function verifySessionOwner() {
|
31
|
+
return (0, resolver_function_definition_1.createResolverFunctionDefinition)({
|
32
|
+
slotName: 'verifySessionOwner',
|
33
|
+
fileName: 'verify-session-owner-resolver-fn.template.js',
|
34
|
+
generateTemplate: templateGenerator('verify-session-owner'),
|
35
|
+
dataSource: (config) => config.dataSources.conversationTableDataSource,
|
36
|
+
substitutions: () => ({
|
37
|
+
CONVERSATION_ID_PARENT: 'ctx.args.input',
|
38
|
+
}),
|
39
|
+
});
|
40
|
+
}
|
41
|
+
function data() {
|
42
|
+
return (0, resolver_function_definition_1.createResolverFunctionDefinition)({
|
43
|
+
slotName: 'data',
|
44
|
+
fileName: 'assistant-streaming-mutation-resolver-fn.template.js',
|
45
|
+
generateTemplate: templateGenerator('persist-message'),
|
46
|
+
dataSource: (config) => config.dataSources.messageTableDataSource,
|
47
|
+
substitutions: (config) => ({
|
48
|
+
CONVERSATION_MESSAGE_TYPE_NAME: `ConversationMessage${(0, graphql_transformer_common_1.toUpper)(config.field.name.value)}`,
|
49
|
+
}),
|
50
|
+
});
|
51
|
+
}
|
52
|
+
function fieldName(config) {
|
53
|
+
return config.assistantResponseStreamingMutation.field.name.value;
|
54
|
+
}
|
55
|
+
function templateGenerator(slotName) {
|
56
|
+
return (0, resolver_function_definition_1.createS3AssetMappingTemplateGenerator)('Mutation', slotName, fieldName);
|
57
|
+
}
|
58
|
+
//# sourceMappingURL=assistant-response-stream-pipeline-definition.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"assistant-response-stream-pipeline-definition.js","sourceRoot":"","sources":["../../src/resolvers/assistant-response-stream-pipeline-definition.ts"],"names":[],"mappings":";;;AAAA,oFAAwE;AAExE,iFAKwC;AACxC,2EAAqD;AAKxC,QAAA,yCAAyC,GAAuB;IAC3E,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,kBAAkB,EAAE,CAAC;IACpD,QAAQ,EAAE,IAAI,EAAE;IAChB,aAAa,EAAE,EAAE;IACjB,KAAK,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;CAC5E,CAAC;AAKF,SAAS,IAAI;IACX,OAAO,IAAA,+DAAgC,EAAC;QACtC,QAAQ,EAAE,MAAM;QAChB,Q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ACL,CAAC;AAKD,SAAS,SAAS,CAAC,MAA0C;IAC3D,OAAO,MAAM,CAAC,kCAAkC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;AACpE,CAAC;AAKD,SAAS,iBAAiB,CAAC,QAAgB;IACzC,OAAO,IAAA,oEAAqC,EAAC,UAAU,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;AAChF,CAAC"}
|
@@ -1,7 +1,10 @@
|
|
1
1
|
import { assistantResponsePipelineDefinition } from './assistant-response-pipeline-definition';
|
2
|
+
import { assistantResponseStreamPipelineDefinition } from './assistant-response-stream-pipeline-definition';
|
2
3
|
import { assistantResponseSubscriptionPipelineDefinition } from './assistant-response-subscription-pipeline-definition';
|
3
4
|
import { generateResolverFunction, generateResolverPipeline } from './generate-resolver';
|
4
|
-
import {
|
5
|
+
import { listConversationsInitFunctionDefinition } from './list-conversations-init-resolver-definition';
|
6
|
+
import { listMessagesInitFunctionDefinition } from './list-messages-init-resolver-definition';
|
7
|
+
import { listMessagesPostProcessingFunctionDefinition } from './list-messages-post-processing-resolver-definition';
|
5
8
|
import { sendMessagePipelineDefinition } from './send-message-pipeline-definition';
|
6
|
-
export { assistantResponsePipelineDefinition, assistantResponseSubscriptionPipelineDefinition, generateResolverFunction, generateResolverPipeline, listMessagesInitFunctionDefinition, sendMessagePipelineDefinition, };
|
9
|
+
export { assistantResponsePipelineDefinition, assistantResponseStreamPipelineDefinition, assistantResponseSubscriptionPipelineDefinition, generateResolverFunction, generateResolverPipeline, listConversationsInitFunctionDefinition, listMessagesInitFunctionDefinition, listMessagesPostProcessingFunctionDefinition, sendMessagePipelineDefinition, };
|
7
10
|
//# sourceMappingURL=index.d.ts.map
|
package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resolvers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mCAAmC,EAAE,MAAM,0CAA0C,CAAC;AAC/F,OAAO,EAAE,+CAA+C,EAAE,MAAM,uDAAuD,CAAC;AACxH,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resolvers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mCAAmC,EAAE,MAAM,0CAA0C,CAAC;AAC/F,OAAO,EAAE,yCAAyC,EAAE,MAAM,iDAAiD,CAAC;AAC5G,OAAO,EAAE,+CAA+C,EAAE,MAAM,uDAAuD,CAAC;AACxH,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAE,uCAAuC,EAAE,MAAM,+CAA+C,CAAC;AACxG,OAAO,EAAE,kCAAkC,EAAE,MAAM,0CAA0C,CAAC;AAC9F,OAAO,EAAE,4CAA4C,EAAE,MAAM,qDAAqD,CAAC;AACnH,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAEnF,OAAO,EACL,mCAAmC,EACnC,yCAAyC,EACzC,+CAA+C,EAC/C,wBAAwB,EACxB,wBAAwB,EACxB,uCAAuC,EACvC,kCAAkC,EAClC,4CAA4C,EAC5C,6BAA6B,GAC9B,CAAC"}
|
@@ -1,15 +1,21 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.sendMessagePipelineDefinition = exports.listMessagesInitFunctionDefinition = exports.generateResolverPipeline = exports.generateResolverFunction = exports.assistantResponseSubscriptionPipelineDefinition = exports.assistantResponsePipelineDefinition = void 0;
|
3
|
+
exports.sendMessagePipelineDefinition = exports.listMessagesPostProcessingFunctionDefinition = exports.listMessagesInitFunctionDefinition = exports.listConversationsInitFunctionDefinition = exports.generateResolverPipeline = exports.generateResolverFunction = exports.assistantResponseSubscriptionPipelineDefinition = exports.assistantResponseStreamPipelineDefinition = exports.assistantResponsePipelineDefinition = void 0;
|
4
4
|
const assistant_response_pipeline_definition_1 = require("./assistant-response-pipeline-definition");
|
5
5
|
Object.defineProperty(exports, "assistantResponsePipelineDefinition", { enumerable: true, get: function () { return assistant_response_pipeline_definition_1.assistantResponsePipelineDefinition; } });
|
6
|
+
const assistant_response_stream_pipeline_definition_1 = require("./assistant-response-stream-pipeline-definition");
|
7
|
+
Object.defineProperty(exports, "assistantResponseStreamPipelineDefinition", { enumerable: true, get: function () { return assistant_response_stream_pipeline_definition_1.assistantResponseStreamPipelineDefinition; } });
|
6
8
|
const assistant_response_subscription_pipeline_definition_1 = require("./assistant-response-subscription-pipeline-definition");
|
7
9
|
Object.defineProperty(exports, "assistantResponseSubscriptionPipelineDefinition", { enumerable: true, get: function () { return assistant_response_subscription_pipeline_definition_1.assistantResponseSubscriptionPipelineDefinition; } });
|
8
10
|
const generate_resolver_1 = require("./generate-resolver");
|
9
11
|
Object.defineProperty(exports, "generateResolverFunction", { enumerable: true, get: function () { return generate_resolver_1.generateResolverFunction; } });
|
10
12
|
Object.defineProperty(exports, "generateResolverPipeline", { enumerable: true, get: function () { return generate_resolver_1.generateResolverPipeline; } });
|
11
|
-
const
|
12
|
-
Object.defineProperty(exports, "
|
13
|
+
const list_conversations_init_resolver_definition_1 = require("./list-conversations-init-resolver-definition");
|
14
|
+
Object.defineProperty(exports, "listConversationsInitFunctionDefinition", { enumerable: true, get: function () { return list_conversations_init_resolver_definition_1.listConversationsInitFunctionDefinition; } });
|
15
|
+
const list_messages_init_resolver_definition_1 = require("./list-messages-init-resolver-definition");
|
16
|
+
Object.defineProperty(exports, "listMessagesInitFunctionDefinition", { enumerable: true, get: function () { return list_messages_init_resolver_definition_1.listMessagesInitFunctionDefinition; } });
|
17
|
+
const list_messages_post_processing_resolver_definition_1 = require("./list-messages-post-processing-resolver-definition");
|
18
|
+
Object.defineProperty(exports, "listMessagesPostProcessingFunctionDefinition", { enumerable: true, get: function () { return list_messages_post_processing_resolver_definition_1.listMessagesPostProcessingFunctionDefinition; } });
|
13
19
|
const send_message_pipeline_definition_1 = require("./send-message-pipeline-definition");
|
14
20
|
Object.defineProperty(exports, "sendMessagePipelineDefinition", { enumerable: true, get: function () { return send_message_pipeline_definition_1.sendMessagePipelineDefinition; } });
|
15
21
|
//# sourceMappingURL=index.js.map
|
package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resolvers/index.ts"],"names":[],"mappings":";;;AAAA,qGAA+F;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resolvers/index.ts"],"names":[],"mappings":";;;AAAA,qGAA+F;AAU7F,oHAVO,4EAAmC,OAUP;AATrC,mHAA4G;AAU1G,0HAVO,yFAAyC,OAUP;AAT3C,+HAAwH;AAUtH,gIAVO,qGAA+C,OAUP;AATjD,2DAAyF;AAUvF,yGAVO,4CAAwB,OAUP;AACxB,yGAXiC,4CAAwB,OAWjC;AAV1B,+GAAwG;AAWtG,wHAXO,qFAAuC,OAWP;AAVzC,qGAA8F;AAW5F,mHAXO,2EAAkC,OAWP;AAVpC,2HAAmH;AAWjH,6HAXO,gGAA4C,OAWP;AAV9C,yFAAmF;AAWjF,8GAXO,gEAA6B,OAWP"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"list-conversations-init-resolver-definition.d.ts","sourceRoot":"","sources":["../../src/resolvers/list-conversations-init-resolver-definition.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,0BAA0B,EAC3B,MAAM,gCAAgC,CAAC;AAMxC,eAAO,MAAM,uCAAuC,EAAE,0BAiBpD,CAAC"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.listConversationsInitFunctionDefinition = void 0;
|
4
|
+
const name_values_1 = require("../graphql-types/name-values");
|
5
|
+
const resolver_function_definition_1 = require("./resolver-function-definition");
|
6
|
+
exports.listConversationsInitFunctionDefinition = (0, resolver_function_definition_1.createResolverFunctionDefinition)({
|
7
|
+
slotName: 'init',
|
8
|
+
fileName: 'list-conversations-init-set-index-resolver-fn.template.js',
|
9
|
+
generateTemplate: (0, resolver_function_definition_1.createS3AssetMappingTemplateGenerator)('Query', 'list-conversations-init', (config) => config.field.name.value),
|
10
|
+
substitutions: (config) => ({
|
11
|
+
INDEX_NAME: name_values_1.LIST_CONVERSATIONS_INDEX_NAME,
|
12
|
+
MODEL_QUERY_EXPRESSION: `{
|
13
|
+
expression: '#typename = :typename',
|
14
|
+
expressionNames: {
|
15
|
+
'#typename': '__typename',
|
16
|
+
},
|
17
|
+
expressionValues: util.dynamodb.toMapValues({
|
18
|
+
':typename': '${config.conversation.model.name.value}',
|
19
|
+
}),
|
20
|
+
}`,
|
21
|
+
SORT_DIRECTION: 'DESC',
|
22
|
+
}),
|
23
|
+
});
|
24
|
+
//# sourceMappingURL=list-conversations-init-resolver-definition.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"list-conversations-init-resolver-definition.js","sourceRoot":"","sources":["../../src/resolvers/list-conversations-init-resolver-definition.ts"],"names":[],"mappings":";;;AAAA,8DAA6E;AAC7E,iFAIwC;AAM3B,QAAA,uCAAuC,GAA+B,IAAA,+DAAgC,EAAC;IAClH,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,2DAA2D;IACrE,gBAAgB,EAAE,IAAA,oEAAqC,EAAC,OAAO,EAAE,yBAAyB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;IAChI,aAAa,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAC1B,UAAU,EAAE,2CAA6B;QACzC,sBAAsB,EAAE;;;;;;wBAMJ,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK;;MAEtD;QACF,cAAc,EAAE,MAAM;KACvB,CAAC;CACH,CAAC,CAAC"}
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { ResolverFunctionDefinition } from './resolver-function-definition';
|
2
2
|
export declare const listMessagesInitFunctionDefinition: ResolverFunctionDefinition;
|
3
|
-
//# sourceMappingURL=list-messages-init-resolver.d.ts.map
|
3
|
+
//# sourceMappingURL=list-messages-init-resolver-definition.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"list-messages-init-resolver-definition.d.ts","sourceRoot":"","sources":["../../src/resolvers/list-messages-init-resolver-definition.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,0BAA0B,EAC3B,MAAM,gCAAgC,CAAC;AAMxC,eAAO,MAAM,kCAAkC,EAAE,0BAO/C,CAAC"}
|
@@ -5,10 +5,10 @@ const name_values_1 = require("../graphql-types/name-values");
|
|
5
5
|
const resolver_function_definition_1 = require("./resolver-function-definition");
|
6
6
|
exports.listMessagesInitFunctionDefinition = (0, resolver_function_definition_1.createResolverFunctionDefinition)({
|
7
7
|
slotName: 'init',
|
8
|
-
fileName: 'list-messages-init-resolver-fn.template.js',
|
8
|
+
fileName: 'list-messages-init-set-index-resolver-fn.template.js',
|
9
9
|
generateTemplate: (0, resolver_function_definition_1.createS3AssetMappingTemplateGenerator)('Query', 'list-messages-init', (config) => config.field.name.value),
|
10
10
|
substitutions: () => ({
|
11
11
|
INDEX_NAME: name_values_1.LIST_MESSAGES_INDEX_NAME,
|
12
12
|
}),
|
13
13
|
});
|
14
|
-
//# sourceMappingURL=list-messages-init-resolver.js.map
|
14
|
+
//# sourceMappingURL=list-messages-init-resolver-definition.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"list-messages-init-resolver-definition.js","sourceRoot":"","sources":["../../src/resolvers/list-messages-init-resolver-definition.ts"],"names":[],"mappings":";;;AAAA,8DAAwE;AACxE,iFAIwC;AAM3B,QAAA,kCAAkC,GAA+B,IAAA,+DAAgC,EAAC;IAC7G,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,sDAAsD;IAChE,gBAAgB,EAAE,IAAA,oEAAqC,EAAC,OAAO,EAAE,oBAAoB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;IAC3H,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC;QACpB,UAAU,EAAE,sCAAwB;KACrC,CAAC;CACH,CAAC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"list-messages-post-processing-resolver-definition.d.ts","sourceRoot":"","sources":["../../src/resolvers/list-messages-post-processing-resolver-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,0BAA0B,EAC3B,MAAM,gCAAgC,CAAC;AAMxC,eAAO,MAAM,4CAA4C,EAAE,0BAIzD,CAAC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.listMessagesPostProcessingFunctionDefinition = void 0;
|
4
|
+
const resolver_function_definition_1 = require("./resolver-function-definition");
|
5
|
+
exports.listMessagesPostProcessingFunctionDefinition = (0, resolver_function_definition_1.createResolverFunctionDefinition)({
|
6
|
+
slotName: 'postDataLoad',
|
7
|
+
fileName: 'list-messages-post-processing-resolver-fn.template.js',
|
8
|
+
generateTemplate: (0, resolver_function_definition_1.createS3AssetMappingTemplateGenerator)('Query', 'list-messages-post-processing', (config) => config.field.name.value),
|
9
|
+
});
|
10
|
+
//# sourceMappingURL=list-messages-post-processing-resolver-definition.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"list-messages-post-processing-resolver-definition.js","sourceRoot":"","sources":["../../src/resolvers/list-messages-post-processing-resolver-definition.ts"],"names":[],"mappings":";;;AAAA,iFAIwC;AAM3B,QAAA,4CAA4C,GAA+B,IAAA,+DAAgC,EAAC;IACvH,QAAQ,EAAE,cAAc;IACxB,QAAQ,EAAE,uDAAuD;IACjE,gBAAgB,EAAE,IAAA,oEAAqC,EAAC,OAAO,EAAE,+BAA+B,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;CACvI,CAAC,CAAC"}
|
@@ -30,7 +30,7 @@ function auth() {
|
|
30
30
|
function verifySessionOwner() {
|
31
31
|
return (0, resolver_function_definition_1.createResolverFunctionDefinition)({
|
32
32
|
slotName: 'verifySessionOwner',
|
33
|
-
fileName: '
|
33
|
+
fileName: 'set-updated-at-conversation-table-fn.template.js',
|
34
34
|
generateTemplate: templateGenerator('verify-session-owner'),
|
35
35
|
dataSource: (config) => config.dataSources.conversationTableDataSource,
|
36
36
|
substitutions: () => ({
|
@@ -63,7 +63,7 @@ function invokeLambdaResolverSubstitutions(config) {
|
|
63
63
|
MODEL_ID: JSON.stringify(config.aiModel),
|
64
64
|
SYSTEM_PROMPT: JSON.stringify(config.systemPrompt),
|
65
65
|
DATA_TOOLS: JSON.stringify(config.toolSpec),
|
66
|
-
SELECTION_SET:
|
66
|
+
SELECTION_SET: streamingSelectionSet,
|
67
67
|
INFERENCE_CONFIGURATION: JSON.stringify(config.inferenceConfiguration),
|
68
68
|
RESPONSE_MUTATION_NAME: config.assistantResponseMutation.field.name.value,
|
69
69
|
RESPONSE_MUTATION_INPUT_TYPE_NAME: config.assistantResponseMutation.input.name.value,
|
@@ -73,6 +73,8 @@ function invokeLambdaResolverSubstitutions(config) {
|
|
73
73
|
LIST_QUERY_NAME: (0, name_values_1.getConversationMessageListQueryName)(config),
|
74
74
|
LIST_QUERY_INPUT_TYPE_NAME: (0, name_values_1.getConversationMessageListQueryInputTypeName)(config),
|
75
75
|
LIST_QUERY_LIMIT: 'undefined',
|
76
|
+
STREAMING_RESPONSE_MUTATION_NAME: config.assistantResponseStreamingMutation.field.name.value,
|
77
|
+
STREAMING_RESPONSE_MUTATION_INPUT_TYPE_NAME: config.assistantResponseStreamingMutation.input.name.value,
|
76
78
|
};
|
77
79
|
}
|
78
80
|
function fieldName(config) {
|
@@ -82,4 +84,5 @@ function templateGenerator(slotName) {
|
|
82
84
|
return (0, resolver_function_definition_1.createS3AssetMappingTemplateGenerator)('Mutation', slotName, fieldName);
|
83
85
|
}
|
84
86
|
const selectionSet = `id conversationId content { image { format source { bytes }} text toolUse { toolUseId name input } toolResult { status toolUseId content { json text image { format source { bytes }} document { format name source { bytes }} }}} role owner createdAt updatedAt`;
|
87
|
+
const streamingSelectionSet = `associatedUserMessageId contentBlockDeltaIndex contentBlockDoneAtIndex contentBlockIndex contentBlockText contentBlockToolUse { toolUseId name input } conversationId id stopReason owner errors { errorType message }`;
|
85
88
|
//# sourceMappingURL=send-message-pipeline-definition.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"send-message-pipeline-definition.js","sourceRoot":"","sources":["../../src/resolvers/send-message-pipeline-definition.ts"],"names":[],"mappings":";;;AAAA,oFAAwE;AAExE,8DAKsC;AACtC,iFAKwC;AAK3B,QAAA,6BAA6B,GAAuB;IAC/D,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,kBAAkB,EAAE,EAAE,mBAAmB,EAAE,CAAC;IAC3E,QAAQ,EAAE,YAAY,EAAE;IACxB,aAAa,EAAE,EAAE;IACjB,KAAK,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;CAClF,CAAC;AAOF,SAAS,IAAI;IACX,OAAO,IAAA,+DAAgC,EAAC;QACtC,QAAQ,EAAE,MAAM;QAChB,QAAQ,EAAE,8BAA8B;QACxC,gBAAgB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,0CAAe,CAAC,wBAAwB,CAAC,IAAI,CAAC;QAC7E,aAAa,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;YAC1B,oBAAoB,EAAE,GAAG,CAAC,GAAG,CAAC,UAAU;SACzC,CAAC;KACH,CAAC,CAAC;AACL,CAAC;AAKD,SAAS,IAAI;IACX,OAAO,IAAA,+DAAgC,EAAC;QACtC,QAAQ,EAAE,MAAM;QAChB,QAAQ,EAAE,8BAA8B;QACxC,gBAAgB,EAAE,iBAAiB,CAAC,MAAM,CAAC;KAC5C,CAAC,CAAC;AACL,CAAC;AAKD,SAAS,kBAAkB;IACzB,OAAO,IAAA,+DAAgC,EAAC;QACtC,QAAQ,EAAE,oBAAoB;QAC9B,QAAQ,EAAE,
|
1
|
+
{"version":3,"file":"send-message-pipeline-definition.js","sourceRoot":"","sources":["../../src/resolvers/send-message-pipeline-definition.ts"],"names":[],"mappings":";;;AAAA,oFAAwE;AAExE,8DAKsC;AACtC,iFAKwC;AAK3B,QAAA,6BAA6B,GAAuB;IAC/D,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,kBAAkB,EAAE,EAAE,mBAAmB,EAAE,CAAC;IAC3E,QAAQ,EAAE,YAAY,EAAE;IACxB,aAAa,EAAE,EAAE;IACjB,KAAK,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;CAClF,CAAC;AAOF,SAAS,IAAI;IACX,OAAO,IAAA,+DAAgC,EAAC;QACtC,QAAQ,EAAE,MAAM;QAChB,QAAQ,EAAE,8BAA8B;QACxC,gBAAgB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,0CAAe,CAAC,wBAAwB,CAAC,IAAI,CAAC;QAC7E,aAAa,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;YAC1B,oBAAoB,EAAE,GAAG,CAAC,GAAG,CAAC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C;AAED,MAAM,YAAY,GAAG,mQAAmQ,CAAC;AACzR,MAAM,qBAAqB,GAAG,wNAAwN,CAAC"}
|
@@ -0,0 +1,95 @@
|
|
1
|
+
import { util } from '@aws-appsync/utils';
|
2
|
+
import * as ddb from '@aws-appsync/utils/dynamodb';
|
3
|
+
|
4
|
+
/**
|
5
|
+
* Sends a request to the attached data source
|
6
|
+
* @param {import('@aws-appsync/utils').Context} ctx the context
|
7
|
+
* @returns {*} the request
|
8
|
+
*/
|
9
|
+
export function request(ctx) {
|
10
|
+
const {
|
11
|
+
conversationId,
|
12
|
+
associatedUserMessageId,
|
13
|
+
accumulatedTurnContent,
|
14
|
+
contentBlockIndex,
|
15
|
+
errors,
|
16
|
+
} = ctx.args.input;
|
17
|
+
|
18
|
+
const { owner } = ctx.args;
|
19
|
+
|
20
|
+
if (errors) {
|
21
|
+
runtime.earlyReturn({
|
22
|
+
id: `${associatedUserMessageId}#response`,
|
23
|
+
conversationId,
|
24
|
+
associatedUserMessageId,
|
25
|
+
contentBlockIndex,
|
26
|
+
errors,
|
27
|
+
owner,
|
28
|
+
});
|
29
|
+
}
|
30
|
+
const { createdAt, updatedAt } = ctx.stash.defaultValues;
|
31
|
+
|
32
|
+
const assistantResponseId = `${associatedUserMessageId}#response`;
|
33
|
+
const expression = 'SET #typename = :typename, #conversationId = :conversationId, #associatedUserMessageId = :associatedUserMessageId, #role = :role, #content = :content, #owner = :owner, #createdAt = if_not_exists(#createdAt, :createdAt), #updatedAt = :updatedAt';
|
34
|
+
|
35
|
+
const expressionValues = util.dynamodb.toMapValues({
|
36
|
+
':typename': '[[CONVERSATION_MESSAGE_TYPE_NAME]]',
|
37
|
+
':conversationId': conversationId,
|
38
|
+
':associatedUserMessageId': associatedUserMessageId,
|
39
|
+
':role': 'assistant',
|
40
|
+
':content': accumulatedTurnContent,
|
41
|
+
':owner': owner,
|
42
|
+
':createdAt': createdAt,
|
43
|
+
':updatedAt': updatedAt,
|
44
|
+
});
|
45
|
+
|
46
|
+
// https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html
|
47
|
+
const expressionNames = {
|
48
|
+
'#typename': '__typename',
|
49
|
+
'#conversationId': 'conversationId',
|
50
|
+
'#associatedUserMessageId': 'associatedUserMessageId',
|
51
|
+
'#role': 'role',
|
52
|
+
'#content': 'content',
|
53
|
+
'#owner': 'owner',
|
54
|
+
'#createdAt': 'createdAt',
|
55
|
+
'#updatedAt': 'updatedAt',
|
56
|
+
};
|
57
|
+
|
58
|
+
return {
|
59
|
+
operation: 'UpdateItem',
|
60
|
+
key: util.dynamodb.toMapValues({ id: assistantResponseId }),
|
61
|
+
update: {
|
62
|
+
expression,
|
63
|
+
expressionValues,
|
64
|
+
expressionNames,
|
65
|
+
},
|
66
|
+
};
|
67
|
+
}
|
68
|
+
|
69
|
+
/**
|
70
|
+
* Returns the resolver result
|
71
|
+
* @param {import('@aws-appsync/utils').Context} ctx the context
|
72
|
+
* @returns {*} the result
|
73
|
+
*/
|
74
|
+
export function response(ctx) {
|
75
|
+
if (ctx.error) {
|
76
|
+
util.error(ctx.error.message, ctx.error.type);
|
77
|
+
}
|
78
|
+
const streamId = `${ctx.args.input.associatedUserMessageId}#stream`;
|
79
|
+
const { owner } = ctx.args;
|
80
|
+
const event = ctx.args.input;
|
81
|
+
|
82
|
+
const streamEvent = {
|
83
|
+
...event,
|
84
|
+
__typename: 'ConversationMessageStreamPart',
|
85
|
+
id: streamId,
|
86
|
+
owner,
|
87
|
+
};
|
88
|
+
|
89
|
+
// TODO: The lambda event should provide the toolUse directly.
|
90
|
+
if (event.contentBlockToolUse && event.contentBlockToolUse.toolUse) {
|
91
|
+
streamEvent.contentBlockToolUse = event.contentBlockToolUse.toolUse;
|
92
|
+
}
|
93
|
+
|
94
|
+
return streamEvent;
|
95
|
+
}
|
@@ -6,11 +6,12 @@ export function request(ctx) {
|
|
6
6
|
|
7
7
|
const selectionSet = '[[SELECTION_SET]]';
|
8
8
|
|
9
|
-
const
|
10
|
-
name: '[[
|
11
|
-
inputTypeName: '[[
|
9
|
+
const streamingResponseMutation = {
|
10
|
+
name: '[[STREAMING_RESPONSE_MUTATION_NAME]]',
|
11
|
+
inputTypeName: '[[STREAMING_RESPONSE_MUTATION_INPUT_TYPE_NAME]]',
|
12
12
|
selectionSet,
|
13
13
|
};
|
14
|
+
|
14
15
|
const currentMessageId = ctx.stash.defaultValues.id;
|
15
16
|
|
16
17
|
const modelConfiguration = {
|
@@ -37,12 +38,13 @@ export function request(ctx) {
|
|
37
38
|
const payload = {
|
38
39
|
conversationId: args.conversationId,
|
39
40
|
currentMessageId,
|
40
|
-
responseMutation,
|
41
|
+
responseMutation: streamingResponseMutation,
|
41
42
|
graphqlApiEndpoint,
|
42
43
|
modelConfiguration,
|
43
44
|
request: { headers: { authorization: authHeader } },
|
44
45
|
messageHistoryQuery,
|
45
46
|
toolsConfiguration,
|
47
|
+
streamResponse: true,
|
46
48
|
};
|
47
49
|
|
48
50
|
return {
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { util } from '@aws-appsync/utils';
|
2
|
+
|
3
|
+
export function request(ctx) {
|
4
|
+
ctx.stash.metadata.index = '[[INDEX_NAME]]';
|
5
|
+
ctx.stash.modelQueryExpression = [[MODEL_QUERY_EXPRESSION]];
|
6
|
+
ctx.args.sortDirection = '[[SORT_DIRECTION]]';
|
7
|
+
return {};
|
8
|
+
}
|
9
|
+
|
10
|
+
export function response(ctx) {
|
11
|
+
return {};
|
12
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { util } from '@aws-appsync/utils';
|
2
|
+
|
3
|
+
export function request(ctx) {
|
4
|
+
ctx.stash.metadata.index = '[[INDEX_NAME]]';
|
5
|
+
const conversationId = ctx.args?.filter?.conversationId?.eq;
|
6
|
+
if (conversationId) {
|
7
|
+
// If a conversationId was provided, we're going to execute a query
|
8
|
+
// rather than a scan. The index (gsi) we're performing this query on has
|
9
|
+
// a partitionKey of conversationId.
|
10
|
+
// We need to remove conversationId from the filter to prevent a
|
11
|
+
// DynamoDB exception:
|
12
|
+
// `Filter Expression can only contain non-primary key attributes`
|
13
|
+
delete ctx.args.filter.conversationId;
|
14
|
+
// If conversationId was the only filter, remove the filter object
|
15
|
+
// to prevent errors when the `{}` filter is combined with
|
16
|
+
// the `authFilter` further downstream.
|
17
|
+
if (Object.keys(ctx.args.filter).length === 0) {
|
18
|
+
delete ctx.args.filter;
|
19
|
+
}
|
20
|
+
ctx.stash.modelQueryExpression = {
|
21
|
+
expression: '#conversationId = :conversationId',
|
22
|
+
expressionNames: {
|
23
|
+
'#conversationId': 'conversationId',
|
24
|
+
},
|
25
|
+
expressionValues: util.dynamodb.toMapValues({
|
26
|
+
':conversationId': conversationId,
|
27
|
+
}),
|
28
|
+
};
|
29
|
+
}
|
30
|
+
ctx.args.sortDirection = 'DESC';
|
31
|
+
return {};
|
32
|
+
}
|
33
|
+
|
34
|
+
export function response(ctx) {
|
35
|
+
return {};
|
36
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
export function request(ctx) {
|
2
|
+
return {};
|
3
|
+
}
|
4
|
+
|
5
|
+
export function response(ctx) {
|
6
|
+
// Conversation messages are retrieved from DynamoDB in descending order by createdAt.
|
7
|
+
// We reverse them here because the most recent messages should be last in the list for clients:
|
8
|
+
// We can't use ascending order because we can miss the most recent messages due to limits / pagination.
|
9
|
+
const { items, ...rest } = ctx.prev.result;
|
10
|
+
const reversed = items.reverse();
|
11
|
+
return { items: reversed, ...rest };
|
12
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { util } from '@aws-appsync/utils';
|
2
|
+
|
3
|
+
export function request(ctx) {
|
4
|
+
const { authFilter } = ctx.stash;
|
5
|
+
const { conversationId } = [[CONVERSATION_ID_PARENT]];
|
6
|
+
|
7
|
+
const filter = JSON.parse(util.transform.toDynamoDBFilterExpression(authFilter));
|
8
|
+
|
9
|
+
return {
|
10
|
+
operation: 'UpdateItem',
|
11
|
+
key: util.dynamodb.toMapValues({ id: conversationId }),
|
12
|
+
update: {
|
13
|
+
expression: 'SET #updatedAt = :updatedAt',
|
14
|
+
expressionValues: util.dynamodb.toMapValues({
|
15
|
+
':updatedAt': ctx.stash.defaultValues.createdAt,
|
16
|
+
}),
|
17
|
+
expressionNames: {
|
18
|
+
'#updatedAt': 'updatedAt',
|
19
|
+
},
|
20
|
+
},
|
21
|
+
condition: filter
|
22
|
+
};
|
23
|
+
}
|
24
|
+
|
25
|
+
export function response(ctx) {
|
26
|
+
if (ctx.error) {
|
27
|
+
util.error('Conversation not found', 'ResourceNotFound');
|
28
|
+
}
|
29
|
+
|
30
|
+
return ctx.result;
|
31
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"conversation-field-handler.d.ts","sourceRoot":"","sources":["../../src/transformer-steps/conversation-field-handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yCAAyC,EAAE,MAAM,6CAA6C,CAAC;AACxG,OAAO,EACL,aAAa,EACb,mBAAmB,EAEnB,2BAA2B,EAC3B,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;
|
1
|
+
{"version":3,"file":"conversation-field-handler.d.ts","sourceRoot":"","sources":["../../src/transformer-steps/conversation-field-handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yCAAyC,EAAE,MAAM,6CAA6C,CAAC;AACxG,OAAO,EACL,aAAa,EACb,mBAAmB,EAEnB,2BAA2B,EAC3B,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AA0B7F,qBAAa,wBAAwB;IAWnC,kBAAkB,CAChB,MAAM,EAAE,wBAAwB,GAAG,2BAA2B,EAC9D,UAAU,EAAE,mBAAmB,EAC/B,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,yCAAyC,GACjD,kCAAkC;IA0BrC,OAAO,CAAC,qBAAqB;IA4B7B,OAAO,CAAC,YAAY;IAyBpB,OAAO,CAAC,sBAAsB;IAwC9B,OAAO,CAAC,QAAQ;IAWhB,OAAO,CAAC,eAAe;IAmBvB,OAAO,CAAC,kBAAkB;IAa1B,OAAO,CAAC,uBAAuB;CAqBhC"}
|
@@ -68,11 +68,18 @@ class ConversationFieldHandler {
|
|
68
68
|
const conversationMessageTypeName = (0, name_values_1.getConversationMessageTypeName)(config);
|
69
69
|
const messageSubscriptionFieldName = (0, name_values_1.getMessageSubscriptionFieldName)(config);
|
70
70
|
const assistantMutationFieldName = (0, name_values_1.getAssistantMutationFieldName)(config);
|
71
|
-
const
|
71
|
+
const assistantStreamingMutationFieldName = (0, name_values_1.getAssistantStreamingMutationFieldName)(config);
|
72
|
+
const assistantResponseSubscriptionField = (0, message_model_1.createMessageSubscription)(messageSubscriptionFieldName, assistantStreamingMutationFieldName);
|
72
73
|
const assistantResponseMutationInput = (0, message_model_1.createAssistantResponseMutationInput)(conversationMessageTypeName);
|
73
74
|
const assistantResponseMutationField = (0, message_model_1.createAssistantMutationField)(assistantMutationFieldName, conversationMessageTypeName, assistantResponseMutationInput.name.value);
|
75
|
+
const assistantResponseStreamingMutationInput = (0, message_model_1.createAssistantResponseStreamingMutationInput)(conversationMessageTypeName);
|
76
|
+
const assistantResponseStreamingMutationField = (0, message_model_1.createAssistantStreamingMutationField)(assistantStreamingMutationFieldName, assistantResponseStreamingMutationInput.name.value);
|
74
77
|
return {
|
75
78
|
assistantResponseMutation: { field: assistantResponseMutationField, input: assistantResponseMutationInput },
|
79
|
+
assistantResponseStreamingMutation: {
|
80
|
+
field: assistantResponseStreamingMutationField,
|
81
|
+
input: assistantResponseStreamingMutationInput,
|
82
|
+
},
|
76
83
|
assistantResponseSubscriptionField,
|
77
84
|
};
|
78
85
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"conversation-field-handler.js","sourceRoot":"","sources":["../../src/transformer-steps/conversation-field-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oFAA2H;AAS3H,+CAAiC;AAEjC,4EAAiG;AACjG,
|
1
|
+
{"version":3,"file":"conversation-field-handler.js","sourceRoot":"","sources":["../../src/transformer-steps/conversation-field-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oFAA2H;AAS3H,+CAAiC;AAEjC,4EAAiG;AACjG,kEASwC;AACxC,8DAOsC;AAOtC,MAAa,wBAAwB;IAWnC,kBAAkB,CAChB,MAA8D,EAC9D,UAA+B,EAC/B,SAAwB,EACxB,OAAkD;QAElD,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,KAAK,UAAU,EAAE;YACpC,MAAM,IAAI,gDAAqB,CAAC,yDAAyD,CAAC,CAAC;SAC5F;QACD,MAAM,YAAY,GAAG,IAAI,CAAC,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QACxF,MAAM,kBAAkB,GAAG,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QACvE,MAAM,gBAAgB,GAAG,IAAI,CAAC,sBAAsB,CAAC,YAAY,CAAC,CAAC;QACnE,MAAM,MAAM,GAAG;YACb,GAAG,YAAY;YACf,GAAG,kBAAkB;YACrB,GAAG,gBAAgB;SACpB,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACtB,OAAO,MAAM,CAAC;IAChB,CAAC;IAYO,qBAAqB,CAC3B,SAAwB,EACxB,MAA8D,EAC9D,UAA+B,EAC/B,OAAkD;QAElD,MAAM,gBAAgB,GAAG,IAAI,2CAAgB,CAAC,SAAS,CAAC,CAAC;QACzD,MAAM,MAAM,GAAG,gBAAgB,CAAC,YAAY,CAC1C;YACE,MAAM;YACN,SAAS;YACT,KAAK,EAAE,UAAU;SACoB,EACvC,IAAA,oDAAyB,EAAC,OAAO,CAAC,mBAAmB,CAAC,CACvD,CAAC;QAEF,OAAO,MAAM,CAAC;I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,gDAAqB,CAAC,uDAAuD,CAAC,CAAC;SAC1F;IACH,CAAC;IAOO,uBAAuB,CAAC,MAA0C;QACxE,IAAI,CAAC,MAAM,CAAC,sBAAsB;YAAE,OAAO;QAC3C,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,sBAAsB,CAAC;QAGvE,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,GAAG,CAAC,EAAE;YAC5C,MAAM,IAAI,gDAAqB,CAAC,gFAAgF,SAAS,EAAE,CAAC,CAAC;SAC9H;QAED,IAAI,WAAW,KAAK,SAAS,IAAI,CAAC,WAAW,GAAG,CAAC,IAAI,WAAW,GAAG,CAAC,CAAC,EAAE;YACrE,MAAM,IAAI,gDAAqB,CAC7B,sGAAsG,WAAW,EAAE,CACpH,CAAC;SACH;QAED,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,EAAE;YAChD,MAAM,IAAI,gDAAqB,CAC7B,+FAA+F,IAAI,EAAE,CACtG,CAAC;SACH;IACH,CAAC;CACF;AAvMD,4DAuMC"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { ModelTransformer } from '@aws-amplify/graphql-model-transformer';
|
2
2
|
import { BelongsToTransformer, HasManyTransformer } from '@aws-amplify/graphql-relational-transformer';
|
3
|
-
import { TransformerAuthProvider, TransformerPrepareStepContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
4
3
|
import { ConversationDirectiveConfiguration } from '../conversation-directive-configuration';
|
4
|
+
import { TransformerAuthProvider, TransformerPrepareStepContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
5
5
|
export declare class ConversationPrepareHandler {
|
6
6
|
private modelTransformer;
|
7
7
|
private hasManyTransformer;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"conversation-prepare-handler.d.ts","sourceRoot":"","sources":["../../src/transformer-steps/conversation-prepare-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAEvG,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"conversation-prepare-handler.d.ts","sourceRoot":"","sources":["../../src/transformer-steps/conversation-prepare-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAEvG,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAE7F,OAAO,EAAE,uBAAuB,EAAE,qCAAqC,EAAE,MAAM,6CAA6C,CAAC;AAO7H,qBAAa,0BAA0B;IACrC,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,oBAAoB,CAAuB;IACnD,OAAO,CAAC,YAAY,CAA0B;gBAU5C,gBAAgB,EAAE,gBAAgB,EAClC,kBAAkB,EAAE,kBAAkB,EACtC,oBAAoB,EAAE,oBAAoB,EAC1C,YAAY,EAAE,uBAAuB;IAmBvC,OAAO,CAAC,GAAG,EAAE,qCAAqC,EAAE,UAAU,EAAE,kCAAkC,EAAE,GAAG,IAAI;IAsB3G,OAAO,CAAC,4BAA4B;CA6CrC"}
|
@@ -2,6 +2,7 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.ConversationPrepareHandler = void 0;
|
4
4
|
const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-core");
|
5
|
+
const message_model_1 = require("../graphql-types/message-model");
|
5
6
|
class ConversationPrepareHandler {
|
6
7
|
constructor(modelTransformer, hasManyTransformer, belongsToTransformer, authProvider) {
|
7
8
|
this.modelTransformer = modelTransformer;
|
@@ -10,16 +11,19 @@ class ConversationPrepareHandler {
|
|
10
11
|
this.authProvider = authProvider;
|
11
12
|
}
|
12
13
|
prepare(ctx, directives) {
|
14
|
+
const conversationTurnErrorInput = (0, message_model_1.createConversationTurnErrorInput)();
|
15
|
+
ctx.output.addInput(conversationTurnErrorInput);
|
13
16
|
for (const directive of directives) {
|
14
17
|
this.prepareResourcesForDirective(directive, ctx);
|
15
18
|
}
|
16
19
|
}
|
17
20
|
prepareResourcesForDirective(directive, ctx) {
|
18
|
-
const { conversation, message, assistantResponseMutation, assistantResponseSubscriptionField } = directive;
|
21
|
+
const { conversation, message, assistantResponseMutation, assistantResponseStreamingMutation, assistantResponseSubscriptionField } = directive;
|
19
22
|
const conversationName = conversation.model.name.value;
|
20
23
|
const messageName = message.model.name.value;
|
21
24
|
ctx.output.addInput(assistantResponseMutation.input);
|
22
|
-
ctx.output.
|
25
|
+
ctx.output.addInput(assistantResponseStreamingMutation.input);
|
26
|
+
ctx.output.addMutationFields([assistantResponseMutation.field, assistantResponseStreamingMutation.field]);
|
23
27
|
ctx.output.addSubscriptionFields([assistantResponseSubscriptionField]);
|
24
28
|
ctx.output.addObject(conversation.model);
|
25
29
|
ctx.output.addObject(message.model);
|