@aws-amplify/data-schema 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/dist/cjs/ClientSchema/ai/ClientConversation.js +6 -0
  2. package/dist/cjs/ClientSchema/ai/ClientConversation.js.map +1 -0
  3. package/dist/cjs/CustomOperation.js +22 -2
  4. package/dist/cjs/CustomOperation.js.map +1 -1
  5. package/dist/cjs/SchemaProcessor.js +41 -5
  6. package/dist/cjs/SchemaProcessor.js.map +1 -1
  7. package/dist/cjs/a.js +9 -1
  8. package/dist/cjs/a.js.map +1 -1
  9. package/dist/cjs/ai/ConversationSchemaTypes.js +210 -0
  10. package/dist/cjs/ai/ConversationSchemaTypes.js.map +1 -0
  11. package/dist/cjs/ai/ConversationType.js +27 -0
  12. package/dist/cjs/ai/ConversationType.js.map +1 -0
  13. package/dist/cjs/ai/ModelType.js +37 -0
  14. package/dist/cjs/ai/ModelType.js.map +1 -0
  15. package/dist/cjs/ai/types/ConversationMessageContent.js +6 -0
  16. package/dist/cjs/ai/types/ConversationMessageContent.js.map +1 -0
  17. package/dist/cjs/ai/types/ToolConfiguration.js +6 -0
  18. package/dist/cjs/ai/types/ToolConfiguration.js.map +1 -0
  19. package/dist/cjs/ai/types/ToolResultContent.js +6 -0
  20. package/dist/cjs/ai/types/ToolResultContent.js.map +1 -0
  21. package/dist/cjs/ai/types/contentBlocks.js +6 -0
  22. package/dist/cjs/ai/types/contentBlocks.js.map +1 -0
  23. package/dist/cjs/runtime/addSchemaToClient.js +2 -0
  24. package/dist/cjs/runtime/addSchemaToClient.js.map +1 -1
  25. package/dist/cjs/runtime/internals/APIClient.js +3 -3
  26. package/dist/cjs/runtime/internals/APIClient.js.map +1 -1
  27. package/dist/cjs/runtime/internals/ai/conversationMessageDeserializers.js +54 -0
  28. package/dist/cjs/runtime/internals/ai/conversationMessageDeserializers.js.map +1 -0
  29. package/dist/cjs/runtime/internals/ai/conversationMessageSerializers.js +58 -0
  30. package/dist/cjs/runtime/internals/ai/conversationMessageSerializers.js.map +1 -0
  31. package/dist/cjs/runtime/internals/ai/convertItemToConversation.js +22 -0
  32. package/dist/cjs/runtime/internals/ai/convertItemToConversation.js.map +1 -0
  33. package/dist/cjs/runtime/internals/ai/convertItemToConversationMessage.js +16 -0
  34. package/dist/cjs/runtime/internals/ai/convertItemToConversationMessage.js.map +1 -0
  35. package/dist/cjs/runtime/internals/ai/createCreateConversationFunction.js +18 -0
  36. package/dist/cjs/runtime/internals/ai/createCreateConversationFunction.js.map +1 -0
  37. package/dist/cjs/runtime/internals/ai/createGetConversationFunction.js +20 -0
  38. package/dist/cjs/runtime/internals/ai/createGetConversationFunction.js.map +1 -0
  39. package/dist/cjs/runtime/internals/ai/createListConversationsFunction.js +21 -0
  40. package/dist/cjs/runtime/internals/ai/createListConversationsFunction.js.map +1 -0
  41. package/dist/cjs/runtime/internals/ai/createListMessagesFunction.js +22 -0
  42. package/dist/cjs/runtime/internals/ai/createListMessagesFunction.js.map +1 -0
  43. package/dist/cjs/runtime/internals/ai/createOnMessageFunction.js +22 -0
  44. package/dist/cjs/runtime/internals/ai/createOnMessageFunction.js.map +1 -0
  45. package/dist/cjs/runtime/internals/ai/createSendMessageFunction.js +32 -0
  46. package/dist/cjs/runtime/internals/ai/createSendMessageFunction.js.map +1 -0
  47. package/dist/cjs/runtime/internals/index.js +5 -1
  48. package/dist/cjs/runtime/internals/index.js.map +1 -1
  49. package/dist/cjs/runtime/internals/operations/custom.js +17 -10
  50. package/dist/cjs/runtime/internals/operations/custom.js.map +1 -1
  51. package/dist/cjs/runtime/internals/utils/clientProperties/generateConversationsProperty.js +48 -0
  52. package/dist/cjs/runtime/internals/utils/clientProperties/generateConversationsProperty.js.map +1 -0
  53. package/dist/cjs/runtime/internals/utils/clientProperties/generateGenerationsProperty.js +22 -0
  54. package/dist/cjs/runtime/internals/utils/clientProperties/generateGenerationsProperty.js.map +1 -0
  55. package/dist/esm/ClientSchema/Core/ClientSchemaProperty.d.ts +1 -1
  56. package/dist/esm/ClientSchema/ai/ClientConversation.d.ts +7 -0
  57. package/dist/esm/ClientSchema/ai/ClientConversation.mjs +2 -0
  58. package/dist/esm/ClientSchema/ai/ClientConversation.mjs.map +1 -0
  59. package/dist/esm/ClientSchema/index.d.ts +12 -2
  60. package/dist/esm/CustomOperation.d.ts +33 -2
  61. package/dist/esm/CustomOperation.mjs +21 -2
  62. package/dist/esm/CustomOperation.mjs.map +1 -1
  63. package/dist/esm/ModelSchema.d.ts +3 -1
  64. package/dist/esm/SchemaProcessor.d.ts +1 -1
  65. package/dist/esm/SchemaProcessor.mjs +41 -5
  66. package/dist/esm/SchemaProcessor.mjs.map +1 -1
  67. package/dist/esm/a.d.ts +7 -2
  68. package/dist/esm/a.mjs +9 -1
  69. package/dist/esm/a.mjs.map +1 -1
  70. package/dist/esm/ai/ConversationSchemaTypes.d.ts +3 -0
  71. package/dist/esm/ai/ConversationSchemaTypes.mjs +208 -0
  72. package/dist/esm/ai/ConversationSchemaTypes.mjs.map +1 -0
  73. package/dist/esm/ai/ConversationType.d.ts +102 -0
  74. package/dist/esm/ai/ConversationType.mjs +25 -0
  75. package/dist/esm/ai/ConversationType.mjs.map +1 -0
  76. package/dist/esm/ai/ModelType.d.ts +30 -0
  77. package/dist/esm/ai/ModelType.mjs +34 -0
  78. package/dist/esm/ai/ModelType.mjs.map +1 -0
  79. package/dist/esm/ai/types/ConversationMessageContent.d.ts +27 -0
  80. package/dist/esm/ai/types/ConversationMessageContent.mjs +2 -0
  81. package/dist/esm/ai/types/ConversationMessageContent.mjs.map +1 -0
  82. package/dist/esm/ai/types/ToolConfiguration.d.ts +18 -0
  83. package/dist/esm/ai/types/ToolConfiguration.mjs +2 -0
  84. package/dist/esm/ai/types/ToolConfiguration.mjs.map +1 -0
  85. package/dist/esm/ai/types/ToolResultContent.d.ts +18 -0
  86. package/dist/esm/ai/types/ToolResultContent.mjs +2 -0
  87. package/dist/esm/ai/types/ToolResultContent.mjs.map +1 -0
  88. package/dist/esm/ai/types/contentBlocks.d.ts +19 -0
  89. package/dist/esm/ai/types/contentBlocks.mjs +2 -0
  90. package/dist/esm/ai/types/contentBlocks.mjs.map +1 -0
  91. package/dist/esm/runtime/addSchemaToClient.mjs +4 -0
  92. package/dist/esm/runtime/addSchemaToClient.mjs.map +1 -1
  93. package/dist/esm/runtime/addSchemaToClientWithInstance.mjs +2 -1
  94. package/dist/esm/runtime/addSchemaToClientWithInstance.mjs.map +1 -1
  95. package/dist/esm/runtime/bridge-types.d.ts +29 -3
  96. package/dist/esm/runtime/client/index.d.ts +35 -19
  97. package/dist/esm/runtime/internals/APIClient.mjs +3 -3
  98. package/dist/esm/runtime/internals/APIClient.mjs.map +1 -1
  99. package/dist/esm/runtime/internals/ai/conversationMessageDeserializers.d.ts +2 -0
  100. package/dist/esm/runtime/internals/ai/conversationMessageDeserializers.mjs +52 -0
  101. package/dist/esm/runtime/internals/ai/conversationMessageDeserializers.mjs.map +1 -0
  102. package/dist/esm/runtime/internals/ai/conversationMessageSerializers.d.ts +37 -0
  103. package/dist/esm/runtime/internals/ai/conversationMessageSerializers.mjs +54 -0
  104. package/dist/esm/runtime/internals/ai/conversationMessageSerializers.mjs.map +1 -0
  105. package/dist/esm/runtime/internals/ai/convertItemToConversation.d.ts +3 -0
  106. package/dist/esm/runtime/internals/ai/convertItemToConversation.mjs +20 -0
  107. package/dist/esm/runtime/internals/ai/convertItemToConversation.mjs.map +1 -0
  108. package/dist/esm/runtime/internals/ai/convertItemToConversationMessage.d.ts +7 -0
  109. package/dist/esm/runtime/internals/ai/convertItemToConversationMessage.mjs +14 -0
  110. package/dist/esm/runtime/internals/ai/convertItemToConversationMessage.mjs.map +1 -0
  111. package/dist/esm/runtime/internals/ai/createCreateConversationFunction.d.ts +3 -0
  112. package/dist/esm/runtime/internals/ai/createCreateConversationFunction.mjs +16 -0
  113. package/dist/esm/runtime/internals/ai/createCreateConversationFunction.mjs.map +1 -0
  114. package/dist/esm/runtime/internals/ai/createGetConversationFunction.d.ts +3 -0
  115. package/dist/esm/runtime/internals/ai/createGetConversationFunction.mjs +18 -0
  116. package/dist/esm/runtime/internals/ai/createGetConversationFunction.mjs.map +1 -0
  117. package/dist/esm/runtime/internals/ai/createListConversationsFunction.d.ts +3 -0
  118. package/dist/esm/runtime/internals/ai/createListConversationsFunction.mjs +19 -0
  119. package/dist/esm/runtime/internals/ai/createListConversationsFunction.mjs.map +1 -0
  120. package/dist/esm/runtime/internals/ai/createListMessagesFunction.d.ts +3 -0
  121. package/dist/esm/runtime/internals/ai/createListMessagesFunction.mjs +20 -0
  122. package/dist/esm/runtime/internals/ai/createListMessagesFunction.mjs.map +1 -0
  123. package/dist/esm/runtime/internals/ai/createOnMessageFunction.d.ts +3 -0
  124. package/dist/esm/runtime/internals/ai/createOnMessageFunction.mjs +20 -0
  125. package/dist/esm/runtime/internals/ai/createOnMessageFunction.mjs.map +1 -0
  126. package/dist/esm/runtime/internals/ai/createSendMessageFunction.d.ts +3 -0
  127. package/dist/esm/runtime/internals/ai/createSendMessageFunction.mjs +30 -0
  128. package/dist/esm/runtime/internals/ai/createSendMessageFunction.mjs.map +1 -0
  129. package/dist/esm/runtime/internals/index.d.ts +2 -0
  130. package/dist/esm/runtime/internals/index.mjs +2 -0
  131. package/dist/esm/runtime/internals/index.mjs.map +1 -1
  132. package/dist/esm/runtime/internals/operations/custom.d.ts +1 -1
  133. package/dist/esm/runtime/internals/operations/custom.mjs +17 -10
  134. package/dist/esm/runtime/internals/operations/custom.mjs.map +1 -1
  135. package/dist/esm/runtime/internals/utils/clientProperties/generateConversationsProperty.d.ts +3 -0
  136. package/dist/esm/runtime/internals/utils/clientProperties/generateConversationsProperty.mjs +46 -0
  137. package/dist/esm/runtime/internals/utils/clientProperties/generateConversationsProperty.mjs.map +1 -0
  138. package/dist/esm/runtime/internals/utils/clientProperties/generateGenerationsProperty.d.ts +3 -0
  139. package/dist/esm/runtime/internals/utils/clientProperties/generateGenerationsProperty.mjs +20 -0
  140. package/dist/esm/runtime/internals/utils/clientProperties/generateGenerationsProperty.mjs.map +1 -0
  141. package/dist/meta/cjs.tsbuildinfo +1 -1
  142. package/package.json +3 -1
  143. package/src/ClientSchema/Core/ClientSchemaProperty.ts +3 -1
  144. package/src/ClientSchema/ai/ClientConversation.ts +15 -0
  145. package/src/ClientSchema/index.ts +15 -1
  146. package/src/CustomOperation.ts +48 -5
  147. package/src/ModelSchema.ts +4 -1
  148. package/src/SchemaProcessor.ts +73 -8
  149. package/src/a.ts +10 -1
  150. package/src/ai/ConversationSchemaTypes.ts +253 -0
  151. package/src/ai/ConversationType.ts +135 -0
  152. package/src/ai/ModelType.ts +43 -0
  153. package/src/ai/types/ConversationMessageContent.ts +43 -0
  154. package/src/ai/types/ToolConfiguration.ts +24 -0
  155. package/src/ai/types/ToolResultContent.ts +28 -0
  156. package/src/ai/types/contentBlocks.ts +26 -0
  157. package/src/runtime/addSchemaToClient.ts +12 -0
  158. package/src/runtime/bridge-types.ts +41 -4
  159. package/src/runtime/client/index.ts +82 -23
  160. package/src/runtime/internals/APIClient.ts +3 -4
  161. package/src/runtime/internals/ai/conversationMessageDeserializers.ts +62 -0
  162. package/src/runtime/internals/ai/conversationMessageSerializers.ts +68 -0
  163. package/src/runtime/internals/ai/convertItemToConversation.ts +53 -0
  164. package/src/runtime/internals/ai/convertItemToConversationMessage.ts +18 -0
  165. package/src/runtime/internals/ai/createCreateConversationFunction.ts +44 -0
  166. package/src/runtime/internals/ai/createGetConversationFunction.ts +48 -0
  167. package/src/runtime/internals/ai/createListConversationsFunction.ts +46 -0
  168. package/src/runtime/internals/ai/createListMessagesFunction.ts +42 -0
  169. package/src/runtime/internals/ai/createOnMessageFunction.ts +41 -0
  170. package/src/runtime/internals/ai/createSendMessageFunction.ts +60 -0
  171. package/src/runtime/internals/index.ts +2 -0
  172. package/src/runtime/internals/operations/custom.ts +24 -12
  173. package/src/runtime/internals/utils/clientProperties/generateConversationsProperty.ts +91 -0
  174. package/src/runtime/internals/utils/clientProperties/generateGenerationsProperty.ts +41 -0
