@aws-amplify/data-schema 1.7.0 → 1.8.1
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/runtime/internals/ai/convertItemToConversation.js +5 -1
- package/dist/cjs/runtime/internals/ai/convertItemToConversation.js.map +1 -1
- package/dist/cjs/runtime/internals/ai/createCreateConversationFunction.js +1 -1
- package/dist/cjs/runtime/internals/ai/createCreateConversationFunction.js.map +1 -1
- package/dist/cjs/runtime/internals/ai/createDeleteConversationFunction.js +1 -1
- package/dist/cjs/runtime/internals/ai/createDeleteConversationFunction.js.map +1 -1
- package/dist/cjs/runtime/internals/ai/createGetConversationFunction.js +1 -1
- package/dist/cjs/runtime/internals/ai/createGetConversationFunction.js.map +1 -1
- package/dist/cjs/runtime/internals/ai/createListConversationsFunction.js +1 -1
- package/dist/cjs/runtime/internals/ai/createListConversationsFunction.js.map +1 -1
- package/dist/cjs/runtime/internals/ai/createSendMessageFunction.js +3 -1
- package/dist/cjs/runtime/internals/ai/createSendMessageFunction.js.map +1 -1
- package/dist/esm/ai/ConversationType.d.ts +7 -2
- package/dist/esm/runtime/internals/ai/convertItemToConversation.d.ts +1 -1
- package/dist/esm/runtime/internals/ai/convertItemToConversation.mjs +5 -1
- package/dist/esm/runtime/internals/ai/convertItemToConversation.mjs.map +1 -1
- package/dist/esm/runtime/internals/ai/createCreateConversationFunction.mjs +1 -1
- package/dist/esm/runtime/internals/ai/createCreateConversationFunction.mjs.map +1 -1
- package/dist/esm/runtime/internals/ai/createDeleteConversationFunction.mjs +1 -1
- package/dist/esm/runtime/internals/ai/createDeleteConversationFunction.mjs.map +1 -1
- package/dist/esm/runtime/internals/ai/createGetConversationFunction.mjs +1 -1
- package/dist/esm/runtime/internals/ai/createGetConversationFunction.mjs.map +1 -1
- package/dist/esm/runtime/internals/ai/createListConversationsFunction.mjs +1 -1
- package/dist/esm/runtime/internals/ai/createListConversationsFunction.mjs.map +1 -1
- package/dist/esm/runtime/internals/ai/createSendMessageFunction.mjs +3 -1
- package/dist/esm/runtime/internals/ai/createSendMessageFunction.mjs.map +1 -1
- package/dist/meta/cjs.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/ai/ConversationType.ts +12 -3
- package/src/runtime/internals/ai/convertItemToConversation.ts +8 -0
- package/src/runtime/internals/ai/createCreateConversationFunction.ts +4 -0
- package/src/runtime/internals/ai/createDeleteConversationFunction.ts +4 -0
- package/src/runtime/internals/ai/createGetConversationFunction.ts +4 -0
- package/src/runtime/internals/ai/createListConversationsFunction.ts +4 -0
- package/src/runtime/internals/ai/createSendMessageFunction.ts +8 -1
|
@@ -7,12 +7,16 @@ exports.convertItemToConversation = void 0;
|
|
|
7
7
|
const createListMessagesFunction_1 = require("./createListMessagesFunction");
|
|
8
8
|
const createOnMessageFunction_1 = require("./createOnMessageFunction");
|
|
9
9
|
const createSendMessageFunction_1 = require("./createSendMessageFunction");
|
|
10
|
-
const convertItemToConversation = (client, modelIntrospection, conversationId, conversationRouteName, conversationMessageModel, getInternals) => {
|
|
10
|
+
const convertItemToConversation = (client, modelIntrospection, conversationId, conversationCreatedAt, conversationUpdatedAt, conversationRouteName, conversationMessageModel, getInternals, conversationMetadata, conversationName) => {
|
|
11
11
|
if (!conversationId) {
|
|
12
12
|
throw new Error(`An error occurred converting a ${conversationRouteName} conversation: Missing ID`);
|
|
13
13
|
}
|
|
14
14
|
return {
|
|
15
15
|
id: conversationId,
|
|
16
|
+
createdAt: conversationCreatedAt,
|
|
17
|
+
updatedAt: conversationUpdatedAt,
|
|
18
|
+
metadata: conversationMetadata,
|
|
19
|
+
name: conversationName,
|
|
16
20
|
onMessage: (0, createOnMessageFunction_1.createOnMessageFunction)(client, modelIntrospection, conversationId, conversationRouteName, getInternals),
|
|
17
21
|
sendMessage: (0, createSendMessageFunction_1.createSendMessageFunction)(client, modelIntrospection, conversationId, conversationRouteName, getInternals),
|
|
18
22
|
listMessages: (0, createListMessagesFunction_1.createListMessagesFunction)(client, modelIntrospection, conversationId, conversationMessageModel, getInternals),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertItemToConversation.js","sources":["../../../../../src/runtime/internals/ai/convertItemToConversation.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.convertItemToConversation = void 0;\nconst createListMessagesFunction_1 = require(\"./createListMessagesFunction\");\nconst createOnMessageFunction_1 = require(\"./createOnMessageFunction\");\nconst createSendMessageFunction_1 = require(\"./createSendMessageFunction\");\nconst convertItemToConversation = (client, modelIntrospection, conversationId, conversationRouteName, conversationMessageModel, getInternals) => {\n if (!conversationId) {\n throw new Error(`An error occurred converting a ${conversationRouteName} conversation: Missing ID`);\n }\n return {\n id: conversationId,\n onMessage: (0, createOnMessageFunction_1.createOnMessageFunction)(client, modelIntrospection, conversationId, conversationRouteName, getInternals),\n sendMessage: (0, createSendMessageFunction_1.createSendMessageFunction)(client, modelIntrospection, conversationId, conversationRouteName, getInternals),\n listMessages: (0, createListMessagesFunction_1.createListMessagesFunction)(client, modelIntrospection, conversationId, conversationMessageModel, getInternals),\n };\n};\nexports.convertItemToConversation = convertItemToConversation;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,yBAAyB,GAAG,KAAK,CAAC,CAAC;AAC3C,MAAM,4BAA4B,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;AAC7E,MAAM,yBAAyB,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;AACvE,MAAM,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC3E,MAAM,yBAAyB,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,cAAc,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,YAAY,KAAK;
|
|
1
|
+
{"version":3,"file":"convertItemToConversation.js","sources":["../../../../../src/runtime/internals/ai/convertItemToConversation.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.convertItemToConversation = void 0;\nconst createListMessagesFunction_1 = require(\"./createListMessagesFunction\");\nconst createOnMessageFunction_1 = require(\"./createOnMessageFunction\");\nconst createSendMessageFunction_1 = require(\"./createSendMessageFunction\");\nconst convertItemToConversation = (client, modelIntrospection, conversationId, conversationCreatedAt, conversationUpdatedAt, conversationRouteName, conversationMessageModel, getInternals, conversationMetadata, conversationName) => {\n if (!conversationId) {\n throw new Error(`An error occurred converting a ${conversationRouteName} conversation: Missing ID`);\n }\n return {\n id: conversationId,\n createdAt: conversationCreatedAt,\n updatedAt: conversationUpdatedAt,\n metadata: conversationMetadata,\n name: conversationName,\n onMessage: (0, createOnMessageFunction_1.createOnMessageFunction)(client, modelIntrospection, conversationId, conversationRouteName, getInternals),\n sendMessage: (0, createSendMessageFunction_1.createSendMessageFunction)(client, modelIntrospection, conversationId, conversationRouteName, getInternals),\n listMessages: (0, createListMessagesFunction_1.createListMessagesFunction)(client, modelIntrospection, conversationId, conversationMessageModel, getInternals),\n };\n};\nexports.convertItemToConversation = convertItemToConversation;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,yBAAyB,GAAG,KAAK,CAAC,CAAC;AAC3C,MAAM,4BAA4B,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;AAC7E,MAAM,yBAAyB,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;AACvE,MAAM,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC3E,MAAM,yBAAyB,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,cAAc,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,YAAY,EAAE,oBAAoB,EAAE,gBAAgB,KAAK;AACvO,IAAI,IAAI,CAAC,cAAc,EAAE;AACzB,QAAQ,MAAM,IAAI,KAAK,CAAC,CAAC,+BAA+B,EAAE,qBAAqB,CAAC,yBAAyB,CAAC,CAAC,CAAC;AAC5G,KAAK;AACL,IAAI,OAAO;AACX,QAAQ,EAAE,EAAE,cAAc;AAC1B,QAAQ,SAAS,EAAE,qBAAqB;AACxC,QAAQ,SAAS,EAAE,qBAAqB;AACxC,QAAQ,QAAQ,EAAE,oBAAoB;AACtC,QAAQ,IAAI,EAAE,gBAAgB;AAC9B,QAAQ,SAAS,EAAE,IAAI,yBAAyB,CAAC,uBAAuB,EAAE,MAAM,EAAE,kBAAkB,EAAE,cAAc,EAAE,qBAAqB,EAAE,YAAY,CAAC;AAC1J,QAAQ,WAAW,EAAE,IAAI,2BAA2B,CAAC,yBAAyB,EAAE,MAAM,EAAE,kBAAkB,EAAE,cAAc,EAAE,qBAAqB,EAAE,YAAY,CAAC;AAChK,QAAQ,YAAY,EAAE,IAAI,4BAA4B,CAAC,0BAA0B,EAAE,MAAM,EAAE,kBAAkB,EAAE,cAAc,EAAE,wBAAwB,EAAE,YAAY,CAAC;AACtK,KAAK,CAAC;AACN,CAAC,CAAC;AACF,OAAO,CAAC,yBAAyB,GAAG,yBAAyB;;"}
|
|
@@ -11,7 +11,7 @@ const createCreateConversationFunction = (client, modelIntrospection, conversati
|
|
|
11
11
|
const get = (0, get_1.getFactory)(client, modelIntrospection, conversationModel, 'CREATE', getInternals, false, (0, getCustomUserAgentDetails_1.getCustomUserAgentDetails)(getCustomUserAgentDetails_1.AiAction.CreateConversation));
|
|
12
12
|
const { data, errors } = await get();
|
|
13
13
|
return {
|
|
14
|
-
data: (0, convertItemToConversation_1.convertItemToConversation)(client, modelIntrospection, data?.id, conversationRouteName, conversationMessageModel, getInternals),
|
|
14
|
+
data: (0, convertItemToConversation_1.convertItemToConversation)(client, modelIntrospection, data?.id, data?.createdAt, data?.updatedAt, conversationRouteName, conversationMessageModel, getInternals, data?.metadata, data?.name),
|
|
15
15
|
errors,
|
|
16
16
|
};
|
|
17
17
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCreateConversationFunction.js","sources":["../../../../../src/runtime/internals/ai/createCreateConversationFunction.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createCreateConversationFunction = void 0;\nconst get_1 = require(\"../operations/get\");\nconst convertItemToConversation_1 = require(\"./convertItemToConversation\");\nconst getCustomUserAgentDetails_1 = require(\"./getCustomUserAgentDetails\");\nconst createCreateConversationFunction = (client, modelIntrospection, conversationRouteName, conversationModel, conversationMessageModel, getInternals) => async () => {\n const get = (0, get_1.getFactory)(client, modelIntrospection, conversationModel, 'CREATE', getInternals, false, (0, getCustomUserAgentDetails_1.getCustomUserAgentDetails)(getCustomUserAgentDetails_1.AiAction.CreateConversation));\n const { data, errors } = await get();\n return {\n data: (0, convertItemToConversation_1.convertItemToConversation)(client, modelIntrospection, data?.id, conversationRouteName, conversationMessageModel, getInternals),\n errors,\n };\n};\nexports.createCreateConversationFunction = createCreateConversationFunction;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,gCAAgC,GAAG,KAAK,CAAC,CAAC;AAClD,MAAM,KAAK,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC3C,MAAM,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC3E,MAAM,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC3E,MAAM,gCAAgC,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,YAAY,KAAK,YAAY;AACvK,IAAI,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,2BAA2B,CAAC,yBAAyB,EAAE,2BAA2B,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC;AACzO,IAAI,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,EAAE,CAAC;AACzC,IAAI,OAAO;AACX,QAAQ,IAAI,EAAE,IAAI,2BAA2B,CAAC,yBAAyB,EAAE,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,EAAE,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"createCreateConversationFunction.js","sources":["../../../../../src/runtime/internals/ai/createCreateConversationFunction.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createCreateConversationFunction = void 0;\nconst get_1 = require(\"../operations/get\");\nconst convertItemToConversation_1 = require(\"./convertItemToConversation\");\nconst getCustomUserAgentDetails_1 = require(\"./getCustomUserAgentDetails\");\nconst createCreateConversationFunction = (client, modelIntrospection, conversationRouteName, conversationModel, conversationMessageModel, getInternals) => async () => {\n const get = (0, get_1.getFactory)(client, modelIntrospection, conversationModel, 'CREATE', getInternals, false, (0, getCustomUserAgentDetails_1.getCustomUserAgentDetails)(getCustomUserAgentDetails_1.AiAction.CreateConversation));\n const { data, errors } = await get();\n return {\n data: (0, convertItemToConversation_1.convertItemToConversation)(client, modelIntrospection, data?.id, data?.createdAt, data?.updatedAt, conversationRouteName, conversationMessageModel, getInternals, data?.metadata, data?.name),\n errors,\n };\n};\nexports.createCreateConversationFunction = createCreateConversationFunction;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,gCAAgC,GAAG,KAAK,CAAC,CAAC;AAClD,MAAM,KAAK,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC3C,MAAM,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC3E,MAAM,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC3E,MAAM,gCAAgC,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,YAAY,KAAK,YAAY;AACvK,IAAI,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,2BAA2B,CAAC,yBAAyB,EAAE,2BAA2B,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC;AACzO,IAAI,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,EAAE,CAAC;AACzC,IAAI,OAAO;AACX,QAAQ,IAAI,EAAE,IAAI,2BAA2B,CAAC,yBAAyB,EAAE,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC;AAC3O,QAAQ,MAAM;AACd,KAAK,CAAC;AACN,CAAC,CAAC;AACF,OAAO,CAAC,gCAAgC,GAAG,gCAAgC;;"}
|
|
@@ -12,7 +12,7 @@ const createDeleteConversationFunction = (client, modelIntrospection, conversati
|
|
|
12
12
|
const { data, errors } = await deleteOperation({ id });
|
|
13
13
|
return {
|
|
14
14
|
data: data
|
|
15
|
-
? (0, convertItemToConversation_1.convertItemToConversation)(client, modelIntrospection, data?.id, conversationRouteName, conversationMessageModel, getInternals)
|
|
15
|
+
? (0, convertItemToConversation_1.convertItemToConversation)(client, modelIntrospection, data?.id, data?.createdAt, data?.updatedAt, conversationRouteName, conversationMessageModel, getInternals, data?.metadata, data?.name)
|
|
16
16
|
: data,
|
|
17
17
|
errors,
|
|
18
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createDeleteConversationFunction.js","sources":["../../../../../src/runtime/internals/ai/createDeleteConversationFunction.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createDeleteConversationFunction = void 0;\nconst get_1 = require(\"../operations/get\");\nconst convertItemToConversation_1 = require(\"./convertItemToConversation\");\nconst getCustomUserAgentDetails_1 = require(\"./getCustomUserAgentDetails\");\nconst createDeleteConversationFunction = (client, modelIntrospection, conversationRouteName, conversationModel, conversationMessageModel, getInternals) => async ({ id }) => {\n const deleteOperation = (0, get_1.getFactory)(client, modelIntrospection, conversationModel, 'DELETE', getInternals, false, (0, getCustomUserAgentDetails_1.getCustomUserAgentDetails)(getCustomUserAgentDetails_1.AiAction.DeleteConversation));\n const { data, errors } = await deleteOperation({ id });\n return {\n data: data\n ? (0, convertItemToConversation_1.convertItemToConversation)(client, modelIntrospection, data?.id, conversationRouteName, conversationMessageModel, getInternals)\n : data,\n errors,\n };\n};\nexports.createDeleteConversationFunction = createDeleteConversationFunction;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,gCAAgC,GAAG,KAAK,CAAC,CAAC;AAClD,MAAM,KAAK,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC3C,MAAM,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC3E,MAAM,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC3E,MAAM,gCAAgC,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,YAAY,KAAK,OAAO,EAAE,EAAE,EAAE,KAAK;AAC7K,IAAI,MAAM,eAAe,GAAG,IAAI,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,2BAA2B,CAAC,yBAAyB,EAAE,2BAA2B,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC;AACrP,IAAI,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,eAAe,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC3D,IAAI,OAAO;AACX,QAAQ,IAAI,EAAE,IAAI;AAClB,cAAc,IAAI,2BAA2B,CAAC,yBAAyB,EAAE,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,EAAE,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"createDeleteConversationFunction.js","sources":["../../../../../src/runtime/internals/ai/createDeleteConversationFunction.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createDeleteConversationFunction = void 0;\nconst get_1 = require(\"../operations/get\");\nconst convertItemToConversation_1 = require(\"./convertItemToConversation\");\nconst getCustomUserAgentDetails_1 = require(\"./getCustomUserAgentDetails\");\nconst createDeleteConversationFunction = (client, modelIntrospection, conversationRouteName, conversationModel, conversationMessageModel, getInternals) => async ({ id }) => {\n const deleteOperation = (0, get_1.getFactory)(client, modelIntrospection, conversationModel, 'DELETE', getInternals, false, (0, getCustomUserAgentDetails_1.getCustomUserAgentDetails)(getCustomUserAgentDetails_1.AiAction.DeleteConversation));\n const { data, errors } = await deleteOperation({ id });\n return {\n data: data\n ? (0, convertItemToConversation_1.convertItemToConversation)(client, modelIntrospection, data?.id, data?.createdAt, data?.updatedAt, conversationRouteName, conversationMessageModel, getInternals, data?.metadata, data?.name)\n : data,\n errors,\n };\n};\nexports.createDeleteConversationFunction = createDeleteConversationFunction;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,gCAAgC,GAAG,KAAK,CAAC,CAAC;AAClD,MAAM,KAAK,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC3C,MAAM,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC3E,MAAM,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC3E,MAAM,gCAAgC,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,YAAY,KAAK,OAAO,EAAE,EAAE,EAAE,KAAK;AAC7K,IAAI,MAAM,eAAe,GAAG,IAAI,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,2BAA2B,CAAC,yBAAyB,EAAE,2BAA2B,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC;AACrP,IAAI,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,eAAe,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC3D,IAAI,OAAO;AACX,QAAQ,IAAI,EAAE,IAAI;AAClB,cAAc,IAAI,2BAA2B,CAAC,yBAAyB,EAAE,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC;AAC3O,cAAc,IAAI;AAClB,QAAQ,MAAM;AACd,KAAK,CAAC;AACN,CAAC,CAAC;AACF,OAAO,CAAC,gCAAgC,GAAG,gCAAgC;;"}
|
|
@@ -12,7 +12,7 @@ const createGetConversationFunction = (client, modelIntrospection, conversationR
|
|
|
12
12
|
const { data, errors } = await get({ id });
|
|
13
13
|
return {
|
|
14
14
|
data: data
|
|
15
|
-
? (0, convertItemToConversation_1.convertItemToConversation)(client, modelIntrospection, data.id, conversationRouteName, conversationMessageModel, getInternals)
|
|
15
|
+
? (0, convertItemToConversation_1.convertItemToConversation)(client, modelIntrospection, data.id, data.createdAt, data.updatedAt, conversationRouteName, conversationMessageModel, getInternals, data?.metadata, data?.name)
|
|
16
16
|
: data,
|
|
17
17
|
errors,
|
|
18
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createGetConversationFunction.js","sources":["../../../../../src/runtime/internals/ai/createGetConversationFunction.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createGetConversationFunction = void 0;\nconst get_1 = require(\"../operations/get\");\nconst convertItemToConversation_1 = require(\"./convertItemToConversation\");\nconst getCustomUserAgentDetails_1 = require(\"./getCustomUserAgentDetails\");\nconst createGetConversationFunction = (client, modelIntrospection, conversationRouteName, conversationModel, conversationMessageModel, getInternals) => async ({ id }) => {\n const get = (0, get_1.getFactory)(client, modelIntrospection, conversationModel, 'GET', getInternals, false, (0, getCustomUserAgentDetails_1.getCustomUserAgentDetails)(getCustomUserAgentDetails_1.AiAction.GetConversation));\n const { data, errors } = await get({ id });\n return {\n data: data\n ? (0, convertItemToConversation_1.convertItemToConversation)(client, modelIntrospection, data.id, conversationRouteName, conversationMessageModel, getInternals)\n : data,\n errors,\n };\n};\nexports.createGetConversationFunction = createGetConversationFunction;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,6BAA6B,GAAG,KAAK,CAAC,CAAC;AAC/C,MAAM,KAAK,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC3C,MAAM,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC3E,MAAM,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC3E,MAAM,6BAA6B,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,YAAY,KAAK,OAAO,EAAE,EAAE,EAAE,KAAK;AAC1K,IAAI,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,2BAA2B,CAAC,yBAAyB,EAAE,2BAA2B,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC;AACnO,IAAI,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC/C,IAAI,OAAO;AACX,QAAQ,IAAI,EAAE,IAAI;AAClB,cAAc,IAAI,2BAA2B,CAAC,yBAAyB,EAAE,MAAM,EAAE,kBAAkB,EAAE,IAAI,CAAC,EAAE,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"createGetConversationFunction.js","sources":["../../../../../src/runtime/internals/ai/createGetConversationFunction.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createGetConversationFunction = void 0;\nconst get_1 = require(\"../operations/get\");\nconst convertItemToConversation_1 = require(\"./convertItemToConversation\");\nconst getCustomUserAgentDetails_1 = require(\"./getCustomUserAgentDetails\");\nconst createGetConversationFunction = (client, modelIntrospection, conversationRouteName, conversationModel, conversationMessageModel, getInternals) => async ({ id }) => {\n const get = (0, get_1.getFactory)(client, modelIntrospection, conversationModel, 'GET', getInternals, false, (0, getCustomUserAgentDetails_1.getCustomUserAgentDetails)(getCustomUserAgentDetails_1.AiAction.GetConversation));\n const { data, errors } = await get({ id });\n return {\n data: data\n ? (0, convertItemToConversation_1.convertItemToConversation)(client, modelIntrospection, data.id, data.createdAt, data.updatedAt, conversationRouteName, conversationMessageModel, getInternals, data?.metadata, data?.name)\n : data,\n errors,\n };\n};\nexports.createGetConversationFunction = createGetConversationFunction;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,6BAA6B,GAAG,KAAK,CAAC,CAAC;AAC/C,MAAM,KAAK,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC3C,MAAM,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC3E,MAAM,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC3E,MAAM,6BAA6B,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,YAAY,KAAK,OAAO,EAAE,EAAE,EAAE,KAAK;AAC1K,IAAI,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,2BAA2B,CAAC,yBAAyB,EAAE,2BAA2B,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC;AACnO,IAAI,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC/C,IAAI,OAAO;AACX,QAAQ,IAAI,EAAE,IAAI;AAClB,cAAc,IAAI,2BAA2B,CAAC,yBAAyB,EAAE,MAAM,EAAE,kBAAkB,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC;AACxO,cAAc,IAAI;AAClB,QAAQ,MAAM;AACd,KAAK,CAAC;AACN,CAAC,CAAC;AACF,OAAO,CAAC,6BAA6B,GAAG,6BAA6B;;"}
|
|
@@ -12,7 +12,7 @@ const createListConversationsFunction = (client, modelIntrospection, conversatio
|
|
|
12
12
|
const { data, nextToken, errors } = await list(input);
|
|
13
13
|
return {
|
|
14
14
|
data: data.map((datum) => {
|
|
15
|
-
return (0, convertItemToConversation_1.convertItemToConversation)(client, modelIntrospection, datum.id, conversationRouteName, conversationMessageModel, getInternals);
|
|
15
|
+
return (0, convertItemToConversation_1.convertItemToConversation)(client, modelIntrospection, datum.id, datum.createdAt, datum.updatedAt, conversationRouteName, conversationMessageModel, getInternals, datum?.metadata, datum?.name);
|
|
16
16
|
}),
|
|
17
17
|
nextToken,
|
|
18
18
|
errors,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createListConversationsFunction.js","sources":["../../../../../src/runtime/internals/ai/createListConversationsFunction.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createListConversationsFunction = void 0;\nconst list_1 = require(\"../operations/list\");\nconst convertItemToConversation_1 = require(\"./convertItemToConversation\");\nconst getCustomUserAgentDetails_1 = require(\"./getCustomUserAgentDetails\");\nconst createListConversationsFunction = (client, modelIntrospection, conversationRouteName, conversationModel, conversationMessageModel, getInternals) => async (input) => {\n const list = (0, list_1.listFactory)(client, modelIntrospection, conversationModel, getInternals, false, (0, getCustomUserAgentDetails_1.getCustomUserAgentDetails)(getCustomUserAgentDetails_1.AiAction.ListConversations));\n const { data, nextToken, errors } = await list(input);\n return {\n data: data.map((datum) => {\n return (0, convertItemToConversation_1.convertItemToConversation)(client, modelIntrospection, datum.id, conversationRouteName, conversationMessageModel, getInternals);\n }),\n nextToken,\n errors,\n };\n};\nexports.createListConversationsFunction = createListConversationsFunction;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,+BAA+B,GAAG,KAAK,CAAC,CAAC;AACjD,MAAM,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAC7C,MAAM,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC3E,MAAM,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC3E,MAAM,+BAA+B,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,YAAY,KAAK,OAAO,KAAK,KAAK;AAC3K,IAAI,MAAM,IAAI,GAAG,IAAI,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,2BAA2B,CAAC,yBAAyB,EAAE,2BAA2B,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC;AACjO,IAAI,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,CAAC;AAC1D,IAAI,OAAO;AACX,QAAQ,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,KAAK;AAClC,YAAY,OAAO,IAAI,2BAA2B,CAAC,yBAAyB,EAAE,MAAM,EAAE,kBAAkB,EAAE,KAAK,CAAC,EAAE,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,YAAY,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"createListConversationsFunction.js","sources":["../../../../../src/runtime/internals/ai/createListConversationsFunction.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createListConversationsFunction = void 0;\nconst list_1 = require(\"../operations/list\");\nconst convertItemToConversation_1 = require(\"./convertItemToConversation\");\nconst getCustomUserAgentDetails_1 = require(\"./getCustomUserAgentDetails\");\nconst createListConversationsFunction = (client, modelIntrospection, conversationRouteName, conversationModel, conversationMessageModel, getInternals) => async (input) => {\n const list = (0, list_1.listFactory)(client, modelIntrospection, conversationModel, getInternals, false, (0, getCustomUserAgentDetails_1.getCustomUserAgentDetails)(getCustomUserAgentDetails_1.AiAction.ListConversations));\n const { data, nextToken, errors } = await list(input);\n return {\n data: data.map((datum) => {\n return (0, convertItemToConversation_1.convertItemToConversation)(client, modelIntrospection, datum.id, datum.createdAt, datum.updatedAt, conversationRouteName, conversationMessageModel, getInternals, datum?.metadata, datum?.name);\n }),\n nextToken,\n errors,\n };\n};\nexports.createListConversationsFunction = createListConversationsFunction;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,+BAA+B,GAAG,KAAK,CAAC,CAAC;AACjD,MAAM,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAC7C,MAAM,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC3E,MAAM,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC3E,MAAM,+BAA+B,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,YAAY,KAAK,OAAO,KAAK,KAAK;AAC3K,IAAI,MAAM,IAAI,GAAG,IAAI,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,2BAA2B,CAAC,yBAAyB,EAAE,2BAA2B,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC;AACjO,IAAI,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,CAAC;AAC1D,IAAI,OAAO;AACX,QAAQ,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,KAAK;AAClC,YAAY,OAAO,IAAI,2BAA2B,CAAC,yBAAyB,EAAE,MAAM,EAAE,kBAAkB,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;AACnP,SAAS,CAAC;AACV,QAAQ,SAAS;AACjB,QAAQ,MAAM;AACd,KAAK,CAAC;AACN,CAAC,CAAC;AACF,OAAO,CAAC,+BAA+B,GAAG,+BAA+B;;"}
|
|
@@ -8,12 +8,14 @@ const custom_1 = require("../operations/custom");
|
|
|
8
8
|
const convertItemToConversationMessage_1 = require("./convertItemToConversationMessage");
|
|
9
9
|
const conversationMessageSerializers_1 = require("./conversationMessageSerializers");
|
|
10
10
|
const getCustomUserAgentDetails_1 = require("./getCustomUserAgentDetails");
|
|
11
|
-
const createSendMessageFunction = (client, modelIntrospection, conversationId, conversationRouteName, getInternals) => async (
|
|
11
|
+
const createSendMessageFunction = (client, modelIntrospection, conversationId, conversationRouteName, getInternals) => async (input) => {
|
|
12
12
|
const { conversations } = modelIntrospection;
|
|
13
13
|
// Safe guard for standalone function. When called as part of client generation, this should never be falsy.
|
|
14
14
|
if (!conversations) {
|
|
15
15
|
return {};
|
|
16
16
|
}
|
|
17
|
+
const processedInput = typeof input === 'string' ? { content: [{ text: input }] } : input;
|
|
18
|
+
const { content, aiContext, toolConfiguration } = processedInput;
|
|
17
19
|
const sendSchema = conversations[conversationRouteName].message.send;
|
|
18
20
|
const sendOperation = (0, custom_1.customOpFactory)(client, modelIntrospection, 'mutation', sendSchema, false, getInternals, (0, getCustomUserAgentDetails_1.getCustomUserAgentDetails)(getCustomUserAgentDetails_1.AiAction.SendMessage));
|
|
19
21
|
const { data, errors } = await sendOperation({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSendMessageFunction.js","sources":["../../../../../src/runtime/internals/ai/createSendMessageFunction.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createSendMessageFunction = void 0;\nconst custom_1 = require(\"../operations/custom\");\nconst convertItemToConversationMessage_1 = require(\"./convertItemToConversationMessage\");\nconst conversationMessageSerializers_1 = require(\"./conversationMessageSerializers\");\nconst getCustomUserAgentDetails_1 = require(\"./getCustomUserAgentDetails\");\nconst createSendMessageFunction = (client, modelIntrospection, conversationId, conversationRouteName, getInternals) => async (
|
|
1
|
+
{"version":3,"file":"createSendMessageFunction.js","sources":["../../../../../src/runtime/internals/ai/createSendMessageFunction.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createSendMessageFunction = void 0;\nconst custom_1 = require(\"../operations/custom\");\nconst convertItemToConversationMessage_1 = require(\"./convertItemToConversationMessage\");\nconst conversationMessageSerializers_1 = require(\"./conversationMessageSerializers\");\nconst getCustomUserAgentDetails_1 = require(\"./getCustomUserAgentDetails\");\nconst createSendMessageFunction = (client, modelIntrospection, conversationId, conversationRouteName, getInternals) => async (input) => {\n const { conversations } = modelIntrospection;\n // Safe guard for standalone function. When called as part of client generation, this should never be falsy.\n if (!conversations) {\n return {};\n }\n const processedInput = typeof input === 'string' ? { content: [{ text: input }] } : input;\n const { content, aiContext, toolConfiguration } = processedInput;\n const sendSchema = conversations[conversationRouteName].message.send;\n const sendOperation = (0, custom_1.customOpFactory)(client, modelIntrospection, 'mutation', sendSchema, false, getInternals, (0, getCustomUserAgentDetails_1.getCustomUserAgentDetails)(getCustomUserAgentDetails_1.AiAction.SendMessage));\n const { data, errors } = await sendOperation({\n conversationId,\n content: (0, conversationMessageSerializers_1.serializeContent)(content),\n ...(aiContext && { aiContext: (0, conversationMessageSerializers_1.serializeAiContext)(aiContext) }),\n ...(toolConfiguration && {\n toolConfiguration: (0, conversationMessageSerializers_1.serializeToolConfiguration)(toolConfiguration),\n }),\n });\n return {\n data: data ? (0, convertItemToConversationMessage_1.convertItemToConversationMessage)(data) : data,\n errors,\n };\n};\nexports.createSendMessageFunction = createSendMessageFunction;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,yBAAyB,GAAG,KAAK,CAAC,CAAC;AAC3C,MAAM,QAAQ,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AACjD,MAAM,kCAAkC,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAAC;AACzF,MAAM,gCAAgC,GAAG,OAAO,CAAC,kCAAkC,CAAC,CAAC;AACrF,MAAM,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC3E,MAAM,yBAAyB,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,cAAc,EAAE,qBAAqB,EAAE,YAAY,KAAK,OAAO,KAAK,KAAK;AACxI,IAAI,MAAM,EAAE,aAAa,EAAE,GAAG,kBAAkB,CAAC;AACjD;AACA,IAAI,IAAI,CAAC,aAAa,EAAE;AACxB,QAAQ,OAAO,EAAE,CAAC;AAClB,KAAK;AACL,IAAI,MAAM,cAAc,GAAG,OAAO,KAAK,KAAK,QAAQ,GAAG,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,KAAK,CAAC;AAC9F,IAAI,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,GAAG,cAAc,CAAC;AACrE,IAAI,MAAM,UAAU,GAAG,aAAa,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;AACzE,IAAI,MAAM,aAAa,GAAG,IAAI,QAAQ,CAAC,eAAe,EAAE,MAAM,EAAE,kBAAkB,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,2BAA2B,CAAC,yBAAyB,EAAE,2BAA2B,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;AAC/O,IAAI,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,aAAa,CAAC;AACjD,QAAQ,cAAc;AACtB,QAAQ,OAAO,EAAE,IAAI,gCAAgC,CAAC,gBAAgB,EAAE,OAAO,CAAC;AAChF,QAAQ,IAAI,SAAS,IAAI,EAAE,SAAS,EAAE,IAAI,gCAAgC,CAAC,kBAAkB,EAAE,SAAS,CAAC,EAAE;AAC3G,QAAQ,IAAI,iBAAiB,IAAI;AACjC,YAAY,iBAAiB,EAAE,IAAI,gCAAgC,CAAC,0BAA0B,EAAE,iBAAiB,CAAC;AAClH,SAAS;AACT,KAAK,CAAC,CAAC;AACP,IAAI,OAAO;AACX,QAAQ,IAAI,EAAE,IAAI,GAAG,IAAI,kCAAkC,CAAC,gCAAgC,EAAE,IAAI,CAAC,GAAG,IAAI;AAC1G,QAAQ,MAAM;AACd,KAAK,CAAC;AACN,CAAC,CAAC;AACF,OAAO,CAAC,yBAAyB,GAAG,yBAAyB;;"}
|
|
@@ -50,11 +50,12 @@ export interface ConversationRoute {
|
|
|
50
50
|
*/
|
|
51
51
|
list: (input?: ConversationRouteListInput) => ListReturnValue<Conversation>;
|
|
52
52
|
}
|
|
53
|
-
interface
|
|
53
|
+
interface ConversationSendMessageInputObject {
|
|
54
54
|
content: ConversationSendMessageInputContent[];
|
|
55
55
|
aiContext?: string | Record<string, any>;
|
|
56
56
|
toolConfiguration?: ToolConfiguration;
|
|
57
57
|
}
|
|
58
|
+
export type ConversationSendMessageInput = ConversationSendMessageInputObject | string;
|
|
58
59
|
interface ConversationListMessagesInput {
|
|
59
60
|
limit?: number;
|
|
60
61
|
nextToken?: string | null;
|
|
@@ -62,12 +63,16 @@ interface ConversationListMessagesInput {
|
|
|
62
63
|
type ConversationOnMessageHandler = (message: ConversationMessage) => void;
|
|
63
64
|
export interface Conversation {
|
|
64
65
|
id: string;
|
|
66
|
+
createdAt: string;
|
|
67
|
+
updatedAt: string;
|
|
68
|
+
metadata?: Record<string, any>;
|
|
69
|
+
name?: string;
|
|
65
70
|
/**
|
|
66
71
|
* @experimental
|
|
67
72
|
*
|
|
68
73
|
* Sends a message to the current conversation.
|
|
69
74
|
*/
|
|
70
|
-
sendMessage: (input: ConversationSendMessageInput) => SingularReturnValue<ConversationMessage>;
|
|
75
|
+
sendMessage: (input: ConversationSendMessageInput | string) => SingularReturnValue<ConversationMessage>;
|
|
71
76
|
/**
|
|
72
77
|
* @experimental
|
|
73
78
|
*
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Conversation } from '../../../ai/ConversationType';
|
|
2
2
|
import type { BaseClient, ClientInternalsGetter, ModelIntrospectionSchema, SchemaModel } from '../../bridge-types';
|
|
3
|
-
export declare const convertItemToConversation: (client: BaseClient, modelIntrospection: ModelIntrospectionSchema, conversationId: string, conversationRouteName: string, conversationMessageModel: SchemaModel, getInternals: ClientInternalsGetter) => Conversation;
|
|
3
|
+
export declare const convertItemToConversation: (client: BaseClient, modelIntrospection: ModelIntrospectionSchema, conversationId: string, conversationCreatedAt: string, conversationUpdatedAt: string, conversationRouteName: string, conversationMessageModel: SchemaModel, getInternals: ClientInternalsGetter, conversationMetadata?: Record<string, any>, conversationName?: string) => Conversation;
|
|
@@ -4,12 +4,16 @@ import { createSendMessageFunction } from './createSendMessageFunction.mjs';
|
|
|
4
4
|
|
|
5
5
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
6
6
|
// SPDX-License-Identifier: Apache-2.0
|
|
7
|
-
const convertItemToConversation = (client, modelIntrospection, conversationId, conversationRouteName, conversationMessageModel, getInternals) => {
|
|
7
|
+
const convertItemToConversation = (client, modelIntrospection, conversationId, conversationCreatedAt, conversationUpdatedAt, conversationRouteName, conversationMessageModel, getInternals, conversationMetadata, conversationName) => {
|
|
8
8
|
if (!conversationId) {
|
|
9
9
|
throw new Error(`An error occurred converting a ${conversationRouteName} conversation: Missing ID`);
|
|
10
10
|
}
|
|
11
11
|
return {
|
|
12
12
|
id: conversationId,
|
|
13
|
+
createdAt: conversationCreatedAt,
|
|
14
|
+
updatedAt: conversationUpdatedAt,
|
|
15
|
+
metadata: conversationMetadata,
|
|
16
|
+
name: conversationName,
|
|
13
17
|
onMessage: createOnMessageFunction(client, modelIntrospection, conversationId, conversationRouteName, getInternals),
|
|
14
18
|
sendMessage: createSendMessageFunction(client, modelIntrospection, conversationId, conversationRouteName, getInternals),
|
|
15
19
|
listMessages: createListMessagesFunction(client, modelIntrospection, conversationId, conversationMessageModel, getInternals),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertItemToConversation.mjs","sources":["../../../../../src/runtime/internals/ai/convertItemToConversation.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { createListMessagesFunction } from './createListMessagesFunction';\nimport { createOnMessageFunction } from './createOnMessageFunction';\nimport { createSendMessageFunction } from './createSendMessageFunction';\nexport const convertItemToConversation = (client, modelIntrospection, conversationId, conversationRouteName, conversationMessageModel, getInternals) => {\n if (!conversationId) {\n throw new Error(`An error occurred converting a ${conversationRouteName} conversation: Missing ID`);\n }\n return {\n id: conversationId,\n onMessage: createOnMessageFunction(client, modelIntrospection, conversationId, conversationRouteName, getInternals),\n sendMessage: createSendMessageFunction(client, modelIntrospection, conversationId, conversationRouteName, getInternals),\n listMessages: createListMessagesFunction(client, modelIntrospection, conversationId, conversationMessageModel, getInternals),\n };\n};\n"],"names":[],"mappings":";;;;AAAA;AACA;AAIY,MAAC,yBAAyB,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,cAAc,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,YAAY,KAAK;
|
|
1
|
+
{"version":3,"file":"convertItemToConversation.mjs","sources":["../../../../../src/runtime/internals/ai/convertItemToConversation.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { createListMessagesFunction } from './createListMessagesFunction';\nimport { createOnMessageFunction } from './createOnMessageFunction';\nimport { createSendMessageFunction } from './createSendMessageFunction';\nexport const convertItemToConversation = (client, modelIntrospection, conversationId, conversationCreatedAt, conversationUpdatedAt, conversationRouteName, conversationMessageModel, getInternals, conversationMetadata, conversationName) => {\n if (!conversationId) {\n throw new Error(`An error occurred converting a ${conversationRouteName} conversation: Missing ID`);\n }\n return {\n id: conversationId,\n createdAt: conversationCreatedAt,\n updatedAt: conversationUpdatedAt,\n metadata: conversationMetadata,\n name: conversationName,\n onMessage: createOnMessageFunction(client, modelIntrospection, conversationId, conversationRouteName, getInternals),\n sendMessage: createSendMessageFunction(client, modelIntrospection, conversationId, conversationRouteName, getInternals),\n listMessages: createListMessagesFunction(client, modelIntrospection, conversationId, conversationMessageModel, getInternals),\n };\n};\n"],"names":[],"mappings":";;;;AAAA;AACA;AAIY,MAAC,yBAAyB,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,cAAc,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,YAAY,EAAE,oBAAoB,EAAE,gBAAgB,KAAK;AAC9O,IAAI,IAAI,CAAC,cAAc,EAAE;AACzB,QAAQ,MAAM,IAAI,KAAK,CAAC,CAAC,+BAA+B,EAAE,qBAAqB,CAAC,yBAAyB,CAAC,CAAC,CAAC;AAC5G,KAAK;AACL,IAAI,OAAO;AACX,QAAQ,EAAE,EAAE,cAAc;AAC1B,QAAQ,SAAS,EAAE,qBAAqB;AACxC,QAAQ,SAAS,EAAE,qBAAqB;AACxC,QAAQ,QAAQ,EAAE,oBAAoB;AACtC,QAAQ,IAAI,EAAE,gBAAgB;AAC9B,QAAQ,SAAS,EAAE,uBAAuB,CAAC,MAAM,EAAE,kBAAkB,EAAE,cAAc,EAAE,qBAAqB,EAAE,YAAY,CAAC;AAC3H,QAAQ,WAAW,EAAE,yBAAyB,CAAC,MAAM,EAAE,kBAAkB,EAAE,cAAc,EAAE,qBAAqB,EAAE,YAAY,CAAC;AAC/H,QAAQ,YAAY,EAAE,0BAA0B,CAAC,MAAM,EAAE,kBAAkB,EAAE,cAAc,EAAE,wBAAwB,EAAE,YAAY,CAAC;AACpI,KAAK,CAAC;AACN;;;;"}
|
|
@@ -8,7 +8,7 @@ const createCreateConversationFunction = (client, modelIntrospection, conversati
|
|
|
8
8
|
const get = getFactory(client, modelIntrospection, conversationModel, 'CREATE', getInternals, false, getCustomUserAgentDetails(AiAction.CreateConversation));
|
|
9
9
|
const { data, errors } = await get();
|
|
10
10
|
return {
|
|
11
|
-
data: convertItemToConversation(client, modelIntrospection, data?.id, conversationRouteName, conversationMessageModel, getInternals),
|
|
11
|
+
data: convertItemToConversation(client, modelIntrospection, data?.id, data?.createdAt, data?.updatedAt, conversationRouteName, conversationMessageModel, getInternals, data?.metadata, data?.name),
|
|
12
12
|
errors,
|
|
13
13
|
};
|
|
14
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCreateConversationFunction.mjs","sources":["../../../../../src/runtime/internals/ai/createCreateConversationFunction.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { getFactory } from '../operations/get';\nimport { convertItemToConversation } from './convertItemToConversation';\nimport { AiAction, getCustomUserAgentDetails, } from './getCustomUserAgentDetails';\nexport const createCreateConversationFunction = (client, modelIntrospection, conversationRouteName, conversationModel, conversationMessageModel, getInternals) => async () => {\n const get = getFactory(client, modelIntrospection, conversationModel, 'CREATE', getInternals, false, getCustomUserAgentDetails(AiAction.CreateConversation));\n const { data, errors } = await get();\n return {\n data: convertItemToConversation(client, modelIntrospection, data?.id, conversationRouteName, conversationMessageModel, getInternals),\n errors,\n };\n};\n"],"names":[],"mappings":";;;;AAAA;AACA;AAIY,MAAC,gCAAgC,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,YAAY,KAAK,YAAY;AAC9K,IAAI,MAAM,GAAG,GAAG,UAAU,CAAC,MAAM,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,yBAAyB,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC;AACjK,IAAI,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,EAAE,CAAC;AACzC,IAAI,OAAO;AACX,QAAQ,IAAI,EAAE,yBAAyB,CAAC,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,EAAE,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"createCreateConversationFunction.mjs","sources":["../../../../../src/runtime/internals/ai/createCreateConversationFunction.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { getFactory } from '../operations/get';\nimport { convertItemToConversation } from './convertItemToConversation';\nimport { AiAction, getCustomUserAgentDetails, } from './getCustomUserAgentDetails';\nexport const createCreateConversationFunction = (client, modelIntrospection, conversationRouteName, conversationModel, conversationMessageModel, getInternals) => async () => {\n const get = getFactory(client, modelIntrospection, conversationModel, 'CREATE', getInternals, false, getCustomUserAgentDetails(AiAction.CreateConversation));\n const { data, errors } = await get();\n return {\n data: convertItemToConversation(client, modelIntrospection, data?.id, data?.createdAt, data?.updatedAt, conversationRouteName, conversationMessageModel, getInternals, data?.metadata, data?.name),\n errors,\n };\n};\n"],"names":[],"mappings":";;;;AAAA;AACA;AAIY,MAAC,gCAAgC,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,YAAY,KAAK,YAAY;AAC9K,IAAI,MAAM,GAAG,GAAG,UAAU,CAAC,MAAM,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,yBAAyB,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC;AACjK,IAAI,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,EAAE,CAAC;AACzC,IAAI,OAAO;AACX,QAAQ,IAAI,EAAE,yBAAyB,CAAC,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC;AAC1M,QAAQ,MAAM;AACd,KAAK,CAAC;AACN;;;;"}
|
|
@@ -9,7 +9,7 @@ const createDeleteConversationFunction = (client, modelIntrospection, conversati
|
|
|
9
9
|
const { data, errors } = await deleteOperation({ id });
|
|
10
10
|
return {
|
|
11
11
|
data: data
|
|
12
|
-
? convertItemToConversation(client, modelIntrospection, data?.id, conversationRouteName, conversationMessageModel, getInternals)
|
|
12
|
+
? convertItemToConversation(client, modelIntrospection, data?.id, data?.createdAt, data?.updatedAt, conversationRouteName, conversationMessageModel, getInternals, data?.metadata, data?.name)
|
|
13
13
|
: data,
|
|
14
14
|
errors,
|
|
15
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createDeleteConversationFunction.mjs","sources":["../../../../../src/runtime/internals/ai/createDeleteConversationFunction.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { getFactory } from '../operations/get';\nimport { convertItemToConversation } from './convertItemToConversation';\nimport { AiAction, getCustomUserAgentDetails, } from './getCustomUserAgentDetails';\nexport const createDeleteConversationFunction = (client, modelIntrospection, conversationRouteName, conversationModel, conversationMessageModel, getInternals) => async ({ id }) => {\n const deleteOperation = getFactory(client, modelIntrospection, conversationModel, 'DELETE', getInternals, false, getCustomUserAgentDetails(AiAction.DeleteConversation));\n const { data, errors } = await deleteOperation({ id });\n return {\n data: data\n ? convertItemToConversation(client, modelIntrospection, data?.id, conversationRouteName, conversationMessageModel, getInternals)\n : data,\n errors,\n };\n};\n"],"names":[],"mappings":";;;;AAAA;AACA;AAIY,MAAC,gCAAgC,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,YAAY,KAAK,OAAO,EAAE,EAAE,EAAE,KAAK;AACpL,IAAI,MAAM,eAAe,GAAG,UAAU,CAAC,MAAM,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,yBAAyB,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC;AAC7K,IAAI,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,eAAe,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC3D,IAAI,OAAO;AACX,QAAQ,IAAI,EAAE,IAAI;AAClB,cAAc,yBAAyB,CAAC,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,EAAE,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"createDeleteConversationFunction.mjs","sources":["../../../../../src/runtime/internals/ai/createDeleteConversationFunction.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { getFactory } from '../operations/get';\nimport { convertItemToConversation } from './convertItemToConversation';\nimport { AiAction, getCustomUserAgentDetails, } from './getCustomUserAgentDetails';\nexport const createDeleteConversationFunction = (client, modelIntrospection, conversationRouteName, conversationModel, conversationMessageModel, getInternals) => async ({ id }) => {\n const deleteOperation = getFactory(client, modelIntrospection, conversationModel, 'DELETE', getInternals, false, getCustomUserAgentDetails(AiAction.DeleteConversation));\n const { data, errors } = await deleteOperation({ id });\n return {\n data: data\n ? convertItemToConversation(client, modelIntrospection, data?.id, data?.createdAt, data?.updatedAt, conversationRouteName, conversationMessageModel, getInternals, data?.metadata, data?.name)\n : data,\n errors,\n };\n};\n"],"names":[],"mappings":";;;;AAAA;AACA;AAIY,MAAC,gCAAgC,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,YAAY,KAAK,OAAO,EAAE,EAAE,EAAE,KAAK;AACpL,IAAI,MAAM,eAAe,GAAG,UAAU,CAAC,MAAM,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,yBAAyB,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC;AAC7K,IAAI,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,eAAe,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC3D,IAAI,OAAO;AACX,QAAQ,IAAI,EAAE,IAAI;AAClB,cAAc,yBAAyB,CAAC,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC;AAC1M,cAAc,IAAI;AAClB,QAAQ,MAAM;AACd,KAAK,CAAC;AACN;;;;"}
|
|
@@ -9,7 +9,7 @@ const createGetConversationFunction = (client, modelIntrospection, conversationR
|
|
|
9
9
|
const { data, errors } = await get({ id });
|
|
10
10
|
return {
|
|
11
11
|
data: data
|
|
12
|
-
? convertItemToConversation(client, modelIntrospection, data.id, conversationRouteName, conversationMessageModel, getInternals)
|
|
12
|
+
? convertItemToConversation(client, modelIntrospection, data.id, data.createdAt, data.updatedAt, conversationRouteName, conversationMessageModel, getInternals, data?.metadata, data?.name)
|
|
13
13
|
: data,
|
|
14
14
|
errors,
|
|
15
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createGetConversationFunction.mjs","sources":["../../../../../src/runtime/internals/ai/createGetConversationFunction.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { getFactory } from '../operations/get';\nimport { convertItemToConversation } from './convertItemToConversation';\nimport { AiAction, getCustomUserAgentDetails, } from './getCustomUserAgentDetails';\nexport const createGetConversationFunction = (client, modelIntrospection, conversationRouteName, conversationModel, conversationMessageModel, getInternals) => async ({ id }) => {\n const get = getFactory(client, modelIntrospection, conversationModel, 'GET', getInternals, false, getCustomUserAgentDetails(AiAction.GetConversation));\n const { data, errors } = await get({ id });\n return {\n data: data\n ? convertItemToConversation(client, modelIntrospection, data.id, conversationRouteName, conversationMessageModel, getInternals)\n : data,\n errors,\n };\n};\n"],"names":[],"mappings":";;;;AAAA;AACA;AAIY,MAAC,6BAA6B,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,YAAY,KAAK,OAAO,EAAE,EAAE,EAAE,KAAK;AACjL,IAAI,MAAM,GAAG,GAAG,UAAU,CAAC,MAAM,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,yBAAyB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC;AAC3J,IAAI,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC/C,IAAI,OAAO;AACX,QAAQ,IAAI,EAAE,IAAI;AAClB,cAAc,yBAAyB,CAAC,MAAM,EAAE,kBAAkB,EAAE,IAAI,CAAC,EAAE,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"createGetConversationFunction.mjs","sources":["../../../../../src/runtime/internals/ai/createGetConversationFunction.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { getFactory } from '../operations/get';\nimport { convertItemToConversation } from './convertItemToConversation';\nimport { AiAction, getCustomUserAgentDetails, } from './getCustomUserAgentDetails';\nexport const createGetConversationFunction = (client, modelIntrospection, conversationRouteName, conversationModel, conversationMessageModel, getInternals) => async ({ id }) => {\n const get = getFactory(client, modelIntrospection, conversationModel, 'GET', getInternals, false, getCustomUserAgentDetails(AiAction.GetConversation));\n const { data, errors } = await get({ id });\n return {\n data: data\n ? convertItemToConversation(client, modelIntrospection, data.id, data.createdAt, data.updatedAt, conversationRouteName, conversationMessageModel, getInternals, data?.metadata, data?.name)\n : data,\n errors,\n };\n};\n"],"names":[],"mappings":";;;;AAAA;AACA;AAIY,MAAC,6BAA6B,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,YAAY,KAAK,OAAO,EAAE,EAAE,EAAE,KAAK;AACjL,IAAI,MAAM,GAAG,GAAG,UAAU,CAAC,MAAM,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,yBAAyB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC;AAC3J,IAAI,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC/C,IAAI,OAAO;AACX,QAAQ,IAAI,EAAE,IAAI;AAClB,cAAc,yBAAyB,CAAC,MAAM,EAAE,kBAAkB,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC;AACvM,cAAc,IAAI;AAClB,QAAQ,MAAM;AACd,KAAK,CAAC;AACN;;;;"}
|
|
@@ -9,7 +9,7 @@ const createListConversationsFunction = (client, modelIntrospection, conversatio
|
|
|
9
9
|
const { data, nextToken, errors } = await list(input);
|
|
10
10
|
return {
|
|
11
11
|
data: data.map((datum) => {
|
|
12
|
-
return convertItemToConversation(client, modelIntrospection, datum.id, conversationRouteName, conversationMessageModel, getInternals);
|
|
12
|
+
return convertItemToConversation(client, modelIntrospection, datum.id, datum.createdAt, datum.updatedAt, conversationRouteName, conversationMessageModel, getInternals, datum?.metadata, datum?.name);
|
|
13
13
|
}),
|
|
14
14
|
nextToken,
|
|
15
15
|
errors,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createListConversationsFunction.mjs","sources":["../../../../../src/runtime/internals/ai/createListConversationsFunction.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { listFactory } from '../operations/list';\nimport { convertItemToConversation } from './convertItemToConversation';\nimport { AiAction, getCustomUserAgentDetails, } from './getCustomUserAgentDetails';\nexport const createListConversationsFunction = (client, modelIntrospection, conversationRouteName, conversationModel, conversationMessageModel, getInternals) => async (input) => {\n const list = listFactory(client, modelIntrospection, conversationModel, getInternals, false, getCustomUserAgentDetails(AiAction.ListConversations));\n const { data, nextToken, errors } = await list(input);\n return {\n data: data.map((datum) => {\n return convertItemToConversation(client, modelIntrospection, datum.id, conversationRouteName, conversationMessageModel, getInternals);\n }),\n nextToken,\n errors,\n };\n};\n"],"names":[],"mappings":";;;;AAAA;AACA;AAIY,MAAC,+BAA+B,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,YAAY,KAAK,OAAO,KAAK,KAAK;AAClL,IAAI,MAAM,IAAI,GAAG,WAAW,CAAC,MAAM,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,YAAY,EAAE,KAAK,EAAE,yBAAyB,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC;AACxJ,IAAI,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,CAAC;AAC1D,IAAI,OAAO;AACX,QAAQ,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,KAAK;AAClC,YAAY,OAAO,yBAAyB,CAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,CAAC,EAAE,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,YAAY,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"createListConversationsFunction.mjs","sources":["../../../../../src/runtime/internals/ai/createListConversationsFunction.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { listFactory } from '../operations/list';\nimport { convertItemToConversation } from './convertItemToConversation';\nimport { AiAction, getCustomUserAgentDetails, } from './getCustomUserAgentDetails';\nexport const createListConversationsFunction = (client, modelIntrospection, conversationRouteName, conversationModel, conversationMessageModel, getInternals) => async (input) => {\n const list = listFactory(client, modelIntrospection, conversationModel, getInternals, false, getCustomUserAgentDetails(AiAction.ListConversations));\n const { data, nextToken, errors } = await list(input);\n return {\n data: data.map((datum) => {\n return convertItemToConversation(client, modelIntrospection, datum.id, datum.createdAt, datum.updatedAt, conversationRouteName, conversationMessageModel, getInternals, datum?.metadata, datum?.name);\n }),\n nextToken,\n errors,\n };\n};\n"],"names":[],"mappings":";;;;AAAA;AACA;AAIY,MAAC,+BAA+B,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,YAAY,KAAK,OAAO,KAAK,KAAK;AAClL,IAAI,MAAM,IAAI,GAAG,WAAW,CAAC,MAAM,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,YAAY,EAAE,KAAK,EAAE,yBAAyB,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC;AACxJ,IAAI,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,CAAC;AAC1D,IAAI,OAAO;AACX,QAAQ,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,KAAK;AAClC,YAAY,OAAO,yBAAyB,CAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;AAClN,SAAS,CAAC;AACV,QAAQ,SAAS;AACjB,QAAQ,MAAM;AACd,KAAK,CAAC;AACN;;;;"}
|
|
@@ -5,12 +5,14 @@ import { getCustomUserAgentDetails, AiAction } from './getCustomUserAgentDetails
|
|
|
5
5
|
|
|
6
6
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
7
7
|
// SPDX-License-Identifier: Apache-2.0
|
|
8
|
-
const createSendMessageFunction = (client, modelIntrospection, conversationId, conversationRouteName, getInternals) => async (
|
|
8
|
+
const createSendMessageFunction = (client, modelIntrospection, conversationId, conversationRouteName, getInternals) => async (input) => {
|
|
9
9
|
const { conversations } = modelIntrospection;
|
|
10
10
|
// Safe guard for standalone function. When called as part of client generation, this should never be falsy.
|
|
11
11
|
if (!conversations) {
|
|
12
12
|
return {};
|
|
13
13
|
}
|
|
14
|
+
const processedInput = typeof input === 'string' ? { content: [{ text: input }] } : input;
|
|
15
|
+
const { content, aiContext, toolConfiguration } = processedInput;
|
|
14
16
|
const sendSchema = conversations[conversationRouteName].message.send;
|
|
15
17
|
const sendOperation = customOpFactory(client, modelIntrospection, 'mutation', sendSchema, false, getInternals, getCustomUserAgentDetails(AiAction.SendMessage));
|
|
16
18
|
const { data, errors } = await sendOperation({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSendMessageFunction.mjs","sources":["../../../../../src/runtime/internals/ai/createSendMessageFunction.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { customOpFactory } from '../operations/custom';\nimport { convertItemToConversationMessage } from './convertItemToConversationMessage';\nimport { serializeAiContext, serializeContent, serializeToolConfiguration, } from './conversationMessageSerializers';\nimport { AiAction, getCustomUserAgentDetails, } from './getCustomUserAgentDetails';\nexport const createSendMessageFunction = (client, modelIntrospection, conversationId, conversationRouteName, getInternals) => async (
|
|
1
|
+
{"version":3,"file":"createSendMessageFunction.mjs","sources":["../../../../../src/runtime/internals/ai/createSendMessageFunction.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { customOpFactory } from '../operations/custom';\nimport { convertItemToConversationMessage } from './convertItemToConversationMessage';\nimport { serializeAiContext, serializeContent, serializeToolConfiguration, } from './conversationMessageSerializers';\nimport { AiAction, getCustomUserAgentDetails, } from './getCustomUserAgentDetails';\nexport const createSendMessageFunction = (client, modelIntrospection, conversationId, conversationRouteName, getInternals) => async (input) => {\n const { conversations } = modelIntrospection;\n // Safe guard for standalone function. When called as part of client generation, this should never be falsy.\n if (!conversations) {\n return {};\n }\n const processedInput = typeof input === 'string' ? { content: [{ text: input }] } : input;\n const { content, aiContext, toolConfiguration } = processedInput;\n const sendSchema = conversations[conversationRouteName].message.send;\n const sendOperation = customOpFactory(client, modelIntrospection, 'mutation', sendSchema, false, getInternals, getCustomUserAgentDetails(AiAction.SendMessage));\n const { data, errors } = await sendOperation({\n conversationId,\n content: serializeContent(content),\n ...(aiContext && { aiContext: serializeAiContext(aiContext) }),\n ...(toolConfiguration && {\n toolConfiguration: serializeToolConfiguration(toolConfiguration),\n }),\n });\n return {\n data: data ? convertItemToConversationMessage(data) : data,\n errors,\n };\n};\n"],"names":[],"mappings":";;;;;AAAA;AACA;AAKY,MAAC,yBAAyB,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,cAAc,EAAE,qBAAqB,EAAE,YAAY,KAAK,OAAO,KAAK,KAAK;AAC/I,IAAI,MAAM,EAAE,aAAa,EAAE,GAAG,kBAAkB,CAAC;AACjD;AACA,IAAI,IAAI,CAAC,aAAa,EAAE;AACxB,QAAQ,OAAO,EAAE,CAAC;AAClB,KAAK;AACL,IAAI,MAAM,cAAc,GAAG,OAAO,KAAK,KAAK,QAAQ,GAAG,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,KAAK,CAAC;AAC9F,IAAI,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,GAAG,cAAc,CAAC;AACrE,IAAI,MAAM,UAAU,GAAG,aAAa,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;AACzE,IAAI,MAAM,aAAa,GAAG,eAAe,CAAC,MAAM,EAAE,kBAAkB,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,yBAAyB,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;AACpK,IAAI,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,aAAa,CAAC;AACjD,QAAQ,cAAc;AACtB,QAAQ,OAAO,EAAE,gBAAgB,CAAC,OAAO,CAAC;AAC1C,QAAQ,IAAI,SAAS,IAAI,EAAE,SAAS,EAAE,kBAAkB,CAAC,SAAS,CAAC,EAAE;AACrE,QAAQ,IAAI,iBAAiB,IAAI;AACjC,YAAY,iBAAiB,EAAE,0BAA0B,CAAC,iBAAiB,CAAC;AAC5E,SAAS;AACT,KAAK,CAAC,CAAC;AACP,IAAI,OAAO;AACX,QAAQ,IAAI,EAAE,IAAI,GAAG,gCAAgC,CAAC,IAAI,CAAC,GAAG,IAAI;AAClE,QAAQ,MAAM;AACd,KAAK,CAAC;AACN;;;;"}
|