@aws-amplify/data-schema 1.13.2 → 1.13.4

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 (29) hide show
  1. package/dist/cjs/SchemaProcessor.js +4 -3
  2. package/dist/cjs/SchemaProcessor.js.map +1 -1
  3. package/dist/cjs/ai/ConversationSchemaGraphQLTypes.js +190 -0
  4. package/dist/cjs/ai/ConversationSchemaGraphQLTypes.js.map +1 -0
  5. package/dist/cjs/ai/ConversationSchemaProcessor.js +52 -0
  6. package/dist/cjs/ai/ConversationSchemaProcessor.js.map +1 -0
  7. package/dist/esm/Authorization.d.ts +3 -0
  8. package/dist/esm/SchemaProcessor.mjs +3 -2
  9. package/dist/esm/SchemaProcessor.mjs.map +1 -1
  10. package/dist/esm/ai/ConversationSchemaGraphQLTypes.d.ts +1 -0
  11. package/dist/esm/ai/ConversationSchemaGraphQLTypes.mjs +188 -0
  12. package/dist/esm/ai/ConversationSchemaGraphQLTypes.mjs.map +1 -0
  13. package/dist/esm/ai/ConversationSchemaProcessor.d.ts +6 -0
  14. package/dist/esm/ai/ConversationSchemaProcessor.mjs +50 -0
  15. package/dist/esm/ai/ConversationSchemaProcessor.mjs.map +1 -0
  16. package/dist/esm/index.d.ts +1 -1
  17. package/dist/meta/cjs.tsbuildinfo +1 -1
  18. package/package.json +1 -1
  19. package/src/Authorization.ts +3 -0
  20. package/src/SchemaProcessor.ts +3 -5
  21. package/src/ai/ConversationSchemaGraphQLTypes.ts +185 -0
  22. package/src/ai/ConversationSchemaProcessor.ts +63 -0
  23. package/src/index.ts +1 -1
  24. package/dist/cjs/ai/ConversationSchemaTypes.js +0 -239
  25. package/dist/cjs/ai/ConversationSchemaTypes.js.map +0 -1
  26. package/dist/esm/ai/ConversationSchemaTypes.d.ts +0 -7
  27. package/dist/esm/ai/ConversationSchemaTypes.mjs +0 -237
  28. package/dist/esm/ai/ConversationSchemaTypes.mjs.map +0 -1
  29. package/src/ai/ConversationSchemaTypes.ts +0 -286
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/data-schema",
3
- "version": "1.13.2",
3
+ "version": "1.13.4",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -93,6 +93,9 @@ export type SchemaAuthorization<
93
93
  | Authorization<AuthStrategy, AuthField, AuthFieldPlurality>
94
94
  | ResourceAuthorization;
95
95
 
96
+ /**
97
+ * Container for representing the authorization of function resources
98
+ */
96
99
  export type ResourceAuthorization = {
97
100
  [__data]: ResourceAuthorizationData;
98
101
  };
@@ -54,10 +54,8 @@ import {
54
54
  brandName as conversationBrandName,
55
55
  type InternalConversationType,
56
56
  } from './ai/ConversationType';
57
- import {
58
- conversationTypes,
59
- createConversationField,
60
- } from './ai/ConversationSchemaTypes';
57
+ import { CONVERSATION_SCHEMA_GRAPHQL_TYPES } from './ai/ConversationSchemaGraphQLTypes';
58
+ import { createConversationField } from './ai/ConversationSchemaProcessor';
61
59
 
62
60
  type ScalarFieldDef = Exclude<InternalField['data'], { fieldType: 'model' }>;
63
61
 