package/dist/cjs/a.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"a.js","sources":["../../src/a.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handler = exports.ipAddress = exports.url = exports.phone = exports.json = exports.email = exports.timestamp = exports.datetime = exports.time = exports.date = exports.boolean = exports.float = exports.integer = exports.string = exports.id = exports.belongsTo = exports.hasMany = exports.hasOne = exports.subscription = exports.mutation = exports.query = exports.enum = exports.customType = exports.ref = exports.model = exports.combine = exports.schema = void 0;\nconst ModelSchema_1 = require(\"./ModelSchema\");\nObject.defineProperty(exports, \"schema\", { enumerable: true, get: function () { return ModelSchema_1.schema; } });\nconst CombineSchema_1 = require(\"./CombineSchema\");\nObject.defineProperty(exports, \"combine\", { enumerable: true, get: function () { return CombineSchema_1.combine; } });\nconst ModelType_1 = require(\"./ModelType\");\nObject.defineProperty(exports, \"model\", { enumerable: true, get: function () { return ModelType_1.model; } });\nconst ModelField_1 = require(\"./ModelField\");\nObject.defineProperty(exports, \"id\", { enumerable: true, get: function () { return ModelField_1.id; } });\nObject.defineProperty(exports, \"string\", { enumerable: true, get: function () { return ModelField_1.string; } });\nObject.defineProperty(exports, \"integer\", { enumerable: true, get: function () { return ModelField_1.integer; } });\nObject.defineProperty(exports, \"float\", { enumerable: true, get: function () { return ModelField_1.float; } });\nObject.defineProperty(exports, \"boolean\", { enumerable: true, get: function () { return ModelField_1.boolean; } });\nObject.defineProperty(exports, \"date\", { enumerable: true, get: function () { return ModelField_1.date; } });\nObject.defineProperty(exports, \"time\", { enumerable: true, get: function () { return ModelField_1.time; } });\nObject.defineProperty(exports, \"datetime\", { enumerable: true, get: function () { return ModelField_1.datetime; } });\nObject.defineProperty(exports, \"timestamp\", { enumerable: true, get: function () { return ModelField_1.timestamp; } });\nObject.defineProperty(exports, \"email\", { enumerable: true, get: function () { return ModelField_1.email; } });\nObject.defineProperty(exports, \"json\", { enumerable: true, get: function () { return ModelField_1.json; } });\nObject.defineProperty(exports, \"phone\", { enumerable: true, get: function () { return ModelField_1.phone; } });\nObject.defineProperty(exports, \"url\", { enumerable: true, get: function () { return ModelField_1.url; } });\nObject.defineProperty(exports, \"ipAddress\", { enumerable: true, get: function () { return ModelField_1.ipAddress; } });\nconst RefType_1 = require(\"./RefType\");\nObject.defineProperty(exports, \"ref\", { enumerable: true, get: function () { return RefType_1.ref; } });\nconst ModelRelationalField_1 = require(\"./ModelRelationalField\");\nObject.defineProperty(exports, \"hasOne\", { enumerable: true, get: function () { return ModelRelationalField_1.hasOne; } });\nObject.defineProperty(exports, \"hasMany\", { enumerable: true, get: function () { return ModelRelationalField_1.hasMany; } });\nObject.defineProperty(exports, \"belongsTo\", { enumerable: true, get: function () { return ModelRelationalField_1.belongsTo; } });\nconst CustomType_1 = require(\"./CustomType\");\nObject.defineProperty(exports, \"customType\", { enumerable: true, get: function () { return CustomType_1.customType; } });\nconst EnumType_1 = require(\"./EnumType\");\nObject.defineProperty(exports, \"enum\", { enumerable: true, get: function () { return EnumType_1.enumType; } });\nconst CustomOperation_1 = require(\"./CustomOperation\");\nObject.defineProperty(exports, \"query\", { enumerable: true, get: function () { return CustomOperation_1.query; } });\nObject.defineProperty(exports, \"mutation\", { enumerable: true, get: function () { return CustomOperation_1.mutation; } });\nObject.defineProperty(exports, \"subscription\", { enumerable: true, get: function () { return CustomOperation_1.subscription; } });\nconst Handler_1 = require(\"./Handler\");\nObject.defineProperty(exports, \"handler\", { enumerable: true, get: function () { return Handler_1.handler; } });\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,IAAI,GA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OAAO,iBAAiB,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;AACpH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,iBAAiB,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC;AAC1H,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,iBAAiB,CAAC,YAAY,CAAC,EAAE,EAAE,CAAC,CAAC;AAClI,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACvC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;;"}
1
+ {"version":3,"file":"a.js","sources":["../../src/a.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handler = exports.ai = exports.generation = exports.conversation = exports.ipAddress = exports.url = exports.phone = exports.json = exports.email = exports.timestamp = exports.datetime = exports.time = exports.date = exports.boolean = exports.float = exports.integer = exports.string = exports.id = exports.belongsTo = exports.hasMany = exports.hasOne = exports.subscription = exports.mutation = exports.query = exports.enum = exports.customType = exports.ref = exports.model = exports.combine = exports.schema = void 0;\nconst ModelSchema_1 = require(\"./ModelSchema\");\nObject.defineProperty(exports, \"schema\", { enumerable: true, get: function () { return ModelSchema_1.schema; } });\nconst CombineSchema_1 = require(\"./CombineSchema\");\nObject.defineProperty(exports, \"combine\", { enumerable: true, get: function () { return CombineSchema_1.combine; } });\nconst ModelType_1 = require(\"./ModelType\");\nObject.defineProperty(exports, \"model\", { enumerable: true, get: function () { return ModelType_1.model; } });\nconst ModelField_1 = require(\"./ModelField\");\nObject.defineProperty(exports, \"id\", { enumerable: true, get: function () { return ModelField_1.id; } });\nObject.defineProperty(exports, \"string\", { enumerable: true, get: function () { return ModelField_1.string; } });\nObject.defineProperty(exports, \"integer\", { enumerable: true, get: function () { return ModelField_1.integer; } });\nObject.defineProperty(exports, \"float\", { enumerable: true, get: function () { return ModelField_1.float; } });\nObject.defineProperty(exports, \"boolean\", { enumerable: true, get: function () { return ModelField_1.boolean; } });\nObject.defineProperty(exports, \"date\", { enumerable: true, get: function () { return ModelField_1.date; } });\nObject.defineProperty(exports, \"time\", { enumerable: true, get: function () { return ModelField_1.time; } });\nObject.defineProperty(exports, \"datetime\", { enumerable: true, get: function () { return ModelField_1.datetime; } });\nObject.defineProperty(exports, \"timestamp\", { enumerable: true, get: function () { return ModelField_1.timestamp; } });\nObject.defineProperty(exports, \"email\", { enumerable: true, get: function () { return ModelField_1.email; } });\nObject.defineProperty(exports, \"json\", { enumerable: true, get: function () { return ModelField_1.json; } });\nObject.defineProperty(exports, \"phone\", { enumerable: true, get: function () { return ModelField_1.phone; } });\nObject.defineProperty(exports, \"url\", { enumerable: true, get: function () { return ModelField_1.url; } });\nObject.defineProperty(exports, \"ipAddress\", { enumerable: true, get: function () { return ModelField_1.ipAddress; } });\nconst RefType_1 = require(\"./RefType\");\nObject.defineProperty(exports, \"ref\", { enumerable: true, get: function () { return RefType_1.ref; } });\nconst ModelRelationalField_1 = require(\"./ModelRelationalField\");\nObject.defineProperty(exports, \"hasOne\", { enumerable: true, get: function () { return ModelRelationalField_1.hasOne; } });\nObject.defineProperty(exports, \"hasMany\", { enumerable: true, get: function () { return ModelRelationalField_1.hasMany; } });\nObject.defineProperty(exports, \"belongsTo\", { enumerable: true, get: function () { return ModelRelationalField_1.belongsTo; } });\nconst CustomType_1 = require(\"./CustomType\");\nObject.defineProperty(exports, \"customType\", { enumerable: true, get: function () { return CustomType_1.customType; } });\nconst EnumType_1 = require(\"./EnumType\");\nObject.defineProperty(exports, \"enum\", { enumerable: true, get: function () { return EnumType_1.enumType; } });\nconst CustomOperation_1 = require(\"./CustomOperation\");\nObject.defineProperty(exports, \"query\", { enumerable: true, get: function () { return CustomOperation_1.query; } });\nObject.defineProperty(exports, \"mutation\", { enumerable: true, get: function () { return CustomOperation_1.mutation; } });\nObject.defineProperty(exports, \"subscription\", { enumerable: true, get: function () { return CustomOperation_1.subscription; } });\nObject.defineProperty(exports, \"generation\", { enumerable: true, get: function () { return CustomOperation_1.generation; } });\nconst Handler_1 = require(\"./Handler\");\nObject.defineProperty(exports, \"handler\", { enumerable: true, get: function () { return Handler_1.handler; } });\nconst ConversationType_1 = require(\"./ai/ConversationType\");\nObject.defineProperty(exports, \"conversation\", { enumerable: true, get: function () { return ConversationType_1.conversation; } });\nconst ModelType_2 = require(\"./ai/ModelType\");\nconst ai = {\n model: ModelType_2.model,\n};\nexports.ai = ai;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,EAAE,GAAG,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,EAAE,GAAG,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,IA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C,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,iBAAiB,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC;AAC9H,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACvC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;AAChH,MAAM,kBAAkB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAC5D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,kBAAkB,CAAC,YAAY,CAAC,EAAE,EAAE,CAAC,CAAC;AACnI,MAAM,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC9C,MAAM,EAAE,GAAG;AACX,IAAI,KAAK,EAAE,WAAW,CAAC,KAAK;AAC5B,CAAC,CAAC;AACF,OAAO,CAAC,EAAE,GAAG,EAAE;;"}
@@ -0,0 +1,210 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.conversationTypes = exports.createConversationField = void 0;
5
+ const utils_1 = require("../runtime/utils");
6
+ const createConversationField = (typeDef, typeName) => {
7
+ const { aiModel, systemPrompt, handler, tools } = typeDef;
8
+ const args = {
9
+ aiModel: aiModel.resourcePath,
10
+ systemPrompt,
11
+ };
12
+ if (handler) {
13
+ if (typeof handler === 'string') {
14
+ args['functionName'] = handler;
15
+ }
16
+ else if (typeof handler.getInstance === 'function') {
17
+ args['functionName'] = `Fn${(0, utils_1.capitalize)(typeName)}`;
18
+ }
19
+ }
20
+ const argsString = Object.entries(args)
21
+ .map(([key, value]) => `${key}: "${value}"`)
22
+ .join(', ');
23
+ const toolsString = tools?.length
24
+ ? `, tools: [${getConversationToolsString(tools)}]`
25
+ : '';
26
+ const conversationDirective = `@conversation(${argsString}${toolsString})`;
27
+ return `${typeName}(conversationId: ID!, content: [ContentBlockInput], aiContext: AWSJSON, toolConfiguration: ToolConfigurationInput): ConversationMessage ${conversationDirective} @aws_cognito_user_pools`;
28
+ };
29
+ exports.createConversationField = createConversationField;
30
+ const isRef = (query) => query?.data?.type === 'ref';
31
+ const getConversationToolsString = (tools) => tools
32
+ .map((tool) => {
33
+ const { query, description } = tool;
34
+ if (!isRef(query)) {
35
+ throw new Error(`Unexpected query was found in tool ${tool}.`);
36
+ }
37
+ // TODO: add validation for query / auth (cup) / etc
38
+ const queryName = query.data.link;
39
+ return `{ name: "${queryName}", description: "${description}" }`;
40
+ })
41
+ .join(', ');
42
+ const ConversationParticipantRole = `enum ConversationParticipantRole {
43
+ user
44
+ assistant
45
+ }`;
46
+ const ConversationMessage = `interface ConversationMessage {
47
+ id: ID!
48
+ conversationId: ID!
49
+ role: ConversationParticipantRole
50
+ content: [ContentBlock]
51
+ aiContext: AWSJSON
52
+ toolConfiguration: ToolConfiguration
53
+ createdAt: AWSDateTime
54
+ updatedAt: AWSDateTime
55
+ owner: String
56
+ }`;
57
+ const DocumentBlockSourceInput = `input DocumentBlockSourceInput {
58
+ bytes: String
59
+ }`;
60
+ const DocumentBlockInput = `input DocumentBlockInput {
61
+ format: String!
62
+ name: String!
63
+ source: DocumentBlockSourceInput!
64
+ }`;
65
+ const ImageBlockSourceInput = `input ImageBlockSourceInput {
66
+ bytes: String
67
+ }`;
68
+ const ImageBlockInput = `input ImageBlockInput {
69
+ format: String!
70
+ source: ImageBlockSourceInput!
71
+ }`;
72
+ const ToolResultContentBlockInput = `input ToolResultContentBlockInput {
73
+ document: DocumentBlockInput
74
+ image: ImageBlockInput
75
+ json: AWSJSON
76
+ text: String
77
+ }`;
78
+ const ToolResultBlockInput = `input ToolResultBlockInput {
79
+ content: [ToolResultContentBlockInput!]!
80
+ toolUseId: String!
81
+ status: String
82
+ }`;
83
+ const DocumentBlockSource = `type DocumentBlockSource {
84
+ bytes: String
85
+ }
86
+ `;
87
+ const DocumentBlock = `type DocumentBlock {
88
+ format: String!
89
+ name: String!
90
+ source: DocumentBlockSource!
91
+ }`;
92
+ const ImageBlock = `type ImageBlock {
93
+ format: String!
94
+ source: ImageBlockSource!
95
+ }`;
96
+ const ImageBlockSource = `type ImageBlockSource {
97
+ bytes: String
98
+ }`;
99
+ const ToolUseBlockInput = `input ToolUseBlockInput {
100
+ toolUseId: String!
101
+ name: String!
102
+ input: AWSJSON!
103
+ }`;
104
+ const ToolUseBlock = `type ToolUseBlock {
105
+ toolUseId: String!
106
+ name: String!
107
+ input: AWSJSON!
108
+ }`;
109
+ const ToolResultContentBlock = `type ToolResultContentBlock {
110
+ document: DocumentBlock
111
+ image: ImageBlock
112
+ json: AWSJSON
113
+ text: String
114
+ }`;
115
+ const ToolResultBlock = `type ToolResultBlock {
116
+ content: [ToolResultContentBlock!]!
117
+ toolUseId: String!
118
+ status: String
119
+ }`;
120
+ const ContentBlockText = `type ContentBlockText {
121
+ text: String
122
+ }`;
123
+ const ContentBlockImage = `type ContentBlockImage {
124
+ image: ImageBlock
125
+ }`;
126
+ const ContentBlockDocument = `type ContentBlockDocument {
127
+ document: DocumentBlock
128
+ }`;
129
+ const ContentBlockToolUse = `type ContentBlockToolUse {
130
+ toolUse: ToolUseBlock
131
+ }`;
132
+ const ContentBlockToolResult = `type ContentBlockToolResult {
133
+ toolResult: ToolResultBlock
134
+ }`;
135
+ const ContentBlockInput = `input ContentBlockInput {
136
+ text: String
137
+ document: DocumentBlockInput
138
+ image: ImageBlockInput
139
+ toolResult: ToolResultBlockInput
140
+ toolUse: ToolUseBlockInput
141
+ }`;
142
+ const ContentBlock = `type ContentBlock {
143
+ text: String
144
+ document: DocumentBlock
145
+ image: ImageBlock
146
+ toolResult: ToolResultBlock
147
+ toolUse: ToolUseBlock
148
+ }`;
149
+ const ToolConfigurationInput = `input ToolConfigurationInput {
150
+ tools: [ToolInput]
151
+ }`;
152
+ const ToolInput = `input ToolInput {
153
+ toolSpec: ToolSpecificationInput
154
+ }`;
155
+ const ToolSpecificationInput = `input ToolSpecificationInput {
156
+ name: String!
157
+ description: String
158
+ inputSchema: ToolInputSchemaInput!
159
+ }`;
160
+ const ToolInputSchemaInput = `input ToolInputSchemaInput {
161
+ json: AWSJSON
162
+ }`;
163
+ const ToolConfiguration = `type ToolConfiguration {
164
+ tools: [Tool]
165
+ }`;
166
+ const Tool = `type Tool {
167
+ toolSpec: ToolSpecification
168
+ }`;
169
+ const ToolSpecification = `type ToolSpecification {
170
+ name: String!
171
+ description: String
172
+ inputSchema: ToolInputSchema!
173
+ }`;
174
+ const ToolInputSchema = `type ToolInputSchema {
175
+ json: AWSJSON
176
+ }`;
177
+ exports.conversationTypes = [
178
+ ConversationParticipantRole,
179
+ ConversationMessage,
180
+ DocumentBlockSourceInput,
181
+ DocumentBlockInput,
182
+ ImageBlockSourceInput,
183
+ ImageBlockInput,
184
+ ToolUseBlockInput,
185
+ ToolResultContentBlockInput,
186
+ ToolResultBlockInput,
187
+ DocumentBlockSource,
188
+ DocumentBlock,
189
+ ImageBlock,
190
+ ImageBlockSource,
191
+ ToolUseBlock,
192
+ ToolResultContentBlock,
193
+ ToolResultBlock,
194
+ ContentBlockText,
195
+ ContentBlockImage,
196
+ ContentBlockDocument,
197
+ ContentBlockToolUse,
198
+ ContentBlockToolResult,
199
+ ContentBlockInput,
200
+ ContentBlock,
201
+ ToolConfigurationInput,
202
+ ToolInput,
203
+ ToolSpecificationInput,
204
+ ToolInputSchemaInput,
205
+ ToolConfiguration,
206
+ Tool,
207
+ ToolSpecification,
208
+ ToolInputSchema,
209
+ ];
210
+ //# sourceMappingURL=ConversationSchemaTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConversationSchemaTypes.js","sources":["../../../src/ai/ConversationSchemaTypes.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.conversationTypes = exports.createConversationField = void 0;\nconst utils_1 = require(\"../runtime/utils\");\nconst createConversationField = (typeDef, typeName) => {\n const { aiModel, systemPrompt, handler, tools } = typeDef;\n const args = {\n aiModel: aiModel.resourcePath,\n systemPrompt,\n };\n if (handler) {\n if (typeof handler === 'string') {\n args['functionName'] = handler;\n }\n else if (typeof handler.getInstance === 'function') {\n args['functionName'] = `Fn${(0, utils_1.capitalize)(typeName)}`;\n }\n }\n const argsString = Object.entries(args)\n .map(([key, value]) => `${key}: \"${value}\"`)\n .join(', ');\n const toolsString = tools?.length\n ? `, tools: [${getConversationToolsString(tools)}]`\n : '';\n const conversationDirective = `@conversation(${argsString}${toolsString})`;\n return `${typeName}(conversationId: ID!, content: [ContentBlockInput], aiContext: AWSJSON, toolConfiguration: ToolConfigurationInput): ConversationMessage ${conversationDirective} @aws_cognito_user_pools`;\n};\nexports.createConversationField = createConversationField;\nconst isRef = (query) => query?.data?.type === 'ref';\nconst getConversationToolsString = (tools) => tools\n .map((tool) => {\n const { query, description } = tool;\n if (!isRef(query)) {\n throw new Error(`Unexpected query was found in tool ${tool}.`);\n }\n // TODO: add validation for query / auth (cup) / etc\n const queryName = query.data.link;\n return `{ name: \"${queryName}\", description: \"${description}\" }`;\n})\n .join(', ');\nconst ConversationParticipantRole = `enum ConversationParticipantRole {\n user\n assistant\n}`;\nconst ConversationMessage = `interface ConversationMessage {\n id: ID!\n conversationId: ID!\n role: ConversationParticipantRole\n content: [ContentBlock]\n aiContext: AWSJSON\n toolConfiguration: ToolConfiguration\n createdAt: AWSDateTime\n updatedAt: AWSDateTime\n owner: String\n}`;\nconst DocumentBlockSourceInput = `input DocumentBlockSourceInput {\n bytes: String\n}`;\nconst DocumentBlockInput = `input DocumentBlockInput {\n format: String!\n name: String!\n source: DocumentBlockSourceInput!\n}`;\nconst ImageBlockSourceInput = `input ImageBlockSourceInput {\n bytes: String\n}`;\nconst ImageBlockInput = `input ImageBlockInput {\n format: String!\n source: ImageBlockSourceInput!\n}`;\nconst ToolResultContentBlockInput = `input ToolResultContentBlockInput {\n document: DocumentBlockInput\n image: ImageBlockInput\n json: AWSJSON\n text: String\n}`;\nconst ToolResultBlockInput = `input ToolResultBlockInput {\n content: [ToolResultContentBlockInput!]!\n toolUseId: String!\n status: String\n}`;\nconst DocumentBlockSource = `type DocumentBlockSource {\n bytes: String\n}\n`;\nconst DocumentBlock = `type DocumentBlock {\n format: String!\n name: String!\n source: DocumentBlockSource!\n}`;\nconst ImageBlock = `type ImageBlock {\n format: String!\n source: ImageBlockSource!\n}`;\nconst ImageBlockSource = `type ImageBlockSource {\n bytes: String\n}`;\nconst ToolUseBlockInput = `input ToolUseBlockInput {\n toolUseId: String!\n name: String!\n input: AWSJSON!\n}`;\nconst ToolUseBlock = `type ToolUseBlock {\n toolUseId: String!\n name: String!\n input: AWSJSON!\n}`;\nconst ToolResultContentBlock = `type ToolResultContentBlock {\n document: DocumentBlock\n image: ImageBlock\n json: AWSJSON\n text: String\n}`;\nconst ToolResultBlock = `type ToolResultBlock {\n content: [ToolResultContentBlock!]!\n toolUseId: String!\n status: String\n}`;\nconst ContentBlockText = `type ContentBlockText {\n text: String\n}`;\nconst ContentBlockImage = `type ContentBlockImage {\n image: ImageBlock\n}`;\nconst ContentBlockDocument = `type ContentBlockDocument {\n document: DocumentBlock\n}`;\nconst ContentBlockToolUse = `type ContentBlockToolUse {\n toolUse: ToolUseBlock\n}`;\nconst ContentBlockToolResult = `type ContentBlockToolResult {\n toolResult: ToolResultBlock\n}`;\nconst ContentBlockInput = `input ContentBlockInput {\n text: String\n document: DocumentBlockInput\n image: ImageBlockInput\n toolResult: ToolResultBlockInput\n toolUse: ToolUseBlockInput\n}`;\nconst ContentBlock = `type ContentBlock {\n text: String\n document: DocumentBlock\n image: ImageBlock\n toolResult: ToolResultBlock\n toolUse: ToolUseBlock\n}`;\nconst ToolConfigurationInput = `input ToolConfigurationInput {\n tools: [ToolInput]\n}`;\nconst ToolInput = `input ToolInput {\n toolSpec: ToolSpecificationInput\n}`;\nconst ToolSpecificationInput = `input ToolSpecificationInput {\n name: String!\n description: String\n inputSchema: ToolInputSchemaInput!\n}`;\nconst ToolInputSchemaInput = `input ToolInputSchemaInput {\n json: AWSJSON\n}`;\nconst ToolConfiguration = `type ToolConfiguration {\n tools: [Tool]\n}`;\nconst Tool = `type Tool {\n toolSpec: ToolSpecification\n}`;\nconst ToolSpecification = `type ToolSpecification {\n name: String!\n description: String\n inputSchema: ToolInputSchema!\n}`;\nconst ToolInputSchema = `type ToolInputSchema {\n json: AWSJSON\n}`;\nexports.conversationTypes = [\n ConversationParticipantRole,\n ConversationMessage,\n DocumentBlockSourceInput,\n DocumentBlockInput,\n ImageBlockSourceInput,\n ImageBlockInput,\n ToolUseBlockInput,\n ToolResultContentBlockInput,\n ToolResultBlockInput,\n DocumentBlockSource,\n DocumentBlock,\n ImageBlock,\n ImageBlockSource,\n ToolUseBlock,\n ToolResultContentBlock,\n ToolResultBlock,\n ContentBlockText,\n ContentBlockImage,\n ContentBlockDocument,\n ContentBlockToolUse,\n ContentBlockToolResult,\n ContentBlockInput,\n ContentBlock,\n ToolConfigurationInput,\n ToolInput,\n ToolSpecificationInput,\n ToolInputSchemaInput,\n ToolConfiguration,\n Tool,\n ToolSpecification,\n ToolInputSchema,\n];\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,uBAAuB,GAAG,KAAK,CAAC,CAAC;AACrE,MAAM,OAAO,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC5C,MAAM,uBAAuB,GAAG,CAAC,OAAO,EAAE,QAAQ,KAAK;AACvD,IAAI,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE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M,iBAAiB,GAAG,CAAC;AAC3B;AACA;AACA;AACA,CAAC,CAAC,CAAC;AACH,MAAM,eAAe,GAAG,CAAC;AACzB;AACA,CAAC,CAAC,CAAC;AACH,OAAO,CAAC,iBAAiB,GAAG;AAC5B,IAAI,2BAA2B;AAC/B,IAAI,mBAAmB;AACvB,IAAI,wBAAwB;AAC5B,IAAI,kBAAkB;AACtB,IAAI,qBAAqB;AACzB,IAAI,eAAe;AACnB,IAAI,iBAAiB;AACrB,IAAI,2BAA2B;AAC/B,IAAI,oBAAoB;AACxB,IAAI,mBAAmB;AACvB,IAAI,aAAa;AACjB,IAAI,UAAU;AACd,IAAI,gBAAgB;AACpB,IAAI,YAAY;AAChB,IAAI,sBAAsB;AAC1B,IAAI,eAAe;AACnB,IAAI,gBAAgB;AACpB,IAAI,iBAAiB;AACrB,IAAI,oBAAoB;AACxB,IAAI,mBAAmB;AACvB,IAAI,sBAAsB;AAC1B,IAAI,iBAAiB;AACrB,IAAI,YAAY;AAChB,IAAI,sBAAsB;AAC1B,IAAI,SAAS;AACb,IAAI,sBAAsB;AAC1B,IAAI,oBAAoB;AACxB,IAAI,iBAAiB;AACrB,IAAI,IAAI;AACR,IAAI,iBAAiB;AACrB,IAAI,eAAe;AACnB,CAAC;;"}
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ // SPDX-License-Identifier: Apache-2.0
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.conversation = exports.brandName = void 0;
7
+ const util_1 = require("../util");
8
+ exports.brandName = 'conversationCustomOperation';
9
+ function _conversation(input) {
10
+ return { ...(0, util_1.brand)(exports.brandName), ...input };
11
+ }
12
+ /**
13
+ * @experimental
14
+ *
15
+ * Define an AI conversation route which enables multi-turn conversation APIs for interacting with specified AI model.
16
+ * @example
17
+ * realtorChat: a.conversation({
18
+ * aiModel: { resourcePath },
19
+ * systemPrompt: 'You are a helpful real estate assistant',
20
+ * })
21
+ * @returns a conversation route definition
22
+ */
23
+ function conversation(input) {
24
+ return _conversation(input);
25
+ }
26
+ exports.conversation = conversation;
27
+ //# sourceMappingURL=ConversationType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConversationType.js","sources":["../../../src/ai/ConversationType.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.conversation = exports.brandName = void 0;\nconst util_1 = require(\"../util\");\nexports.brandName = 'conversationCustomOperation';\nfunction _conversation(input) {\n return { ...(0, util_1.brand)(exports.brandName), ...input };\n}\n/**\n * @experimental\n *\n * Define an AI conversation route which enables multi-turn conversation APIs for interacting with specified AI model.\n * @example\n * realtorChat: a.conversation({\n * aiModel: { resourcePath },\n * systemPrompt: 'You are a helpful real estate assistant',\n * })\n * @returns a conversation route definition\n */\nfunction conversation(input) {\n return _conversation(input);\n}\nexports.conversation = conversation;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,SAAS,GAAG,KAAK,CAAC,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,OAAO,CAAC,SAAS,GAAG,6BAA6B,CAAC;AAClD,SAAS,aAAa,CAAC,KAAK,EAAE;AAC9B,IAAI,OAAO,EAAE,GAAG,IAAI,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC;AACjE,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,YAAY,CAAC,KAAK,EAAE;AAC7B,IAAI,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC;AACD,OAAO,CAAC,YAAY,GAAG,YAAY;;"}
@@ -0,0 +1,37 @@
1
+ 'use strict';
2
+
3
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ // SPDX-License-Identifier: Apache-2.0
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.model = void 0;
7
+ const supportedModelsLookup = {
8
+ // Anthropic models
9
+ 'Claude 3 Haiku': 'anthropic.claude-3-haiku-20240307-v1:0',
10
+ 'Claude 3 Opus': 'anthropic.claude-3-opus-20240229-v1:0',
11
+ 'Claude 3 Sonnet': 'anthropic.claude-3-sonnet-20240229-v1:0',
12
+ 'Claude 3.5 Sonnet': 'anthropic.claude-3-5-sonnet-20240620-v1:0',
13
+ // Cohere models
14
+ 'Cohere Command R': 'cohere.command-r-v1:0',
15
+ 'Cohere Command R+': 'cohere.command-r-plus-v1:0',
16
+ // Meta models
17
+ 'Llama 3.1 8B Instruct': 'meta.llama3-1-8b-instruct-v1:0',
18
+ 'Llama 3.1 70B Instruct': 'meta.llama3-1-70b-instruct-v1:0',
19
+ 'Llama 3.1 405B Instruct': 'meta.llama3-1-405b-instruct-v1:0',
20
+ // Mistral AI models
21
+ 'Mistral Large': 'mistral.mistral-large-2402-v1:0',
22
+ 'Mistral Large 2': 'mistral.mistral-large-2407-v1:0',
23
+ 'Mistral Small': 'mistral.mistral-small-2402-v1:0',
24
+ };
25
+ /**
26
+ * @experimental
27
+ *
28
+ * Bedrock models currently supporting Converse API and Tool use
29
+ * @see {@link https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html#conversation-inference-supported-models-features}
30
+ */
31
+ function model(modelName) {
32
+ return {
33
+ resourcePath: supportedModelsLookup[modelName],
34
+ };
35
+ }
36
+ exports.model = model;
37
+ //# sourceMappingURL=ModelType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModelType.js","sources":["../../../src/ai/ModelType.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.model = void 0;\nconst supportedModelsLookup = {\n // Anthropic models\n 'Claude 3 Haiku': 'anthropic.claude-3-haiku-20240307-v1:0',\n 'Claude 3 Opus': 'anthropic.claude-3-opus-20240229-v1:0',\n 'Claude 3 Sonnet': 'anthropic.claude-3-sonnet-20240229-v1:0',\n 'Claude 3.5 Sonnet': 'anthropic.claude-3-5-sonnet-20240620-v1:0',\n // Cohere models\n 'Cohere Command R': 'cohere.command-r-v1:0',\n 'Cohere Command R+': 'cohere.command-r-plus-v1:0',\n // Meta models\n 'Llama 3.1 8B Instruct': 'meta.llama3-1-8b-instruct-v1:0',\n 'Llama 3.1 70B Instruct': 'meta.llama3-1-70b-instruct-v1:0',\n 'Llama 3.1 405B Instruct': 'meta.llama3-1-405b-instruct-v1:0',\n // Mistral AI models\n 'Mistral Large': 'mistral.mistral-large-2402-v1:0',\n 'Mistral Large 2': 'mistral.mistral-large-2407-v1:0',\n 'Mistral Small': 'mistral.mistral-small-2402-v1:0',\n};\n/**\n * @experimental\n *\n * Bedrock models currently supporting Converse API and Tool use\n * @see {@link https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html#conversation-inference-supported-models-features}\n */\nfunction model(modelName) {\n return {\n resourcePath: supportedModelsLookup[modelName],\n };\n}\nexports.model = model;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC;AACvB,MAAM,qBAAqB,GAAG;AAC9B;AACA,IAAI,gBAAgB,EAAE,wCAAwC;AAC9D,IAAI,eAAe,EAAE,uCAAuC;AAC5D,IAAI,iBAAiB,EAAE,yCAAyC;AAChE,IAAI,mBAAmB,EAAE,2CAA2C;AACpE;AACA,IAAI,kBAAkB,EAAE,uBAAuB;AAC/C,IAAI,mBAAmB,EAAE,4BAA4B;AACrD;AACA,IAAI,uBAAuB,EAAE,gCAAgC;AAC7D,IAAI,wBAAwB,EAAE,iCAAiC;AAC/D,IAAI,yBAAyB,EAAE,kCAAkC;AACjE;AACA,IAAI,eAAe,EAAE,iCAAiC;AACtD,IAAI,iBAAiB,EAAE,iCAAiC;AACxD,IAAI,eAAe,EAAE,iCAAiC;AACtD,CAAC,CAAC;AACF;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,KAAK,CAAC,SAAS,EAAE;AAC1B,IAAI,OAAO;AACX,QAAQ,YAAY,EAAE,qBAAqB,CAAC,SAAS,CAAC;AACtD,KAAK,CAAC;AACN,CAAC;AACD,OAAO,CAAC,KAAK,GAAG,KAAK;;"}
@@ -0,0 +1,6 @@
1
+ 'use strict';
2
+
3
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ // SPDX-License-Identifier: Apache-2.0
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=ConversationMessageContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConversationMessageContent.js","sources":["../../../../src/ai/types/ConversationMessageContent.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 });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;;"}
@@ -0,0 +1,6 @@
1
+ 'use strict';
2
+
3
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ // SPDX-License-Identifier: Apache-2.0
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=ToolConfiguration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToolConfiguration.js","sources":["../../../../src/ai/types/ToolConfiguration.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 });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;;"}
@@ -0,0 +1,6 @@
1
+ 'use strict';
2
+
3
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ // SPDX-License-Identifier: Apache-2.0
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=ToolResultContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToolResultContent.js","sources":["../../../../src/ai/types/ToolResultContent.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 });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;;"}
@@ -0,0 +1,6 @@
1
+ 'use strict';
2
+
3
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ // SPDX-License-Identifier: Apache-2.0
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=contentBlocks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contentBlocks.js","sources":["../../../../src/ai/types/contentBlocks.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 });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;;"}
@@ -12,6 +12,8 @@ function addSchemaToClient(client, apiGraphqlConfig, getInternals) {
12
12
  client.queries = (0, internals_1.generateCustomQueriesProperty)(client, apiGraphqlConfig, getInternals);
13
13
  client.mutations = (0, internals_1.generateCustomMutationsProperty)(client, apiGraphqlConfig, getInternals);
14
14
  client.subscriptions = (0, internals_1.generateCustomSubscriptionsProperty)(client, apiGraphqlConfig, getInternals);
15
+ client.conversations = (0, internals_1.generateConversationsProperty)(client, apiGraphqlConfig, getInternals);
16
+ client.generations = (0, internals_1.generateGenerationsProperty)(client, apiGraphqlConfig, getInternals);
15
17
  return client;
16
18
  }
