@aws-amplify/graphql-api-construct 1.17.4-ai-next.1 → 1.18.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.jsii +17 -17
- package/CHANGELOG.md +3 -5
- package/lib/amplify-dynamodb-table-wrapper.js +1 -1
- package/lib/amplify-graphql-api.js +1 -1
- package/lib/amplify-graphql-definition.js +1 -1
- package/lib/sql-model-datasource-strategy.js +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/CHANGELOG.md +0 -4
- package/node_modules/@aws-amplify/graphql-auth-transformer/package.json +9 -9
- package/node_modules/@aws-amplify/graphql-conversation-transformer/CHANGELOG.md +6 -4
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/send-message-pipeline-definition.js +3 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/send-message-pipeline-definition.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/templates/invoke-lambda-resolver-fn.template.js +18 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/tools/graphql-json-schema-type.d.ts +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/tools/graphql-json-schema-type.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/tools/graphql-json-schema-type.js +65 -89
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/tools/graphql-json-schema-type.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/tools/process-tools.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/tools/process-tools.js +30 -30
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/tools/process-tools.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/package.json +7 -7
- package/node_modules/@aws-amplify/graphql-default-value-transformer/CHANGELOG.md +0 -4
- package/node_modules/@aws-amplify/graphql-default-value-transformer/package.json +4 -4
- package/node_modules/@aws-amplify/graphql-function-transformer/CHANGELOG.md +0 -4
- package/node_modules/@aws-amplify/graphql-function-transformer/package.json +3 -3
- package/node_modules/@aws-amplify/graphql-generation-transformer/CHANGELOG.md +8 -2
- package/node_modules/@aws-amplify/graphql-generation-transformer/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/resolvers/invoke-bedrock-resolver-fn.template.js +16 -1
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/resolvers/invoke-bedrock.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/resolvers/invoke-bedrock.js +4 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/resolvers/invoke-bedrock.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-generation-transformer/package.json +5 -4
- package/node_modules/@aws-amplify/graphql-http-transformer/CHANGELOG.md +0 -4
- package/node_modules/@aws-amplify/graphql-http-transformer/package.json +3 -3
- package/node_modules/@aws-amplify/graphql-index-transformer/CHANGELOG.md +0 -4
- package/node_modules/@aws-amplify/graphql-index-transformer/package.json +4 -4
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/CHANGELOG.md +0 -4
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/assets/mapping-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/package.json +7 -7
- package/node_modules/@aws-amplify/graphql-model-transformer/CHANGELOG.md +0 -4
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-notification-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-patching-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/package.json +3 -3
- package/node_modules/@aws-amplify/graphql-predictions-transformer/CHANGELOG.md +0 -4
- package/node_modules/@aws-amplify/graphql-predictions-transformer/lib/predictionsLambdaFunction.zip +0 -0
- package/node_modules/@aws-amplify/graphql-predictions-transformer/package.json +3 -3
- package/node_modules/@aws-amplify/graphql-relational-transformer/CHANGELOG.md +0 -4
- package/node_modules/@aws-amplify/graphql-relational-transformer/package.json +5 -5
- package/node_modules/@aws-amplify/graphql-searchable-transformer/CHANGELOG.md +0 -4
- package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/streaming-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-searchable-transformer/package.json +4 -4
- package/node_modules/@aws-amplify/graphql-sql-transformer/CHANGELOG.md +0 -4
- package/node_modules/@aws-amplify/graphql-sql-transformer/package.json +4 -4
- package/node_modules/@aws-amplify/graphql-transformer/CHANGELOG.md +3 -5
- package/node_modules/@aws-amplify/graphql-transformer/package.json +17 -17
- package/node_modules/@aws-amplify/graphql-transformer-core/CHANGELOG.md +0 -4
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/ai/json-schema.d.ts +1 -4
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/ai/json-schema.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/package.json +1 -1
- package/package.json +18 -18
package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/tools/process-tools.js
CHANGED
@@ -16,7 +16,16 @@ const processTools = (toolDefinitions, ctx) => {
|
|
16
16
|
if (!queryType.fields || queryType.fields.length === 0) {
|
17
17
|
throw new graphql_transformer_core_1.InvalidDirectiveError('Tools must be queries - no queries found in the schema');
|
18
18
|
}
|
19
|
-
const tools = toolDefinitions.map((toolDefinition) =>
|
19
|
+
const tools = toolDefinitions.map((toolDefinition) => {
|
20
|
+
var _a;
|
21
|
+
const { name: toolName, description } = toolDefinition;
|
22
|
+
const queryName = (0, exports.isModelOperationToolPredicate)(toolDefinition) ? modelListQueryName(toolDefinition, ctx) : toolDefinition.queryName;
|
23
|
+
const queryField = (_a = queryType.fields) === null || _a === void 0 ? void 0 : _a.find((field) => field.name.value === queryName);
|
24
|
+
if (!queryField) {
|
25
|
+
throw new graphql_transformer_core_1.InvalidDirectiveError(`Tool "${toolName}" defined in @conversation directive has no matching Query field definition`);
|
26
|
+
}
|
27
|
+
return createTool({ toolName, description, queryField, ctx });
|
28
|
+
});
|
20
29
|
return tools;
|
21
30
|
};
|
22
31
|
exports.processTools = processTools;
|
@@ -54,21 +63,11 @@ const getObjectTypeFromName = (name, ctx) => {
|
|
54
63
|
return node;
|
55
64
|
};
|
56
65
|
const createTool = (input) => {
|
57
|
-
|
58
|
-
const {
|
59
|
-
const
|
60
|
-
const queryField = (_a = queryType.fields) === null || _a === void 0 ? void 0 : _a.find((field) => field.name.value === queryName);
|
61
|
-
if (!queryField) {
|
62
|
-
throw new graphql_transformer_core_1.InvalidDirectiveError(`Tool "${toolDefinition.name}" defined in @conversation directive has no matching Query field definition`);
|
63
|
-
}
|
64
|
-
const { name: toolName, description } = toolDefinition;
|
65
|
-
const { type: returnType, arguments: queryFieldArguments } = queryField;
|
66
|
-
const fieldArguments = (0, exports.isModelOperationToolPredicate)(toolDefinition)
|
67
|
-
? queryFieldArguments === null || queryFieldArguments === void 0 ? void 0 : queryFieldArguments.filter((arg) => arg.name.value !== 'limit' && arg.name.value !== 'nextToken')
|
68
|
-
: queryFieldArguments;
|
69
|
-
const toolSchema = generateToolProperties(fieldArguments, ctx);
|
66
|
+
const { toolName, description, queryField, ctx } = input;
|
67
|
+
const { type: returnType, arguments: fieldArguments } = queryField;
|
68
|
+
const { properties, required } = generateToolProperties(fieldArguments, ctx, toolName, returnType);
|
70
69
|
const selectionSet = generateSelectionSet(returnType, ctx).trim();
|
71
|
-
const propertyTypes = generatePropertyTypes(fieldArguments);
|
70
|
+
const propertyTypes = generatePropertyTypes(fieldArguments, toolName, returnType);
|
72
71
|
const graphqlRequestInputDescriptor = {
|
73
72
|
selectionSet,
|
74
73
|
propertyTypes,
|
@@ -80,38 +79,36 @@ const createTool = (input) => {
|
|
80
79
|
inputSchema: {
|
81
80
|
json: {
|
82
81
|
type: 'object',
|
83
|
-
|
82
|
+
properties,
|
83
|
+
required,
|
84
84
|
},
|
85
85
|
},
|
86
86
|
graphqlRequestInputDescriptor,
|
87
87
|
};
|
88
88
|
};
|
89
|
-
const generateToolProperties = (fieldArguments, ctx) => {
|
89
|
+
const generateToolProperties = (fieldArguments, ctx, toolName, returnType) => {
|
90
90
|
if (!fieldArguments || fieldArguments.length === 0) {
|
91
91
|
return { properties: {}, required: [] };
|
92
92
|
}
|
93
|
-
|
93
|
+
if (isModelListOperation(toolName, returnType)) {
|
94
|
+
return { properties: {}, required: [] };
|
95
|
+
}
|
96
|
+
return fieldArguments.reduce((acc, fieldArgument) => {
|
94
97
|
const fieldArgumentSchema = (0, graphql_json_schema_type_1.generateJSONSchemaFromTypeNode)(fieldArgument.type, ctx);
|
95
|
-
if (!fieldArgumentSchema)
|
96
|
-
return acc;
|
97
|
-
if (fieldArgumentSchema.$defs) {
|
98
|
-
acc.$defs = { ...acc.$defs, ...fieldArgumentSchema.$defs };
|
99
|
-
delete fieldArgumentSchema.$defs;
|
100
|
-
}
|
101
|
-
acc.properties = acc.properties || {};
|
102
98
|
acc.properties[fieldArgument.name.value] = fieldArgumentSchema;
|
103
|
-
if (
|
104
|
-
acc.required = acc.required || [];
|
99
|
+
if (fieldArgument.type.kind === 'NonNullType') {
|
105
100
|
acc.required.push(fieldArgument.name.value);
|
106
101
|
}
|
107
102
|
return acc;
|
108
|
-
}, {});
|
109
|
-
return filterSchema;
|
103
|
+
}, { properties: {}, required: [] });
|
110
104
|
};
|
111
|
-
const generatePropertyTypes = (fieldArguments) => {
|
105
|
+
const generatePropertyTypes = (fieldArguments, toolName, returnType) => {
|
112
106
|
if (!fieldArguments || fieldArguments.length === 0) {
|
113
107
|
return {};
|
114
108
|
}
|
109
|
+
if (isModelListOperation(toolName, returnType)) {
|
110
|
+
return {};
|
111
|
+
}
|
115
112
|
return fieldArguments.reduce((acc, fieldArgument) => {
|
116
113
|
const name = fieldArgument.name.value;
|
117
114
|
const suffix = (0, graphql_transformer_common_1.isNonNullType)(fieldArgument.type) ? '!' : '';
|
@@ -119,6 +116,9 @@ const generatePropertyTypes = (fieldArguments) => {
|
|
119
116
|
return acc;
|
120
117
|
}, {});
|
121
118
|
};
|
119
|
+
const isModelListOperation = (toolName, responseType) => {
|
120
|
+
return (0, graphql_transformer_common_1.getBaseType)(responseType).startsWith('Model') && toolName.startsWith('list');
|
121
|
+
};
|
122
122
|
const modelListQueryName = (modelTool, ctx) => {
|
123
123
|
var _a, _b, _c;
|
124
124
|
const { modelName } = modelTool;
|
package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/tools/process-tools.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"process-tools.js","sourceRoot":"","sources":["../../src/tools/process-tools.ts"],"names":[],"mappings":";;;AAAA,oFAA2G;AAU3G,
|
1
|
+
{"version":3,"file":"process-tools.js","sourceRoot":"","sources":["../../src/tools/process-tools.ts"],"names":[],"mappings":";;;AAAA,oFAA2G;AAU3G,2EAA2F;AAG3F,yEAA4E;AAWrE,MAAM,6BAA6B,GAAG,CAAC,IAAoB,EAA8B,EAAE,CAChG,IAAI,CAAC,SAAS,KAAK,SAAS,IAAI,IAAI,CAAC,cAAc,KAAK,SAAS,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC;AADvF,QAAA,6BAA6B,iCAC0D;AAE7F,MAAM,0BAA0B,GAAG,CAAC,IAAoB,EAA2B,EAAE,CAC1F,IAAI,CAAC,SAAS,KAAK,SAAS,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,IAAI,IAAI,CAAC,cAAc,KAAK,SAAS,CAAC;AADvF,QAAA,0BAA0B,8BAC6D;AAgB7F,MAAM,YAAY,GAAG,CAAC,eAAiC,EAAE,GAA+B,EAAsB,EAAE;IAErH,IAAI,CAAC,eAAe,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE;QACpD,OAAO,SAAS,CAAC;KAClB;IAGD,MAAM,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAA6B,CAAC;IAC1E,IAAI,CAAC,SAAS,CAAC,MAAM,IAAI,SAA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5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -26,10 +26,10 @@
|
|
26
26
|
"dependencies": {
|
27
27
|
"@aws-amplify/ai-constructs": "^0.8.1",
|
28
28
|
"@aws-amplify/graphql-directives": "2.6.0",
|
29
|
-
"@aws-amplify/graphql-index-transformer": "3.0.
|
30
|
-
"@aws-amplify/graphql-model-transformer": "3.1.
|
31
|
-
"@aws-amplify/graphql-relational-transformer": "3.1.
|
32
|
-
"@aws-amplify/graphql-transformer-core": "3.3.
|
29
|
+
"@aws-amplify/graphql-index-transformer": "3.0.9",
|
30
|
+
"@aws-amplify/graphql-model-transformer": "3.1.1",
|
31
|
+
"@aws-amplify/graphql-relational-transformer": "3.1.1",
|
32
|
+
"@aws-amplify/graphql-transformer-core": "3.3.1",
|
33
33
|
"@aws-amplify/graphql-transformer-interfaces": "4.2.0",
|
34
34
|
"@aws-amplify/plugin-types": "^1.0.0",
|
35
35
|
"graphql": "^15.5.0",
|
@@ -39,7 +39,7 @@
|
|
39
39
|
"semver": "^7.6.3"
|
40
40
|
},
|
41
41
|
"devDependencies": {
|
42
|
-
"@aws-amplify/graphql-transformer-test-utils": "1.0.
|
42
|
+
"@aws-amplify/graphql-transformer-test-utils": "1.0.8",
|
43
43
|
"esbuild": "^0.24.0"
|
44
44
|
},
|
45
45
|
"peerDependencies": {
|
@@ -82,5 +82,5 @@
|
|
82
82
|
"/__tests__/"
|
83
83
|
]
|
84
84
|
},
|
85
|
-
"gitHead": "
|
85
|
+
"gitHead": "4985ac3451b492bc5fd36d9cb33bf70d9985b24b"
|
86
86
|
}
|
@@ -3,10 +3,6 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
-
## [3.1.5-ai-next.0](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-default-value-transformer@3.1.4...@aws-amplify/graphql-default-value-transformer@3.1.5-ai-next.0) (2024-11-15)
|
7
|
-
|
8
|
-
**Note:** Version bump only for package @aws-amplify/graphql-default-value-transformer
|
9
|
-
|
10
6
|
## [3.1.4](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-default-value-transformer@3.1.3...@aws-amplify/graphql-default-value-transformer@3.1.4) (2024-11-14)
|
11
7
|
|
12
8
|
**Note:** Version bump only for package @aws-amplify/graphql-default-value-transformer
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@aws-amplify/graphql-default-value-transformer",
|
3
|
-
"version": "3.1.
|
3
|
+
"version": "3.1.4",
|
4
4
|
"description": "Amplify GraphQL default value transformer",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -31,7 +31,7 @@
|
|
31
31
|
},
|
32
32
|
"dependencies": {
|
33
33
|
"@aws-amplify/graphql-directives": "2.6.0",
|
34
|
-
"@aws-amplify/graphql-transformer-core": "3.3.
|
34
|
+
"@aws-amplify/graphql-transformer-core": "3.3.1",
|
35
35
|
"@aws-amplify/graphql-transformer-interfaces": "4.2.0",
|
36
36
|
"graphql": "^15.5.0",
|
37
37
|
"graphql-mapping-template": "5.0.1",
|
@@ -39,8 +39,8 @@
|
|
39
39
|
"libphonenumber-js": "1.9.47"
|
40
40
|
},
|
41
41
|
"devDependencies": {
|
42
|
-
"@aws-amplify/graphql-model-transformer": "3.1.
|
43
|
-
"@aws-amplify/graphql-transformer-test-utils": "1.0.
|
42
|
+
"@aws-amplify/graphql-model-transformer": "3.1.1",
|
43
|
+
"@aws-amplify/graphql-transformer-test-utils": "1.0.8"
|
44
44
|
},
|
45
45
|
"jest": {
|
46
46
|
"transform": {
|
@@ -3,10 +3,6 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
-
## [3.1.7-ai-next.0](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-function-transformer@3.1.6...@aws-amplify/graphql-function-transformer@3.1.7-ai-next.0) (2024-11-15)
|
7
|
-
|
8
|
-
**Note:** Version bump only for package @aws-amplify/graphql-function-transformer
|
9
|
-
|
10
6
|
## [3.1.6](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-function-transformer@3.1.5...@aws-amplify/graphql-function-transformer@3.1.6) (2024-11-14)
|
11
7
|
|
12
8
|
**Note:** Version bump only for package @aws-amplify/graphql-function-transformer
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@aws-amplify/graphql-function-transformer",
|
3
|
-
"version": "3.1.
|
3
|
+
"version": "3.1.6",
|
4
4
|
"description": "Amplify GraphQL @function transformer",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -30,14 +30,14 @@
|
|
30
30
|
},
|
31
31
|
"dependencies": {
|
32
32
|
"@aws-amplify/graphql-directives": "2.6.0",
|
33
|
-
"@aws-amplify/graphql-transformer-core": "3.3.
|
33
|
+
"@aws-amplify/graphql-transformer-core": "3.3.1",
|
34
34
|
"@aws-amplify/graphql-transformer-interfaces": "4.2.0",
|
35
35
|
"graphql": "^15.5.0",
|
36
36
|
"graphql-mapping-template": "5.0.1",
|
37
37
|
"graphql-transformer-common": "5.1.1"
|
38
38
|
},
|
39
39
|
"devDependencies": {
|
40
|
-
"@aws-amplify/graphql-transformer-test-utils": "1.0.
|
40
|
+
"@aws-amplify/graphql-transformer-test-utils": "1.0.8"
|
41
41
|
},
|
42
42
|
"peerDependencies": {
|
43
43
|
"aws-cdk-lib": "^2.158.0",
|
@@ -3,9 +3,15 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
-
|
6
|
+
# [1.1.0](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-generation-transformer@0.2.7...@aws-amplify/graphql-generation-transformer@1.1.0) (2024-11-19)
|
7
7
|
|
8
|
-
|
8
|
+
### Bug Fixes
|
9
|
+
|
10
|
+
- **ai:** forward user-agent with package metadata in generation and conversation requests ([#3029](https://github.com/aws-amplify/amplify-category-api/issues/3029)) ([9a0ac8b](https://github.com/aws-amplify/amplify-category-api/commit/9a0ac8bb1d6b554bc3f93a0450763a07b8d8f0dd))
|
11
|
+
|
12
|
+
### Features
|
13
|
+
|
14
|
+
- bump conversation and generation transformers to v1 ([#3030](https://github.com/aws-amplify/amplify-category-api/issues/3030)) ([1d9e59e](https://github.com/aws-amplify/amplify-category-api/commit/1d9e59ed5d2130780a5d75db4e48b2c86df9e8e3))
|
9
15
|
|
10
16
|
## [0.2.7](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-generation-transformer@0.2.6...@aws-amplify/graphql-generation-transformer@0.2.7) (2024-11-14)
|
11
17
|
|
@@ -0,0 +1,201 @@
|
|
1
|
+
Apache License
|
2
|
+
Version 2.0, January 2004
|
3
|
+
http://www.apache.org/licenses/
|
4
|
+
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
+
|
7
|
+
1. Definitions.
|
8
|
+
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
+
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
+
the copyright owner that is granting the License.
|
14
|
+
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
+
other entities that control, are controlled by, or are under common
|
17
|
+
control with that entity. For the purposes of this definition,
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
19
|
+
direction or management of such entity, whether by contract or
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
+
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
+
exercising permissions granted by this License.
|
25
|
+
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
27
|
+
including but not limited to software source code, documentation
|
28
|
+
source, and configuration files.
|
29
|
+
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
31
|
+
transformation or translation of a Source form, including but
|
32
|
+
not limited to compiled object code, generated documentation,
|
33
|
+
and conversions to other media types.
|
34
|
+
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
36
|
+
Object form, made available under the License, as indicated by a
|
37
|
+
copyright notice that is included in or attached to the work
|
38
|
+
(an example is provided in the Appendix below).
|
39
|
+
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
+
the Work and Derivative Works thereof.
|
47
|
+
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
49
|
+
the original version of the Work and any modifications or additions
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
+
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
64
|
+
subsequently incorporated within the Work.
|
65
|
+
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
72
|
+
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
+
where such license applies only to those patent claims licensable
|
79
|
+
by such Contributor that are necessarily infringed by their
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
82
|
+
institute patent litigation against any entity (including a
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
85
|
+
or contributory patent infringement, then any patent licenses
|
86
|
+
granted to You under this License for that Work shall terminate
|
87
|
+
as of the date such litigation is filed.
|
88
|
+
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
91
|
+
modifications, and in Source or Object form, provided that You
|
92
|
+
meet the following conditions:
|
93
|
+
|
94
|
+
(a) You must give any other recipients of the Work or
|
95
|
+
Derivative Works a copy of this License; and
|
96
|
+
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
98
|
+
stating that You changed the files; and
|
99
|
+
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
102
|
+
attribution notices from the Source form of the Work,
|
103
|
+
excluding those notices that do not pertain to any part of
|
104
|
+
the Derivative Works; and
|
105
|
+
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
108
|
+
include a readable copy of the attribution notices contained
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
111
|
+
of the following places: within a NOTICE text file distributed
|
112
|
+
as part of the Derivative Works; within the Source form or
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
114
|
+
within a display generated by the Derivative Works, if and
|
115
|
+
wherever such third-party notices normally appear. The contents
|
116
|
+
of the NOTICE file are for informational purposes only and
|
117
|
+
do not modify the License. You may add Your own attribution
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
120
|
+
that such additional attribution notices cannot be construed
|
121
|
+
as modifying the License.
|
122
|
+
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
124
|
+
may provide additional or different license terms and conditions
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
128
|
+
the conditions stated in this License.
|
129
|
+
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
133
|
+
this License, without any additional terms or conditions.
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
+
the terms of any separate license agreement you may have executed
|
136
|
+
with Licensor regarding such Contributions.
|
137
|
+
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
140
|
+
except as required for reasonable and customary use in describing the
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
+
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
152
|
+
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
158
|
+
incidental, or consequential damages of any character arising as a
|
159
|
+
result of this License or out of the use or inability to use the
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
162
|
+
other commercial damages or losses), even if such Contributor
|
163
|
+
has been advised of the possibility of such damages.
|
164
|
+
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
+
or other liability obligations and/or rights consistent with this
|
169
|
+
License. However, in accepting such obligations, You may act only
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
174
|
+
of your accepting any such warranty or additional liability.
|
175
|
+
|
176
|
+
END OF TERMS AND CONDITIONS
|
177
|
+
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
179
|
+
|
180
|
+
To apply the Apache License to your work, attach the following
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
182
|
+
replaced with your own identifying information. (Don't include
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
184
|
+
comment syntax for the file format. We also recommend that a
|
185
|
+
file or class name and description of purpose be included on the
|
186
|
+
same "printed page" as the copyright notice for easier
|
187
|
+
identification within third-party archives.
|
188
|
+
|
189
|
+
Copyright 2017 - 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
190
|
+
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
+
you may not use this file except in compliance with the License.
|
193
|
+
You may obtain a copy of the License at
|
194
|
+
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
196
|
+
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
+
See the License for the specific language governing permissions and
|
201
|
+
limitations under the License.
|
@@ -5,12 +5,16 @@ export function request(ctx) {
|
|
5
5
|
const prompt = [[SYSTEM_PROMPT]];
|
6
6
|
const args = JSON.stringify(ctx.args);
|
7
7
|
const inferenceConfig = [[INFERENCE_CONFIG]];
|
8
|
+
const userAgent = createUserAgent(ctx.request);
|
8
9
|
|
9
10
|
return {
|
10
11
|
resourcePath: '/model/[[AI_MODEL]]/converse',
|
11
12
|
method: 'POST',
|
12
13
|
params: {
|
13
|
-
headers: {
|
14
|
+
headers: {
|
15
|
+
'Content-Type': 'application/json',
|
16
|
+
'x-amz-user-agent': userAgent,
|
17
|
+
},
|
14
18
|
body: {
|
15
19
|
messages: [
|
16
20
|
{
|
@@ -58,3 +62,14 @@ export function response(ctx) {
|
|
58
62
|
[[NON_STRING_RESPONSE_HANDLING]]
|
59
63
|
return value;
|
60
64
|
}
|
65
|
+
|
66
|
+
function createUserAgent(request) {
|
67
|
+
const packageMetadata = [[PACKAGE_METADATA]];
|
68
|
+
let userAgent = request.headers['x-amz-user-agent'];
|
69
|
+
if (userAgent) {
|
70
|
+
userAgent = `${userAgent} md/${packageMetadata}`;
|
71
|
+
} else {
|
72
|
+
userAgent = `lib/${packageMetadata}`;
|
73
|
+
}
|
74
|
+
return userAgent;
|
75
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"invoke-bedrock.d.ts","sourceRoot":"","sources":["../../src/resolvers/invoke-bedrock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,qCAAqC,EAA0B,MAAM,mCAAmC,CAAC;
|
1
|
+
{"version":3,"file":"invoke-bedrock.d.ts","sourceRoot":"","sources":["../../src/resolvers/invoke-bedrock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,qCAAqC,EAA0B,MAAM,mCAAmC,CAAC;AAclH,eAAO,MAAM,mCAAmC,WAAY,qCAAqC,KAAG,uBA4BnG,CAAC"}
|
package/node_modules/@aws-amplify/graphql-generation-transformer/lib/resolvers/invoke-bedrock.js
CHANGED
@@ -8,6 +8,8 @@ const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-cor
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
9
9
|
const path_1 = __importDefault(require("path"));
|
10
10
|
const graphql_transformer_common_1 = require("graphql-transformer-common");
|
11
|
+
const packageName = 'amplify-graphql-generation-transformer';
|
12
|
+
const packageVersion = require('../../package.json').version;
|
11
13
|
const createInvokeBedrockResolverFunction = (config) => {
|
12
14
|
const { aiModel, toolConfig, inferenceConfiguration, field } = config;
|
13
15
|
const AI_MODEL = aiModel;
|
@@ -21,12 +23,14 @@ const createInvokeBedrockResolverFunction = (config) => {
|
|
21
23
|
if (typeof value === 'string') {
|
22
24
|
return JSON.parse(value);
|
23
25
|
}`;
|
26
|
+
const PACKAGE_METADATA = `'${packageName}#${packageVersion}'`;
|
24
27
|
const resolver = generateResolver('invoke-bedrock-resolver-fn.template.js', {
|
25
28
|
AI_MODEL,
|
26
29
|
TOOL_CONFIG,
|
27
30
|
SYSTEM_PROMPT,
|
28
31
|
INFERENCE_CONFIG,
|
29
32
|
NON_STRING_RESPONSE_HANDLING,
|
33
|
+
PACKAGE_METADATA,
|
30
34
|
});
|
31
35
|
const templateName = `${field.name.value}-invoke-bedrock-fn`;
|
32
36
|
return graphql_transformer_core_1.MappingTemplate.s3MappingFunctionCodeFromString(resolver, templateName);
|
package/node_modules/@aws-amplify/graphql-generation-transformer/lib/resolvers/invoke-bedrock.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"invoke-bedrock.js","sourceRoot":"","sources":["../../src/resolvers/invoke-bedrock.ts"],"names":[],"mappings":";;;;;;AAAA,oFAAwE;AAGxE,4CAAoB;AACpB,gDAAwB;AACxB,2EAAyD;
|
1
|
+
{"version":3,"file":"invoke-bedrock.js","sourceRoot":"","sources":["../../src/resolvers/invoke-bedrock.ts"],"names":[],"mappings":";;;;;;AAAA,oFAAwE;AAGxE,4CAAoB;AACpB,gDAAwB;AACxB,2EAAyD;AAEzD,MAAM,WAAW,GAAG,wCAAwC,CAAC;AAC7D,MAAM,cAAc,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC;AAQtD,MAAM,mCAAmC,GAAG,CAAC,MAA6C,EAA2B,EAAE;IAC5H,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;IACtE,MAAM,QAAQ,GAAG,OAAO,CAAC;IACzB,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAC/C,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAC1D,MAAM,gBAAgB,GAAG,oCAAoC,CAAC,sBAAsB,CAAC,CAAC;IAEtF,MAAM,4BAA4B,GAAG,sBAAsB,CAAC,QAAQ,CAAC,IAAA,wCAAW,EAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAClG,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC;;;;IAIF,CAAC;IAEH,MAAM,gBAAgB,GAAG,IAAI,WAAW,IAAI,cAAc,GAAG,CAAC;IAE9D,MAAM,QAAQ,GAAG,gBAAgB,CAAC,wCAAwC,EAAE;QAC1E,QAAQ;QACR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|
3
|
+
"version": "1.1.0",
|
4
4
|
"description": "Amplify GraphQL @generation transformer",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -25,7 +25,7 @@
|
|
25
25
|
},
|
26
26
|
"dependencies": {
|
27
27
|
"@aws-amplify/graphql-directives": "2.6.0",
|
28
|
-
"@aws-amplify/graphql-transformer-core": "3.3.
|
28
|
+
"@aws-amplify/graphql-transformer-core": "3.3.1",
|
29
29
|
"@aws-amplify/graphql-transformer-interfaces": "4.2.0",
|
30
30
|
"graphql": "^15.5.0",
|
31
31
|
"graphql-mapping-template": "5.0.1",
|
@@ -33,7 +33,7 @@
|
|
33
33
|
"immer": "^9.0.12"
|
34
34
|
},
|
35
35
|
"devDependencies": {
|
36
|
-
"@aws-amplify/graphql-transformer-test-utils": "1.0.
|
36
|
+
"@aws-amplify/graphql-transformer-test-utils": "1.0.8"
|
37
37
|
},
|
38
38
|
"peerDependencies": {
|
39
39
|
"aws-cdk-lib": "^2.158.0",
|
@@ -74,5 +74,6 @@
|
|
74
74
|
"coveragePathIgnorePatterns": [
|
75
75
|
"/__tests__/"
|
76
76
|
]
|
77
|
-
}
|
77
|
+
},
|
78
|
+
"gitHead": "4985ac3451b492bc5fd36d9cb33bf70d9985b24b"
|
78
79
|
}
|
@@ -3,10 +3,6 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
-
## [3.0.10-ai-next.0](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-http-transformer@3.0.9...@aws-amplify/graphql-http-transformer@3.0.10-ai-next.0) (2024-11-15)
|
7
|
-
|
8
|
-
**Note:** Version bump only for package @aws-amplify/graphql-http-transformer
|
9
|
-
|
10
6
|
## [3.0.9](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-http-transformer@3.0.8...@aws-amplify/graphql-http-transformer@3.0.9) (2024-11-14)
|
11
7
|
|
12
8
|
**Note:** Version bump only for package @aws-amplify/graphql-http-transformer
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@aws-amplify/graphql-http-transformer",
|
3
|
-
"version": "3.0.
|
3
|
+
"version": "3.0.9",
|
4
4
|
"description": "Amplify GraphQL @http transformer",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -30,14 +30,14 @@
|
|
30
30
|
},
|
31
31
|
"dependencies": {
|
32
32
|
"@aws-amplify/graphql-directives": "2.6.0",
|
33
|
-
"@aws-amplify/graphql-transformer-core": "3.3.
|
33
|
+
"@aws-amplify/graphql-transformer-core": "3.3.1",
|
34
34
|
"@aws-amplify/graphql-transformer-interfaces": "4.2.0",
|
35
35
|
"graphql": "^15.5.0",
|
36
36
|
"graphql-mapping-template": "5.0.1",
|
37
37
|
"graphql-transformer-common": "5.1.1"
|
38
38
|
},
|
39
39
|
"devDependencies": {
|
40
|
-
"@aws-amplify/graphql-transformer-test-utils": "1.0.
|
40
|
+
"@aws-amplify/graphql-transformer-test-utils": "1.0.8"
|
41
41
|
},
|
42
42
|
"peerDependencies": {
|
43
43
|
"aws-cdk-lib": "^2.158.0",
|
@@ -3,10 +3,6 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
-
## [3.0.10-ai-next.0](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-index-transformer@3.0.9...@aws-amplify/graphql-index-transformer@3.0.10-ai-next.0) (2024-11-15)
|
7
|
-
|
8
|
-
**Note:** Version bump only for package @aws-amplify/graphql-index-transformer
|
9
|
-
|
10
6
|
## [3.0.9](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-index-transformer@3.0.8...@aws-amplify/graphql-index-transformer@3.0.9) (2024-11-14)
|
11
7
|
|
12
8
|
**Note:** Version bump only for package @aws-amplify/graphql-index-transformer
|