@@ -1626,7 +1624,7 @@ const schemaPreprocessor = (
1626
1624
 
1627
1625
  gqlModels.push(...generateCustomOperationTypes(customOperations));
1628
1626
  if (shouldAddConversationTypes) {
1629
- gqlModels.push(...conversationTypes);
1627
+ gqlModels.push(CONVERSATION_SCHEMA_GRAPHQL_TYPES);
1630
1628
  }
1631
1629
 
1632
1630
  const processedSchema = gqlModels.join('\n\n');
@@ -0,0 +1,185 @@
1
+ export const CONVERSATION_SCHEMA_GRAPHQL_TYPES =
2
+ /* GraphQL */ `enum ConversationParticipantRole {
3
+ user
4
+ assistant
5
+ }
6
+
7
+ interface ConversationMessage {
8
+ id: ID!
9
+ conversationId: ID!
10
+ associatedUserMessageId: ID
11
+ role: ConversationParticipantRole
12
+ content: [ContentBlock]
13
+ aiContext: AWSJSON
14
+ toolConfiguration: ToolConfiguration
15
+ createdAt: AWSDateTime
16
+ updatedAt: AWSDateTime
17
+ owner: String
18
+ }
19
+
20
+ input DocumentBlockSourceInput {
21
+ bytes: String
22
+ }
23
+
24
+ input DocumentBlockInput {
25
+ format: String!
26
+ name: String!
27
+ source: DocumentBlockSourceInput!
28
+ }
29
+
30
+ input ImageBlockSourceInput {
31
+ bytes: String
32
+ }
33
+
34
+ input ImageBlockInput {
35
+ format: String!
36
+ source: ImageBlockSourceInput!
37
+ }
38
+
39
+ input ToolUseBlockInput {
40
+ toolUseId: String!
41
+ name: String!
42
+ input: AWSJSON!
43
+ }
44
+
45
+ input ToolResultContentBlockInput {
46
+ document: DocumentBlockInput
47
+ image: ImageBlockInput
48
+ json: AWSJSON
49
+ text: String
50
+ }
51
+
52
+ input ToolResultBlockInput {
53
+ content: [ToolResultContentBlockInput!]!
54
+ toolUseId: String!
55
+ status: String
56
+ }
57
+
58
+ type DocumentBlockSource {
59
+ bytes: String
60
+ }
61
+
62
+ type DocumentBlock {
63
+ format: String!
64
+ name: String!
65
+ source: DocumentBlockSource!
66
+ }
67
+
68
+ type ImageBlock {
69
+ format: String!
70
+ source: ImageBlockSource!
71
+ }
72
+
73
+ type ImageBlockSource {
74
+ bytes: String
75
+ }
76
+
77
+ type ToolUseBlock {
78
+ toolUseId: String!
79
+ name: String!
80
+ input: AWSJSON!
81
+ }
82
+
83
+ type ToolResultContentBlock {
84
+ document: DocumentBlock
85
+ image: ImageBlock
86
+ json: AWSJSON
87
+ text: String
88
+ }
89
+
90
+ type ToolResultBlock {
91
+ content: [ToolResultContentBlock!]!
92
+ toolUseId: String!
93
+ status: String
94
+ }
95
+
96
+ type ContentBlockText {
97
+ text: String
98
+ }
99
+
100
+ type ContentBlockImage {
101
+ image: ImageBlock
102
+ }
103
+
104
+ type ContentBlockDocument {
105
+ document: DocumentBlock
106
+ }
107
+
108
+ type ContentBlockToolUse {
109
+ toolUse: ToolUseBlock
110
+ }
111
+
112
+ type ContentBlockToolResult {
113
+ toolResult: ToolResultBlock
114
+ }
115
+
116
+ input ContentBlockInput {
117
+ text: String
118
+ document: DocumentBlockInput
119
+ image: ImageBlockInput
120
+ toolResult: ToolResultBlockInput
121
+ toolUse: ToolUseBlockInput
122
+ }
123
+
124
+ type ContentBlock {
125
+ text: String
126
+ document: DocumentBlock
127
+ image: ImageBlock
128
+ toolResult: ToolResultBlock
129
+ toolUse: ToolUseBlock
130
+ }
131
+
132
+ input ToolConfigurationInput {
133
+ tools: [ToolInput]
134
+ }
135
+
136
+ input ToolInput {
137
+ toolSpec: ToolSpecificationInput
138
+ }
139
+
140
+ input ToolSpecificationInput {
141
+ name: String!
142
+ description: String
143
+ inputSchema: ToolInputSchemaInput!
144
+ }
145
+
146
+ input ToolInputSchemaInput {
147
+ json: AWSJSON
148
+ }
149
+
150
+ type ToolConfiguration {
151
+ tools: [Tool]
152
+ }
153
+
154
+ type Tool {
155
+ toolSpec: ToolSpecification
156
+ }
157
+
158
+ type ToolSpecification {
159
+ name: String!
160
+ description: String
161
+ inputSchema: ToolInputSchema!
162
+ }
163
+
164
+ type ToolInputSchema {
165
+ json: AWSJSON
166
+ }
167
+
168
+ type ConversationMessageStreamPart @aws_cognito_user_pools {
169
+ id: ID!
170
+ owner: String
171
+ conversationId: ID!
172
+ associatedUserMessageId: ID!
173
+ contentBlockIndex: Int
174
+ contentBlockText: String
175
+ contentBlockDeltaIndex: Int
176
+ contentBlockToolUse: ToolUseBlock
177
+ contentBlockDoneAtIndex: Int
178
+ stopReason: String
179
+ errors: [ConversationTurnError]
180
+ }
181
+
182
+ type ConversationTurnError @aws_cognito_user_pools {
183
+ message: String!
184
+ errorType: String!
185
+ }`;
@@ -0,0 +1,63 @@
1
+ import { LambdaFunctionDefinition } from "@aws-amplify/data-schema-types";
2
+ import { InternalRef } from "../RefType";
3
+ import { capitalize } from "../runtime/utils";
4
+ import { InternalConversationType, ToolDefinition } from "./ConversationType";
5
+
6
+ export const createConversationField = (
7
+ typeDef: InternalConversationType,
8
+ typeName: string,
9
+ ): { field: string, functionHandler: LambdaFunctionDefinition } => {
10
+ const { aiModel, systemPrompt, handler, tools } = typeDef;
11
+
12
+ const args: Record<string, string> = {
13
+ aiModel: aiModel.resourcePath,
14
+ // This is done to escape newlines in potentially multi-line system prompts
15
+ // e.g.
16
+ // realtorChat: a.conversation({
17
+ // aiModel: a.ai.model('Claude 3 Haiku'),
18
+ // systemPrompt: `You are a helpful real estate assistant
19
+ // Respond in the poetic form of haiku.`,
20
+ // }),
21
+ //
22
+ // It doesn't affect non multi-line string inputs for system prompts
23
+ systemPrompt: systemPrompt.replace(/\r?\n/g, '\\n'),
24
+ };
25
+
26
+ const argsString = Object.entries(args)
27
+ .map(([key, value]) => `${key}: "${value}"`)
28
+ .join(', ');
29
+
30
+ const functionHandler: LambdaFunctionDefinition = {};
31
+ let handlerString = '';
32
+ if (handler) {
33
+ const functionName = `Fn${capitalize(typeName)}`;
34
+ const eventVersion = handler.eventVersion;
35
+ handlerString = `, handler: { functionName: "${functionName}", eventVersion: "${eventVersion}" }`;
36
+ functionHandler[functionName] = handler;
37
+ }
38
+
39
+ const toolsString = tools?.length
40
+ ? `, tools: [${getConversationToolsString(tools)}]`
41
+ : '';
42
+
43
+ const conversationDirective = `@conversation(${argsString}${handlerString}${toolsString})`;
44
+
45
+ const field = `${typeName}(conversationId: ID!, content: [ContentBlockInput], aiContext: AWSJSON, toolConfiguration: ToolConfigurationInput): ConversationMessage ${conversationDirective} @aws_cognito_user_pools`;
46
+ return { field, functionHandler };
47
+ };
48
+
49
+ const isRef = (query: unknown): query is { data: InternalRef['data'] } =>
50
+ (query as any)?.data?.type === 'ref';
51
+
52
+ const getConversationToolsString = (tools: ToolDefinition[]) =>
53
+ tools
54
+ .map((tool) => {
55
+ const { query, description } = tool;
56
+ if (!isRef(query)) {
57
+ throw new Error(`Unexpected query was found in tool ${tool}.`);
58
+ }
59
+ // TODO: add validation for query / auth (cup) / etc
60
+ const queryName = query.data.link;
61
+ return `{ name: "${queryName}", description: "${description}" }`;
62
+ })
63
+ .join(', ');
package/src/index.ts CHANGED
@@ -5,7 +5,7 @@ export { a };
5
5
 
6
6
  export type { ClientSchema };
7
7
  export type {CombinedModelSchema} from './CombineSchema';
8
- export type { Authorization } from './Authorization';
8
+ export type { Authorization, ResourceAuthorization } from './Authorization';
9
9
  export type { CustomOperation } from './CustomOperation';
10
10
  export type { ModelField, Nullable, Json } from './ModelField';
11
11
  export type { ModelSchema, RDSModelSchema} from './ModelSchema';
@@ -1,239 +0,0 @@
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
- // This is done to escape newlines in potentially multi-line system prompts
11
- // e.g.
12
- // realtorChat: a.conversation({
13
- // aiModel: a.ai.model('Claude 3 Haiku'),
14
- // systemPrompt: `You are a helpful real estate assistant
15
- // Respond in the poetic form of haiku.`,
16
- // }),
17
- //
18
- // It doesn't affect non multi-line string inputs for system prompts
19
- systemPrompt: systemPrompt.replace(/\r?\n/g, '\\n'),
20
- };
21
- const argsString = Object.entries(args)
22
- .map(([key, value]) => `${key}: "${value}"`)
23
- .join(', ');
24
- const functionHandler = {};
25
- let handlerString = '';
26
- if (handler) {
27
- const functionName = `Fn${(0, utils_1.capitalize)(typeName)}`;
28
- const eventVersion = handler.eventVersion;
29
- handlerString = `, handler: { functionName: "${functionName}", eventVersion: "${eventVersion}" }`;
30
- functionHandler[functionName] = handler;
31
- }
32
- const toolsString = tools?.length
33
- ? `, tools: [${getConversationToolsString(tools)}]`
34
- : '';
35
- const conversationDirective = `@conversation(${argsString}${handlerString}${toolsString})`;
36
- const field = `${typeName}(conversationId: ID!, content: [ContentBlockInput], aiContext: AWSJSON, toolConfiguration: ToolConfigurationInput): ConversationMessage ${conversationDirective} @aws_cognito_user_pools`;
37
- return { field, functionHandler };
38
- };
39
- exports.createConversationField = createConversationField;
40
- const isRef = (query) => query?.data?.type === 'ref';
41
- const getConversationToolsString = (tools) => tools
42
- .map((tool) => {
43
- const { query, description } = tool;
44
- if (!isRef(query)) {
45
- throw new Error(`Unexpected query was found in tool ${tool}.`);
46
- }
47
- // TODO: add validation for query / auth (cup) / etc
48
- const queryName = query.data.link;
49
- return `{ name: "${queryName}", description: "${description}" }`;
50
- })
51
- .join(', ');
52
- const ConversationParticipantRole = `enum ConversationParticipantRole {
53
- user
54
- assistant
55
- }`;
56
- const ConversationMessage = `interface ConversationMessage {
57
- id: ID!
58
- conversationId: ID!
59
- role: ConversationParticipantRole
60
- content: [ContentBlock]
61
- aiContext: AWSJSON
62
- toolConfiguration: ToolConfiguration
63
- createdAt: AWSDateTime
64
- updatedAt: AWSDateTime
65
- owner: String
66
- }`;
67
- const DocumentBlockSourceInput = `input DocumentBlockSourceInput {
68
- bytes: String
69
- }`;
70
- const DocumentBlockInput = `input DocumentBlockInput {
71
- format: String!
72
- name: String!
73
- source: DocumentBlockSourceInput!
74
- }`;
75
- const ImageBlockSourceInput = `input ImageBlockSourceInput {
76
- bytes: String
77
- }`;
78
- const ImageBlockInput = `input ImageBlockInput {
79
- format: String!
80
- source: ImageBlockSourceInput!
81
- }`;
82
- const ToolResultContentBlockInput = `input ToolResultContentBlockInput {
83
- document: DocumentBlockInput
84
- image: ImageBlockInput
85
- json: AWSJSON
86
- text: String
87
- }`;
88
- const ToolResultBlockInput = `input ToolResultBlockInput {
89
- content: [ToolResultContentBlockInput!]!
90
- toolUseId: String!
91
- status: String
92
- }`;
93
- const DocumentBlockSource = `type DocumentBlockSource {
94
- bytes: String
95
- }
96
- `;
97
- const DocumentBlock = `type DocumentBlock {
98
- format: String!
99
- name: String!
100
- source: DocumentBlockSource!
101
- }`;
102
- const ImageBlock = `type ImageBlock {
103
- format: String!
104
- source: ImageBlockSource!
105
- }`;
106
- const ImageBlockSource = `type ImageBlockSource {
107
- bytes: String
108
- }`;
109
- const ToolUseBlockInput = `input ToolUseBlockInput {
110
- toolUseId: String!
111
- name: String!
112
- input: AWSJSON!
113
- }`;
114
- const ToolUseBlock = `type ToolUseBlock {
115
- toolUseId: String!
116
- name: String!
117
- input: AWSJSON!
118
- }`;
119
- const ToolResultContentBlock = `type ToolResultContentBlock {
120
- document: DocumentBlock
121
- image: ImageBlock
122
- json: AWSJSON
123
- text: String
124
- }`;
125
- const ToolResultBlock = `type ToolResultBlock {
126
- content: [ToolResultContentBlock!]!
127
- toolUseId: String!
128
- status: String
129
- }`;
130
- const ContentBlockText = `type ContentBlockText {
131
- text: String
132
- }`;
133
- const ContentBlockImage = `type ContentBlockImage {
134
- image: ImageBlock
135
- }`;
136
- const ContentBlockDocument = `type ContentBlockDocument {
137
- document: DocumentBlock
138
- }`;
139
- const ContentBlockToolUse = `type ContentBlockToolUse {
140
- toolUse: ToolUseBlock
141
- }`;
142
- const ContentBlockToolResult = `type ContentBlockToolResult {
143
- toolResult: ToolResultBlock
144
- }`;
145
- const ContentBlockInput = `input ContentBlockInput {
146
- text: String
147
- document: DocumentBlockInput
148
- image: ImageBlockInput
149
- toolResult: ToolResultBlockInput
150
- toolUse: ToolUseBlockInput
151
- }`;
152
- const ContentBlock = `type ContentBlock {
153
- text: String
154
- document: DocumentBlock
155
- image: ImageBlock
156
- toolResult: ToolResultBlock
157
- toolUse: ToolUseBlock
158
- }`;
159
- const ToolConfigurationInput = `input ToolConfigurationInput {
160
- tools: [ToolInput]
161
- }`;
162
- const ToolInput = `input ToolInput {
163
- toolSpec: ToolSpecificationInput
164
- }`;
165
- const ToolSpecificationInput = `input ToolSpecificationInput {
166
- name: String!
167
- description: String
168
- inputSchema: ToolInputSchemaInput!
169
- }`;
170
- const ToolInputSchemaInput = `input ToolInputSchemaInput {
171
- json: AWSJSON
172
- }`;
173
- const ToolConfiguration = `type ToolConfiguration {
174
- tools: [Tool]
175
- }`;
176
- const Tool = `type Tool {
177
- toolSpec: ToolSpecification
178
- }`;
179
- const ToolSpecification = `type ToolSpecification {
180
- name: String!
181
- description: String
182
- inputSchema: ToolInputSchema!
183
- }`;
184
- const ToolInputSchema = `type ToolInputSchema {
185
- json: AWSJSON
186
- }`;
187
- const ConversationMessageStreamEvent = `type ConversationMessageStreamPart @aws_cognito_user_pools {
188
- id: ID!
189
- owner: String
190
- conversationId: ID!
191
- associatedUserMessageId: ID!
192
- contentBlockIndex: Int
193
- contentBlockText: String
194
- contentBlockDeltaIndex: Int
195
- contentBlockToolUse: ToolUseBlock
196
- contentBlockDoneAtIndex: Int
197
- stopReason: String
198
- errors: [ConversationTurnError]
199
- }`;
200
- const ConversationTurnError = `type ConversationTurnError @aws_cognito_user_pools {
201
- message: String!
202
- errorType: String!
203
- }`;
204
- exports.conversationTypes = [
205
- ConversationParticipantRole,
206
- ConversationMessage,
207
- DocumentBlockSourceInput,
208
- DocumentBlockInput,
209
- ImageBlockSourceInput,
210
- ImageBlockInput,
211
- ToolUseBlockInput,
212
- ToolResultContentBlockInput,
213
- ToolResultBlockInput,
214
- DocumentBlockSource,
215
- DocumentBlock,
216
- ImageBlock,
217
- ImageBlockSource,
218
- ToolUseBlock,
219
- ToolResultContentBlock,
220
- ToolResultBlock,
221
- ContentBlockText,
222
- ContentBlockImage,
223
- ContentBlockDocument,
224
- ContentBlockToolUse,
225
- ContentBlockToolResult,
226
- ContentBlockInput,
227
- ContentBlock,
228
- ToolConfigurationInput,
229
- ToolInput,
230
- ToolSpecificationInput,
231
- ToolInputSchemaInput,
232
- ToolConfiguration,
233
- Tool,
234
- ToolSpecification,
235
- ToolInputSchema,
236
- ConversationMessageStreamEvent,
237
- ConversationTurnError,
238
- ];
239
- //# sourceMappingURL=ConversationSchemaTypes.js.map
@@ -1 +0,0 @@
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 // This is done to escape newlines in potentially multi-line system prompts\n // e.g.\n // realtorChat: a.conversation({\n // aiModel: a.ai.model('Claude 3 Haiku'),\n // systemPrompt: `You are a helpful real estate assistant\n // Respond in the poetic form of haiku.`,\n // }),\n //\n // It doesn't affect non multi-line string inputs for system prompts\n systemPrompt: systemPrompt.replace(/\\r?\\n/g, '\\\\n'),\n };\n const argsString = Object.entries(args)\n .map(([key, value]) => `${key}: \"${value}\"`)\n .join(', ');\n const functionHandler = {};\n let handlerString = '';\n if (handler) {\n const functionName = `Fn${(0, utils_1.capitalize)(typeName)}`;\n const eventVersion = handler.eventVersion;\n handlerString = `, handler: { functionName: \"${functionName}\", eventVersion: \"${eventVersion}\" }`;\n functionHandler[functionName] = handler;\n }\n const toolsString = tools?.length\n ? `, tools: [${getConversationToolsString(tools)}]`\n : '';\n const conversationDirective = `@conversation(${argsString}${handlerString}${toolsString})`;\n const field = `${typeName}(conversationId: ID!, content: [ContentBlockInput], aiContext: AWSJSON, toolConfiguration: ToolConfigurationInput): ConversationMessage ${conversationDirective} @aws_cognito_user_pools`;\n return { field, functionHandler };\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}`;\nconst ConversationMessageStreamEvent = `type ConversationMessageStreamPart @aws_cognito_user_pools {\n id: ID!\n owner: String\n conversationId: ID!\n associatedUserMessageId: ID!\n contentBlockIndex: Int\n contentBlockText: String\n contentBlockDeltaIndex: Int\n contentBlockToolUse: ToolUseBlock\n contentBlockDoneAtIndex: Int\n stopReason: String\n errors: [ConversationTurnError]\n}`;\nconst ConversationTurnError = `type ConversationTurnError @aws_cognito_user_pools {\n message: String!\n errorType: String!\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 ConversationMessageStreamEvent,\n ConversationTurnError,\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,GAAG,OAAO,CAAC;AAC9D,IAAI,MAAM,IAAI,GAAG;AACjB,QAAQ,OAAO,EAAE,OAAO,CAAC,YAAY;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,YAAY,EAAE,YAAY,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC;AAC3D,KAAK,CAAC;AACN,IAAI,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;AAC3C,SAAS,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;AACpD,SAAS,IAAI,CAAC,IAAI,CAAC,CAAC;AACpB,IAAI,MAAM,eAAe,GAAG,EAAE,CAAC;AAC/B,IAAI,IAAI,aAAa,GAAG,EAAE,CAAC;AAC3B,IAAI,IAAI,OAAO,EAAE;AACjB,QAAQ,MAAM,YAAY,GAAG,CAAC,EAAE,EAAE,IAAI,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;A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,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,IAAI,8BAA8B;AAClC,IAAI,qBAAqB;AACzB,CAAC;;"}
@@ -1,7 +0,0 @@
1
- import { LambdaFunctionDefinition } from '@aws-amplify/data-schema-types';
2
- import type { InternalConversationType } from './ConversationType';
3
- export declare const createConversationField: (typeDef: InternalConversationType, typeName: string) => {
4
- field: string;
5
- functionHandler: LambdaFunctionDefinition;
6
- };
7
- export declare const conversationTypes: string[];