17
19
  exports.addSchemaToClient = addSchemaToClient;
@@ -1 +1 @@
1
- {"version":3,"file":"addSchemaToClient.js","sources":["../../../src/runtime/addSchemaToClient.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.addSchemaToClient = void 0;\nconst internals_1 = require(\"./internals\");\nfunction addSchemaToClient(client, apiGraphqlConfig, getInternals) {\n (0, internals_1.upgradeClientCancellation)(client);\n client.models = (0, internals_1.generateModelsProperty)(client, apiGraphqlConfig, getInternals);\n client.enums = (0, internals_1.generateEnumsProperty)(apiGraphqlConfig);\n client.queries = (0, internals_1.generateCustomQueriesProperty)(client, apiGraphqlConfig, getInternals);\n client.mutations = (0, internals_1.generateCustomMutationsProperty)(client, apiGraphqlConfig, getInternals);\n client.subscriptions = (0, internals_1.generateCustomSubscriptionsProperty)(client, apiGraphqlConfig, getInternals);\n return client;\n}\nexports.addSchemaToClient = addSchemaToClient;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,iBAAiB,GAAG,KAAK,CAAC,CAAC;AACnC,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AAC3C,SAAS,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,EAAE,YAAY,EAAE;AACnE,IAAI,IAAI,WAAW,CAAC,yBAAyB,EAAE,MAAM,CAAC,CAAC;AACvD,IAAI,MAAM,CAAC,MAAM,GAAG,IAAI,WAAW,CAAC,sBAAsB,EAAE,MAAM,EAAE,gBAAgB,EAAE,YAAY,CAAC,CAAC;AACpG,IAAI,MAAM,CAAC,KAAK,GAAG,IAAI,WAAW,CAAC,qBAAqB,EAAE,gBAAgB,CAAC,CAAC;AAC5E,IAAI,MAAM,CAAC,OAAO,GAAG,IAAI,WAAW,CAAC,6BAA6B,EAAE,MAAM,EAAE,gBAAgB,EAAE,YAAY,CAAC,CAAC;AAC5G,IAAI,MAAM,CAAC,SAAS,GAAG,IAAI,WAAW,CAAC,+BAA+B,EAAE,MAAM,EAAE,gBAAgB,EAAE,YAAY,CAAC,CAAC;AAChH,IAAI,MAAM,CAAC,aAAa,GAAG,IAAI,WAAW,CAAC,mCAAmC,EAAE,MAAM,EAAE,gBAAgB,EAAE,YAAY,CAAC,CAAC;AACxH,IAAI,OAAO,MAAM,CAAC;AAClB,CAAC;AACD,OAAO,CAAC,iBAAiB,GAAG,iBAAiB;;"}
1
+ {"version":3,"file":"addSchemaToClient.js","sources":["../../../src/runtime/addSchemaToClient.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.addSchemaToClient = void 0;\nconst internals_1 = require(\"./internals\");\nfunction addSchemaToClient(client, apiGraphqlConfig, getInternals) {\n (0, internals_1.upgradeClientCancellation)(client);\n client.models = (0, internals_1.generateModelsProperty)(client, apiGraphqlConfig, getInternals);\n client.enums = (0, internals_1.generateEnumsProperty)(apiGraphqlConfig);\n client.queries = (0, internals_1.generateCustomQueriesProperty)(client, apiGraphqlConfig, getInternals);\n client.mutations = (0, internals_1.generateCustomMutationsProperty)(client, apiGraphqlConfig, getInternals);\n client.subscriptions = (0, internals_1.generateCustomSubscriptionsProperty)(client, apiGraphqlConfig, getInternals);\n client.conversations = (0, internals_1.generateConversationsProperty)(client, apiGraphqlConfig, getInternals);\n client.generations = (0, internals_1.generateGenerationsProperty)(client, apiGraphqlConfig, getInternals);\n return client;\n}\nexports.addSchemaToClient = addSchemaToClient;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,iBAAiB,GAAG,KAAK,CAAC,CAAC;AACnC,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AAC3C,SAAS,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,EAAE,YAAY,EAAE;AACnE,IAAI,IAAI,WAAW,CAAC,yBAAyB,EAAE,MAAM,CAAC,CAAC;AACvD,IAAI,MAAM,CAAC,MAAM,GAAG,IAAI,WAAW,CAAC,sBAAsB,EAAE,MAAM,EAAE,gBAAgB,EAAE,YAAY,CAAC,CAAC;AACpG,IAAI,MAAM,CAAC,KAAK,GAAG,IAAI,WAAW,CAAC,qBAAqB,EAAE,gBAAgB,CAAC,CAAC;AAC5E,IAAI,MAAM,CAAC,OAAO,GAAG,IAAI,WAAW,CAAC,6BAA6B,EAAE,MAAM,EAAE,gBAAgB,EAAE,YAAY,CAAC,CAAC;AAC5G,IAAI,MAAM,CAAC,SAAS,GAAG,IAAI,WAAW,CAAC,+BAA+B,EAAE,MAAM,EAAE,gBAAgB,EAAE,YAAY,CAAC,CAAC;AAChH,IAAI,MAAM,CAAC,aAAa,GAAG,IAAI,WAAW,CAAC,mCAAmC,EAAE,MAAM,EAAE,gBAAgB,EAAE,YAAY,CAAC,CAAC;AACxH,IAAI,MAAM,CAAC,aAAa,GAAG,IAAI,WAAW,CAAC,6BAA6B,EAAE,MAAM,EAAE,gBAAgB,EAAE,YAAY,CAAC,CAAC;AAClH,IAAI,MAAM,CAAC,WAAW,GAAG,IAAI,WAAW,CAAC,2BAA2B,EAAE,MAAM,EAAE,gBAAgB,EAAE,YAAY,CAAC,CAAC;AAC9G,IAAI,OAAO,MAAM,CAAC;AAClB,CAAC;AACD,OAAO,CAAC,iBAAiB,GAAG,iBAAiB;;"}
@@ -171,7 +171,7 @@ function initializeModel(client, modelName, result, modelIntrospection, authMode
171
171
  }
172
172
  }, {});
173
173
  // if get is disabled on the related model
174
- if (client.models[relatedModelName].get === undefined) {
174
+ if (client.models[relatedModelName]?.get === undefined) {
175
175
  break;
176
176
  }
177
177
  if (context) {
@@ -237,7 +237,7 @@ function initializeModel(client, modelName, result, modelIntrospection, authMode
237
237
  return { [field]: { eq: record[parentSK[idx - 1]] } };
238
238
  });
239
239
  // if list is disabled on the related model
240
- if (client.models[relatedModelName].list === undefined) {
240
+ if (client.models[relatedModelName]?.list === undefined) {
241
241
  break;
242
242
  }
243
243
  if (context) {
@@ -285,7 +285,7 @@ function initializeModel(client, modelName, result, modelIntrospection, authMode
285
285
  return { [field]: { eq: record[parentSK[idx - 1]] } };
286
286
  });
287
287
  // if list is disabled on the related model
288
- if (client.models[relatedModelName].list === undefined) {
288
+ if (client.models[relatedModelName]?.list === undefined) {
289
289
  break;
290
290
  }
291
291
  if (context) {