@aws-amplify/data-schema 1.14.0 → 1.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,173 +3,173 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.CONVERSATION_SCHEMA_GRAPHQL_TYPES = void 0;
5
5
  exports.CONVERSATION_SCHEMA_GRAPHQL_TYPES =
6
- /* GraphQL */ `enum ConversationParticipantRole {
6
+ /* GraphQL */ `enum AmplifyAIConversationParticipantRole {
7
7
  user
8
8
  assistant
9
9
  }
10
10
 
11
- interface ConversationMessage {
11
+ interface AmplifyAIConversationMessage {
12
12
  id: ID!
13
13
  conversationId: ID!
14
14
  associatedUserMessageId: ID
15
- role: ConversationParticipantRole
16
- content: [ContentBlock]
15
+ role: AmplifyAIConversationParticipantRole
16
+ content: [AmplifyAIContentBlock]
17
17
  aiContext: AWSJSON
18
- toolConfiguration: ToolConfiguration
18
+ toolConfiguration: AmplifyAIToolConfiguration
19
19
  createdAt: AWSDateTime
20
20
  updatedAt: AWSDateTime
21
21
  owner: String
22
22
  }
23
23
 
24
- input DocumentBlockSourceInput {
24
+ input AmplifyAIDocumentBlockSourceInput {
25
25
  bytes: String
26
26
  }
27
27
 
28
- input DocumentBlockInput {
28
+ input AmplifyAIDocumentBlockInput {
29
29
  format: String!
30
30
  name: String!
31
- source: DocumentBlockSourceInput!
31
+ source: AmplifyAIDocumentBlockSourceInput!
32
32
  }
33
33
 
34
- input ImageBlockSourceInput {
34
+ input AmplifyAIImageBlockSourceInput {
35
35
  bytes: String
36
36
  }
37
37
 
38
- input ImageBlockInput {
38
+ input AmplifyAIImageBlockInput {
39
39
  format: String!
40
- source: ImageBlockSourceInput!
40
+ source: AmplifyAIImageBlockSourceInput!
41
41
  }
42
42
 
43
- input ToolUseBlockInput {
43
+ input AmplifyAIToolUseBlockInput {
44
44
  toolUseId: String!
45
45
  name: String!
46
46
  input: AWSJSON!
47
47
  }
48
48
 
49
- input ToolResultContentBlockInput {
50
- document: DocumentBlockInput
51
- image: ImageBlockInput
49
+ input AmplifyAIToolResultContentBlockInput {
50
+ document: AmplifyAIDocumentBlockInput
51
+ image: AmplifyAIImageBlockInput
52
52
  json: AWSJSON
53
53
  text: String
54
54
  }
55
55
 
56
- input ToolResultBlockInput {
57
- content: [ToolResultContentBlockInput!]!
56
+ input AmplifyAIToolResultBlockInput {
57
+ content: [AmplifyAIToolResultContentBlockInput!]!
58
58
  toolUseId: String!
59
59
  status: String
60
60
  }
61
61
 
62
- type DocumentBlockSource {
62
+ type AmplifyAIDocumentBlockSource {
63
63
  bytes: String
64
64
  }
65
65
 
66
- type DocumentBlock {
66
+ type AmplifyAIDocumentBlock {
67
67
  format: String!
68
68
  name: String!
69
- source: DocumentBlockSource!
69
+ source: AmplifyAIDocumentBlockSource!
70
70
  }
71
71
 
72
- type ImageBlock {
72
+ type AmplifyAIImageBlock {
73
73
  format: String!
74
- source: ImageBlockSource!
74
+ source: AmplifyAIImageBlockSource!
75
75
  }
76
76
 
77
- type ImageBlockSource {
77
+ type AmplifyAIImageBlockSource {
78
78
  bytes: String
79
79
  }
80
80
 
81
- type ToolUseBlock {
81
+ type AmplifyAIToolUseBlock {
82
82
  toolUseId: String!
83
83
  name: String!
84
84
  input: AWSJSON!
85
85
  }
86
86
 
87
- type ToolResultContentBlock {
88
- document: DocumentBlock
89
- image: ImageBlock
87
+ type AmplifyAIToolResultContentBlock {
88
+ document: AmplifyAIDocumentBlock
89
+ image: AmplifyAIImageBlock
90
90
  json: AWSJSON
91
91
  text: String
92
92
  }
93
93
 
94
- type ToolResultBlock {
95
- content: [ToolResultContentBlock!]!
94
+ type AmplifyAIToolResultBlock {
95
+ content: [AmplifyAIToolResultContentBlock!]!
96
96
  toolUseId: String!
97
97
  status: String
98
98
  }
99
99
 
100
- type ContentBlockText {
100
+ type AmplifyAIContentBlockText {
101
101
  text: String
102
102
  }
103
103
 
104
- type ContentBlockImage {
105
- image: ImageBlock
104
+ type AmplifyAIContentBlockImage {
105
+ image: AmplifyAIImageBlock
106
106
  }
107
107
 
108
- type ContentBlockDocument {
109
- document: DocumentBlock
108
+ type AmplifyAIContentBlockDocument {
109
+ document: AmplifyAIDocumentBlock
110
110
  }
111
111
 
112
- type ContentBlockToolUse {
113
- toolUse: ToolUseBlock
112
+ type AmplifyAIContentBlockToolUse {
113
+ toolUse: AmplifyAIToolUseBlock
114
114
  }
115
115
 
116
- type ContentBlockToolResult {
117
- toolResult: ToolResultBlock
116
+ type AmplifyAIContentBlockToolResult {
117
+ toolResult: AmplifyAIToolResultBlock
118
118
  }
119
119
 
120
- input ContentBlockInput {
120
+ input AmplifyAIContentBlockInput {
121
121
  text: String
122
- document: DocumentBlockInput
123
- image: ImageBlockInput
124
- toolResult: ToolResultBlockInput
125
- toolUse: ToolUseBlockInput
122
+ document: AmplifyAIDocumentBlockInput
123
+ image: AmplifyAIImageBlockInput
124
+ toolResult: AmplifyAIToolResultBlockInput
125
+ toolUse: AmplifyAIToolUseBlockInput
126
126
  }
127
127
 
128
- type ContentBlock {
128
+ type AmplifyAIContentBlock {
129
129
  text: String
130
- document: DocumentBlock
131
- image: ImageBlock
132
- toolResult: ToolResultBlock
133
- toolUse: ToolUseBlock
130
+ document: AmplifyAIDocumentBlock
131
+ image: AmplifyAIImageBlock
132
+ toolResult: AmplifyAIToolResultBlock
133
+ toolUse: AmplifyAIToolUseBlock
134
134
  }
135
135
 
136
- input ToolConfigurationInput {
137
- tools: [ToolInput]
136
+ input AmplifyAIToolConfigurationInput {
137
+ tools: [AmplifyAIToolInput]
138
138
  }
139
139
 
140
- input ToolInput {
141
- toolSpec: ToolSpecificationInput
140
+ input AmplifyAIToolInput {
141
+ toolSpec: AmplifyAIToolSpecificationInput
142
142
  }
143
143
 
144
- input ToolSpecificationInput {
144
+ input AmplifyAIToolSpecificationInput {
145
145
  name: String!
146
146
  description: String
147
- inputSchema: ToolInputSchemaInput!
147
+ inputSchema: AmplifyAIToolInputSchemaInput!
148
148
  }
149
149
 
150
- input ToolInputSchemaInput {
150
+ input AmplifyAIToolInputSchemaInput {
151
151
  json: AWSJSON
152
152
  }
153
153
 
154
- type ToolConfiguration {
155
- tools: [Tool]
154
+ type AmplifyAIToolConfiguration {
155
+ tools: [AmplifyAITool]
156
156
  }
157
157
 
158
- type Tool {
159
- toolSpec: ToolSpecification
158
+ type AmplifyAITool {
159
+ toolSpec: AmplifyAIToolSpecification
160
160
  }
161
161
 
162
- type ToolSpecification {
162
+ type AmplifyAIToolSpecification {
163
163
  name: String!
164
164
  description: String
165
- inputSchema: ToolInputSchema!
165
+ inputSchema: AmplifyAIToolInputSchema!
166
166
  }
167
167
 
168
- type ToolInputSchema {
168
+ type AmplifyAIToolInputSchema {
169
169
  json: AWSJSON
170
170
  }
171
171
 
172
- type ConversationMessageStreamPart @aws_cognito_user_pools {
172
+ type AmplifyAIConversationMessageStreamPart @aws_cognito_user_pools {
173
173
  id: ID!
174
174
  owner: String
175
175
  conversationId: ID!
@@ -177,13 +177,13 @@ type ConversationMessageStreamPart @aws_cognito_user_pools {
177
177
  contentBlockIndex: Int
178
178
  contentBlockText: String
179
179
  contentBlockDeltaIndex: Int
180
- contentBlockToolUse: ToolUseBlock
180
+ contentBlockToolUse: AmplifyAIToolUseBlock
181
181
  contentBlockDoneAtIndex: Int
182
182
  stopReason: String
183
- errors: [ConversationTurnError]
183
+ errors: [AmplifyAIConversationTurnError]
184
184
  }
185
185
 
186
- type ConversationTurnError @aws_cognito_user_pools {
186
+ type AmplifyAIConversationTurnError @aws_cognito_user_pools {
187
187
  message: String!
188
188
  errorType: String!
189
189
  }`;
@@ -1 +1 @@
1
- {"version":3,"file":"ConversationSchemaGraphQLTypes.js","sources":["../../../src/ai/ConversationSchemaGraphQLTypes.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CONVERSATION_SCHEMA_GRAPHQL_TYPES = void 0;\nexports.CONVERSATION_SCHEMA_GRAPHQL_TYPES = \n/* GraphQL */ `enum ConversationParticipantRole {\n user\n assistant\n}\n\ninterface ConversationMessage {\n id: ID!\n conversationId: ID!\n associatedUserMessageId: ID\n role: ConversationParticipantRole\n content: [ContentBlock]\n aiContext: AWSJSON\n toolConfiguration: ToolConfiguration\n createdAt: AWSDateTime\n updatedAt: AWSDateTime\n owner: String\n}\n\ninput DocumentBlockSourceInput {\n bytes: String\n}\n\ninput DocumentBlockInput {\n format: String!\n name: String!\n source: DocumentBlockSourceInput!\n}\n\ninput ImageBlockSourceInput {\n bytes: String\n}\n\ninput ImageBlockInput {\n format: String!\n source: ImageBlockSourceInput!\n}\n\ninput ToolUseBlockInput {\n toolUseId: String!\n name: String!\n input: AWSJSON!\n}\n\ninput ToolResultContentBlockInput {\n document: DocumentBlockInput\n image: ImageBlockInput\n json: AWSJSON\n text: String\n}\n\ninput ToolResultBlockInput {\n content: [ToolResultContentBlockInput!]!\n toolUseId: String!\n status: String\n}\n\ntype DocumentBlockSource {\n bytes: String\n}\n\ntype DocumentBlock {\n format: String!\n name: String!\n source: DocumentBlockSource!\n}\n\ntype ImageBlock {\n format: String!\n source: ImageBlockSource!\n}\n\ntype ImageBlockSource {\n bytes: String\n}\n\ntype ToolUseBlock {\n toolUseId: String!\n name: String!\n input: AWSJSON!\n}\n\ntype ToolResultContentBlock {\n document: DocumentBlock\n image: ImageBlock\n json: AWSJSON\n text: String\n}\n\ntype ToolResultBlock {\n content: [ToolResultContentBlock!]!\n toolUseId: String!\n status: String\n}\n\ntype ContentBlockText {\n text: String\n}\n\ntype ContentBlockImage {\n image: ImageBlock\n}\n\ntype ContentBlockDocument {\n document: DocumentBlock\n}\n\ntype ContentBlockToolUse {\n toolUse: ToolUseBlock\n}\n\ntype ContentBlockToolResult {\n toolResult: ToolResultBlock\n}\n\ninput ContentBlockInput {\n text: String\n document: DocumentBlockInput\n image: ImageBlockInput\n toolResult: ToolResultBlockInput\n toolUse: ToolUseBlockInput\n}\n\ntype ContentBlock {\n text: String\n document: DocumentBlock\n image: ImageBlock\n toolResult: ToolResultBlock\n toolUse: ToolUseBlock\n}\n\ninput ToolConfigurationInput {\n tools: [ToolInput]\n}\n\ninput ToolInput {\n toolSpec: ToolSpecificationInput\n}\n\ninput ToolSpecificationInput {\n name: String!\n description: String\n inputSchema: ToolInputSchemaInput!\n}\n\ninput ToolInputSchemaInput {\n json: AWSJSON\n}\n\ntype ToolConfiguration {\n tools: [Tool]\n}\n\ntype Tool {\n toolSpec: ToolSpecification\n}\n\ntype ToolSpecification {\n name: String!\n description: String\n inputSchema: ToolInputSchema!\n}\n\ntype ToolInputSchema {\n json: AWSJSON\n}\n\ntype 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}\n\ntype ConversationTurnError @aws_cognito_user_pools {\n message: String!\n errorType: String!\n}`;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,iCAAiC,GAAG,KAAK,CAAC,CAAC;AACnD,OAAO,CAAC,iCAAiC;AACzC,cAAc,CAAC;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC;;"}
1
+ {"version":3,"file":"ConversationSchemaGraphQLTypes.js","sources":["../../../src/ai/ConversationSchemaGraphQLTypes.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CONVERSATION_SCHEMA_GRAPHQL_TYPES = void 0;\nexports.CONVERSATION_SCHEMA_GRAPHQL_TYPES = \n/* GraphQL */ `enum AmplifyAIConversationParticipantRole {\n user\n assistant\n}\n\ninterface AmplifyAIConversationMessage {\n id: ID!\n conversationId: ID!\n associatedUserMessageId: ID\n role: AmplifyAIConversationParticipantRole\n content: [AmplifyAIContentBlock]\n aiContext: AWSJSON\n toolConfiguration: AmplifyAIToolConfiguration\n createdAt: AWSDateTime\n updatedAt: AWSDateTime\n owner: String\n}\n\ninput AmplifyAIDocumentBlockSourceInput {\n bytes: String\n}\n\ninput AmplifyAIDocumentBlockInput {\n format: String!\n name: String!\n source: AmplifyAIDocumentBlockSourceInput!\n}\n\ninput AmplifyAIImageBlockSourceInput {\n bytes: String\n}\n\ninput AmplifyAIImageBlockInput {\n format: String!\n source: AmplifyAIImageBlockSourceInput!\n}\n\ninput AmplifyAIToolUseBlockInput {\n toolUseId: String!\n name: String!\n input: AWSJSON!\n}\n\ninput AmplifyAIToolResultContentBlockInput {\n document: AmplifyAIDocumentBlockInput\n image: AmplifyAIImageBlockInput\n json: AWSJSON\n text: String\n}\n\ninput AmplifyAIToolResultBlockInput {\n content: [AmplifyAIToolResultContentBlockInput!]!\n toolUseId: String!\n status: String\n}\n\ntype AmplifyAIDocumentBlockSource {\n bytes: String\n}\n\ntype AmplifyAIDocumentBlock {\n format: String!\n name: String!\n source: AmplifyAIDocumentBlockSource!\n}\n\ntype AmplifyAIImageBlock {\n format: String!\n source: AmplifyAIImageBlockSource!\n}\n\ntype AmplifyAIImageBlockSource {\n bytes: String\n}\n\ntype AmplifyAIToolUseBlock {\n toolUseId: String!\n name: String!\n input: AWSJSON!\n}\n\ntype AmplifyAIToolResultContentBlock {\n document: AmplifyAIDocumentBlock\n image: AmplifyAIImageBlock\n json: AWSJSON\n text: String\n}\n\ntype AmplifyAIToolResultBlock {\n content: [AmplifyAIToolResultContentBlock!]!\n toolUseId: String!\n status: String\n}\n\ntype AmplifyAIContentBlockText {\n text: String\n}\n\ntype AmplifyAIContentBlockImage {\n image: AmplifyAIImageBlock\n}\n\ntype AmplifyAIContentBlockDocument {\n document: AmplifyAIDocumentBlock\n}\n\ntype AmplifyAIContentBlockToolUse {\n toolUse: AmplifyAIToolUseBlock\n}\n\ntype AmplifyAIContentBlockToolResult {\n toolResult: AmplifyAIToolResultBlock\n}\n\ninput AmplifyAIContentBlockInput {\n text: String\n document: AmplifyAIDocumentBlockInput\n image: AmplifyAIImageBlockInput\n toolResult: AmplifyAIToolResultBlockInput\n toolUse: AmplifyAIToolUseBlockInput\n}\n\ntype AmplifyAIContentBlock {\n text: String\n document: AmplifyAIDocumentBlock\n image: AmplifyAIImageBlock\n toolResult: AmplifyAIToolResultBlock\n toolUse: AmplifyAIToolUseBlock\n}\n\ninput AmplifyAIToolConfigurationInput {\n tools: [AmplifyAIToolInput]\n}\n\ninput AmplifyAIToolInput {\n toolSpec: AmplifyAIToolSpecificationInput\n}\n\ninput AmplifyAIToolSpecificationInput {\n name: String!\n description: String\n inputSchema: AmplifyAIToolInputSchemaInput!\n}\n\ninput AmplifyAIToolInputSchemaInput {\n json: AWSJSON\n}\n\ntype AmplifyAIToolConfiguration {\n tools: [AmplifyAITool]\n}\n\ntype AmplifyAITool {\n toolSpec: AmplifyAIToolSpecification\n}\n\ntype AmplifyAIToolSpecification {\n name: String!\n description: String\n inputSchema: AmplifyAIToolInputSchema!\n}\n\ntype AmplifyAIToolInputSchema {\n json: AWSJSON\n}\n\ntype AmplifyAIConversationMessageStreamPart @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: AmplifyAIToolUseBlock\n contentBlockDoneAtIndex: Int\n stopReason: String\n errors: [AmplifyAIConversationTurnError]\n}\n\ntype AmplifyAIConversationTurnError @aws_cognito_user_pools {\n message: String!\n errorType: String!\n}`;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,iCAAiC,GAAG,KAAK,CAAC,CAAC;AACnD,OAAO,CAAC,iCAAiC;AACzC,cAAc,CAAC;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC;;"}
@@ -36,7 +36,7 @@ const createConversationField = (typeDef, typeName) => {
36
36
  ? `, tools: [${getConversationToolsString(tools)}]`
37
37
  : '';
38
38
  const conversationDirective = `@conversation(${argsString}${authString}${handlerString}${toolsString})`;
39
- const field = `${typeName}(conversationId: ID!, content: [ContentBlockInput], aiContext: AWSJSON, toolConfiguration: ToolConfigurationInput): ConversationMessage ${conversationDirective} @aws_cognito_user_pools`;
39
+ const field = `${typeName}(conversationId: ID!, content: [AmplifyAIContentBlockInput], aiContext: AWSJSON, toolConfiguration: AmplifyAIToolConfigurationInput): AmplifyAIConversationMessage ${conversationDirective} @aws_cognito_user_pools`;
40
40
  return { field, functionHandler };
41
41
  };
42
42
  exports.createConversationField = createConversationField;
@@ -1 +1 @@
1
- {"version":3,"file":"ConversationSchemaProcessor.js","sources":["../../../src/ai/ConversationSchemaProcessor.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createConversationField = void 0;\nconst Authorization_1 = require(\"../Authorization\");\nconst utils_1 = require(\"../runtime/utils\");\nconst createConversationField = (typeDef, typeName) => {\n const { aiModel, systemPrompt, handler, tools } = typeDef;\n const { strategy, provider } = extractAuthorization(typeDef, typeName);\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 authString = `, auth: { strategy: ${strategy}, provider: ${provider} }`;\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}${authString}${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 extractAuthorization = (typeDef, typeName) => {\n const { authorization } = typeDef.data;\n if (authorization.length === 0) {\n throw new Error(`Conversation ${typeName} is missing authorization rules. Use .authorization((allow) => allow.owner()) to configure authorization for your conversation route.`);\n }\n const { strategy, provider } = (0, Authorization_1.accessData)(authorization[0]);\n if (strategy !== 'owner' || provider !== 'userPools') {\n throw new Error(`Conversation ${typeName} must use owner authorization with a user pool provider. Use .authorization((allow) => allow.owner()) to configure authorization for your conversation route.`);\n }\n return { strategy, provider };\n};\nconst getConversationToolsString = (tools) => tools\n .map((tool) => {\n const { name, description } = tool;\n // https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ToolSpecification.html\n // Pattern: ^[a-zA-Z][a-zA-Z0-9_]*$\n // Length Constraints: Minimum length of 1. Maximum length of 64.\n const isValidToolName = /^[a-zA-Z][a-zA-Z0-9_]*$/.test(name) &&\n name.length >= 1 &&\n name.length <= 64;\n if (!isValidToolName) {\n throw new Error(`Tool name must be between 1 and 64 characters, start with a letter, and contain only letters, numbers, and underscores. Found: ${name}`);\n }\n const toolDefinition = extractToolDefinition(tool);\n return `{ name: \"${name}\", description: \"${description}\", ${toolDefinition} }`;\n})\n .join(', ');\nconst extractToolDefinition = (tool) => {\n if ('model' in tool) {\n if (!isRef(tool.model))\n throw new Error(`Unexpected model was found in tool ${tool}.`);\n const { model, modelOperation } = tool;\n return `modelName: \"${model.data.link}\", modelOperation: ${modelOperation}`;\n }\n if (!isRef(tool.query))\n throw new Error(`Unexpected query was found in tool ${tool}.`);\n return `queryName: \"${tool.query.data.link}\"`;\n};\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,uBAAuB,GAAG,KAAK,CAAC,CAAC;AACzC,MAAM,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AACpD,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,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,oBAAoB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3E,IAAI,MAAM,IAAI,GAAG;AACjB,QAAQ,OAAO,EAAE,OAAO,CAAC,YAAY;AACrC;AACA;AAC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ty(exports, \"__esModule\", { value: true });\nexports.createConversationField = void 0;\nconst Authorization_1 = require(\"../Authorization\");\nconst utils_1 = require(\"../runtime/utils\");\nconst createConversationField = (typeDef, typeName) => {\n const { aiModel, systemPrompt, handler, tools } = typeDef;\n const { strategy, provider } = extractAuthorization(typeDef, typeName);\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 authString = `, auth: { strategy: ${strategy}, provider: ${provider} }`;\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}${authString}${handlerString}${toolsString})`;\n const field = `${typeName}(conversationId: ID!, content: [AmplifyAIContentBlockInput], aiContext: AWSJSON, toolConfiguration: AmplifyAIToolConfigurationInput): AmplifyAIConversationMessage ${conversationDirective} @aws_cognito_user_pools`;\n return { field, functionHandler };\n};\nexports.createConversationField = createConversationField;\nconst isRef = (query) => query?.data?.type === 'ref';\nconst extractAuthorization = (typeDef, typeName) => {\n const { authorization } = typeDef.data;\n if (authorization.length === 0) {\n throw new Error(`Conversation ${typeName} is missing authorization rules. Use .authorization((allow) => allow.owner()) to configure authorization for your conversation route.`);\n }\n const { strategy, provider } = (0, Authorization_1.accessData)(authorization[0]);\n if (strategy !== 'owner' || provider !== 'userPools') {\n throw new Error(`Conversation ${typeName} must use owner authorization with a user pool provider. Use .authorization((allow) => allow.owner()) to configure authorization for your conversation route.`);\n }\n return { strategy, provider };\n};\nconst getConversationToolsString = (tools) => tools\n .map((tool) => {\n const { name, description } = tool;\n // https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ToolSpecification.html\n // Pattern: ^[a-zA-Z][a-zA-Z0-9_]*$\n // Length Constraints: Minimum length of 1. Maximum length of 64.\n const isValidToolName = /^[a-zA-Z][a-zA-Z0-9_]*$/.test(name) &&\n name.length >= 1 &&\n name.length <= 64;\n if (!isValidToolName) {\n throw new Error(`Tool name must be between 1 and 64 characters, start with a letter, and contain only letters, numbers, and underscores. Found: ${name}`);\n }\n const toolDefinition = extractToolDefinition(tool);\n return `{ name: \"${name}\", description: \"${description}\", ${toolDefinition} }`;\n})\n .join(', ');\nconst extractToolDefinition = (tool) => {\n if ('model' in tool) {\n if (!isRef(tool.model))\n throw new Error(`Unexpected model was found in tool ${tool}.`);\n const { model, modelOperation } = tool;\n return `modelName: \"${model.data.link}\", modelOperation: ${modelOperation}`;\n }\n if (!isRef(tool.query))\n throw new Error(`Unexpected query was found in tool ${tool}.`);\n return `queryName: \"${tool.query.data.link}\"`;\n};\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,uBAAuB,GAAG,KAAK,CAAC,CAAC;AACzC,MAAM,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AACpD,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,EAAE,QAAQ,EA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AI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClD,CAAC;;"}
@@ -1 +1 @@
1
- export declare const CONVERSATION_SCHEMA_GRAPHQL_TYPES = "enum ConversationParticipantRole {\n user\n assistant\n}\n\ninterface ConversationMessage {\n id: ID!\n conversationId: ID!\n associatedUserMessageId: ID\n role: ConversationParticipantRole\n content: [ContentBlock]\n aiContext: AWSJSON\n toolConfiguration: ToolConfiguration\n createdAt: AWSDateTime\n updatedAt: AWSDateTime\n owner: String\n}\n\ninput DocumentBlockSourceInput {\n bytes: String\n}\n\ninput DocumentBlockInput {\n format: String!\n name: String!\n source: DocumentBlockSourceInput!\n}\n\ninput ImageBlockSourceInput {\n bytes: String\n}\n\ninput ImageBlockInput {\n format: String!\n source: ImageBlockSourceInput!\n}\n\ninput ToolUseBlockInput {\n toolUseId: String!\n name: String!\n input: AWSJSON!\n}\n\ninput ToolResultContentBlockInput {\n document: DocumentBlockInput\n image: ImageBlockInput\n json: AWSJSON\n text: String\n}\n\ninput ToolResultBlockInput {\n content: [ToolResultContentBlockInput!]!\n toolUseId: String!\n status: String\n}\n\ntype DocumentBlockSource {\n bytes: String\n}\n\ntype DocumentBlock {\n format: String!\n name: String!\n source: DocumentBlockSource!\n}\n\ntype ImageBlock {\n format: String!\n source: ImageBlockSource!\n}\n\ntype ImageBlockSource {\n bytes: String\n}\n\ntype ToolUseBlock {\n toolUseId: String!\n name: String!\n input: AWSJSON!\n}\n\ntype ToolResultContentBlock {\n document: DocumentBlock\n image: ImageBlock\n json: AWSJSON\n text: String\n}\n\ntype ToolResultBlock {\n content: [ToolResultContentBlock!]!\n toolUseId: String!\n status: String\n}\n\ntype ContentBlockText {\n text: String\n}\n\ntype ContentBlockImage {\n image: ImageBlock\n}\n\ntype ContentBlockDocument {\n document: DocumentBlock\n}\n\ntype ContentBlockToolUse {\n toolUse: ToolUseBlock\n}\n\ntype ContentBlockToolResult {\n toolResult: ToolResultBlock\n}\n\ninput ContentBlockInput {\n text: String\n document: DocumentBlockInput\n image: ImageBlockInput\n toolResult: ToolResultBlockInput\n toolUse: ToolUseBlockInput\n}\n\ntype ContentBlock {\n text: String\n document: DocumentBlock\n image: ImageBlock\n toolResult: ToolResultBlock\n toolUse: ToolUseBlock\n}\n\ninput ToolConfigurationInput {\n tools: [ToolInput]\n}\n\ninput ToolInput {\n toolSpec: ToolSpecificationInput\n}\n\ninput ToolSpecificationInput {\n name: String!\n description: String\n inputSchema: ToolInputSchemaInput!\n}\n\ninput ToolInputSchemaInput {\n json: AWSJSON\n}\n\ntype ToolConfiguration {\n tools: [Tool]\n}\n\ntype Tool {\n toolSpec: ToolSpecification\n}\n\ntype ToolSpecification {\n name: String!\n description: String\n inputSchema: ToolInputSchema!\n}\n\ntype ToolInputSchema {\n json: AWSJSON\n}\n\ntype 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}\n\ntype ConversationTurnError @aws_cognito_user_pools {\n message: String!\n errorType: String!\n}";
1
+ export declare const CONVERSATION_SCHEMA_GRAPHQL_TYPES = "enum AmplifyAIConversationParticipantRole {\n user\n assistant\n}\n\ninterface AmplifyAIConversationMessage {\n id: ID!\n conversationId: ID!\n associatedUserMessageId: ID\n role: AmplifyAIConversationParticipantRole\n content: [AmplifyAIContentBlock]\n aiContext: AWSJSON\n toolConfiguration: AmplifyAIToolConfiguration\n createdAt: AWSDateTime\n updatedAt: AWSDateTime\n owner: String\n}\n\ninput AmplifyAIDocumentBlockSourceInput {\n bytes: String\n}\n\ninput AmplifyAIDocumentBlockInput {\n format: String!\n name: String!\n source: AmplifyAIDocumentBlockSourceInput!\n}\n\ninput AmplifyAIImageBlockSourceInput {\n bytes: String\n}\n\ninput AmplifyAIImageBlockInput {\n format: String!\n source: AmplifyAIImageBlockSourceInput!\n}\n\ninput AmplifyAIToolUseBlockInput {\n toolUseId: String!\n name: String!\n input: AWSJSON!\n}\n\ninput AmplifyAIToolResultContentBlockInput {\n document: AmplifyAIDocumentBlockInput\n image: AmplifyAIImageBlockInput\n json: AWSJSON\n text: String\n}\n\ninput AmplifyAIToolResultBlockInput {\n content: [AmplifyAIToolResultContentBlockInput!]!\n toolUseId: String!\n status: String\n}\n\ntype AmplifyAIDocumentBlockSource {\n bytes: String\n}\n\ntype AmplifyAIDocumentBlock {\n format: String!\n name: String!\n source: AmplifyAIDocumentBlockSource!\n}\n\ntype AmplifyAIImageBlock {\n format: String!\n source: AmplifyAIImageBlockSource!\n}\n\ntype AmplifyAIImageBlockSource {\n bytes: String\n}\n\ntype AmplifyAIToolUseBlock {\n toolUseId: String!\n name: String!\n input: AWSJSON!\n}\n\ntype AmplifyAIToolResultContentBlock {\n document: AmplifyAIDocumentBlock\n image: AmplifyAIImageBlock\n json: AWSJSON\n text: String\n}\n\ntype AmplifyAIToolResultBlock {\n content: [AmplifyAIToolResultContentBlock!]!\n toolUseId: String!\n status: String\n}\n\ntype AmplifyAIContentBlockText {\n text: String\n}\n\ntype AmplifyAIContentBlockImage {\n image: AmplifyAIImageBlock\n}\n\ntype AmplifyAIContentBlockDocument {\n document: AmplifyAIDocumentBlock\n}\n\ntype AmplifyAIContentBlockToolUse {\n toolUse: AmplifyAIToolUseBlock\n}\n\ntype AmplifyAIContentBlockToolResult {\n toolResult: AmplifyAIToolResultBlock\n}\n\ninput AmplifyAIContentBlockInput {\n text: String\n document: AmplifyAIDocumentBlockInput\n image: AmplifyAIImageBlockInput\n toolResult: AmplifyAIToolResultBlockInput\n toolUse: AmplifyAIToolUseBlockInput\n}\n\ntype AmplifyAIContentBlock {\n text: String\n document: AmplifyAIDocumentBlock\n image: AmplifyAIImageBlock\n toolResult: AmplifyAIToolResultBlock\n toolUse: AmplifyAIToolUseBlock\n}\n\ninput AmplifyAIToolConfigurationInput {\n tools: [AmplifyAIToolInput]\n}\n\ninput AmplifyAIToolInput {\n toolSpec: AmplifyAIToolSpecificationInput\n}\n\ninput AmplifyAIToolSpecificationInput {\n name: String!\n description: String\n inputSchema: AmplifyAIToolInputSchemaInput!\n}\n\ninput AmplifyAIToolInputSchemaInput {\n json: AWSJSON\n}\n\ntype AmplifyAIToolConfiguration {\n tools: [AmplifyAITool]\n}\n\ntype AmplifyAITool {\n toolSpec: AmplifyAIToolSpecification\n}\n\ntype AmplifyAIToolSpecification {\n name: String!\n description: String\n inputSchema: AmplifyAIToolInputSchema!\n}\n\ntype AmplifyAIToolInputSchema {\n json: AWSJSON\n}\n\ntype AmplifyAIConversationMessageStreamPart @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: AmplifyAIToolUseBlock\n contentBlockDoneAtIndex: Int\n stopReason: String\n errors: [AmplifyAIConversationTurnError]\n}\n\ntype AmplifyAIConversationTurnError @aws_cognito_user_pools {\n message: String!\n errorType: String!\n}";
@@ -1,171 +1,171 @@
1
1
  const CONVERSATION_SCHEMA_GRAPHQL_TYPES =
2
- /* GraphQL */ `enum ConversationParticipantRole {
2
+ /* GraphQL */ `enum AmplifyAIConversationParticipantRole {
3
3
  user
4
4
  assistant
5
5
  }
6
6
 
7
- interface ConversationMessage {
7
+ interface AmplifyAIConversationMessage {
8
8
  id: ID!
9
9
  conversationId: ID!
10
10
  associatedUserMessageId: ID
11
- role: ConversationParticipantRole
12
- content: [ContentBlock]
11
+ role: AmplifyAIConversationParticipantRole
12
+ content: [AmplifyAIContentBlock]
13
13
  aiContext: AWSJSON
14
- toolConfiguration: ToolConfiguration
14
+ toolConfiguration: AmplifyAIToolConfiguration
15
15
  createdAt: AWSDateTime
16
16
  updatedAt: AWSDateTime
17
17
  owner: String
18
18
  }
19
19
 
20
- input DocumentBlockSourceInput {
20
+ input AmplifyAIDocumentBlockSourceInput {
21
21
  bytes: String
22
22
  }
23
23
 
24
- input DocumentBlockInput {
24
+ input AmplifyAIDocumentBlockInput {
25
25
  format: String!
26
26
  name: String!
27
- source: DocumentBlockSourceInput!
27
+ source: AmplifyAIDocumentBlockSourceInput!
28
28
  }
29
29
 
30
- input ImageBlockSourceInput {
30
+ input AmplifyAIImageBlockSourceInput {
31
31
  bytes: String
32
32
  }
33
33
 
34
- input ImageBlockInput {
34
+ input AmplifyAIImageBlockInput {
35
35
  format: String!
36
- source: ImageBlockSourceInput!
36
+ source: AmplifyAIImageBlockSourceInput!
37
37
  }
38
38
 
39
- input ToolUseBlockInput {
39
+ input AmplifyAIToolUseBlockInput {
40
40
  toolUseId: String!
41
41
  name: String!
42
42
  input: AWSJSON!
43
43
  }
44
44
 
45
- input ToolResultContentBlockInput {
46
- document: DocumentBlockInput
47
- image: ImageBlockInput
45
+ input AmplifyAIToolResultContentBlockInput {
46
+ document: AmplifyAIDocumentBlockInput
47
+ image: AmplifyAIImageBlockInput
48
48
  json: AWSJSON
49
49
  text: String
50
50
  }
51
51
 
52
- input ToolResultBlockInput {
53
- content: [ToolResultContentBlockInput!]!
52
+ input AmplifyAIToolResultBlockInput {
53
+ content: [AmplifyAIToolResultContentBlockInput!]!
54
54
  toolUseId: String!
55
55
  status: String
56
56
  }
57
57
 
58
- type DocumentBlockSource {
58
+ type AmplifyAIDocumentBlockSource {
59
59
  bytes: String
60
60
  }
61
61
 
62
- type DocumentBlock {
62
+ type AmplifyAIDocumentBlock {
63
63
  format: String!
64
64
  name: String!
65
- source: DocumentBlockSource!
65
+ source: AmplifyAIDocumentBlockSource!
66
66
  }
67
67
 
68
- type ImageBlock {
68
+ type AmplifyAIImageBlock {
69
69
  format: String!
70
- source: ImageBlockSource!
70
+ source: AmplifyAIImageBlockSource!
71
71
  }
72
72
 
73
- type ImageBlockSource {
73
+ type AmplifyAIImageBlockSource {
74
74
  bytes: String
75
75
  }
76
76
 
77
- type ToolUseBlock {
77
+ type AmplifyAIToolUseBlock {
78
78
  toolUseId: String!
79
79
  name: String!
80
80
  input: AWSJSON!
81
81
  }
82
82
 
83
- type ToolResultContentBlock {
84
- document: DocumentBlock
85
- image: ImageBlock
83
+ type AmplifyAIToolResultContentBlock {
84
+ document: AmplifyAIDocumentBlock
85
+ image: AmplifyAIImageBlock
86
86
  json: AWSJSON
87
87
  text: String
88
88
  }
89
89
 
90
- type ToolResultBlock {
91
- content: [ToolResultContentBlock!]!
90
+ type AmplifyAIToolResultBlock {
91
+ content: [AmplifyAIToolResultContentBlock!]!
92
92
  toolUseId: String!
93
93
  status: String
94
94
  }
95
95
 
96
- type ContentBlockText {
96
+ type AmplifyAIContentBlockText {
97
97
  text: String
98
98
  }
99
99
 
100
- type ContentBlockImage {
101
- image: ImageBlock
100
+ type AmplifyAIContentBlockImage {
101
+ image: AmplifyAIImageBlock
102
102
  }
103
103
 
104
- type ContentBlockDocument {
105
- document: DocumentBlock
104
+ type AmplifyAIContentBlockDocument {
105
+ document: AmplifyAIDocumentBlock
106
106
  }
107
107
 
108
- type ContentBlockToolUse {
109
- toolUse: ToolUseBlock
108
+ type AmplifyAIContentBlockToolUse {
109
+ toolUse: AmplifyAIToolUseBlock
110
110
  }
111
111
 
112
- type ContentBlockToolResult {
113
- toolResult: ToolResultBlock
112
+ type AmplifyAIContentBlockToolResult {
113
+ toolResult: AmplifyAIToolResultBlock
114
114
  }
115
115
 
116
- input ContentBlockInput {
116
+ input AmplifyAIContentBlockInput {
117
117
  text: String
118
- document: DocumentBlockInput
119
- image: ImageBlockInput
120
- toolResult: ToolResultBlockInput
121
- toolUse: ToolUseBlockInput
118
+ document: AmplifyAIDocumentBlockInput
119
+ image: AmplifyAIImageBlockInput
120
+ toolResult: AmplifyAIToolResultBlockInput
121
+ toolUse: AmplifyAIToolUseBlockInput
122
122
  }
123
123
 
124
- type ContentBlock {
124
+ type AmplifyAIContentBlock {
125
125
  text: String
126
- document: DocumentBlock
127
- image: ImageBlock
128
- toolResult: ToolResultBlock
129
- toolUse: ToolUseBlock
126
+ document: AmplifyAIDocumentBlock
127
+ image: AmplifyAIImageBlock
128
+ toolResult: AmplifyAIToolResultBlock
129
+ toolUse: AmplifyAIToolUseBlock
130
130
  }
131
131
 
132
- input ToolConfigurationInput {
133
- tools: [ToolInput]
132
+ input AmplifyAIToolConfigurationInput {
133
+ tools: [AmplifyAIToolInput]
134
134
  }
135
135
 
136
- input ToolInput {
137
- toolSpec: ToolSpecificationInput
136
+ input AmplifyAIToolInput {
137
+ toolSpec: AmplifyAIToolSpecificationInput
138
138
  }
139
139
 
140
- input ToolSpecificationInput {
140
+ input AmplifyAIToolSpecificationInput {
141
141
  name: String!
142
142
  description: String
143
- inputSchema: ToolInputSchemaInput!
143
+ inputSchema: AmplifyAIToolInputSchemaInput!
144
144
  }
145
145
 
146
- input ToolInputSchemaInput {
146
+ input AmplifyAIToolInputSchemaInput {
147
147
  json: AWSJSON
148
148
  }
149
149
 
150
- type ToolConfiguration {
151
- tools: [Tool]
150
+ type AmplifyAIToolConfiguration {
151
+ tools: [AmplifyAITool]
152
152
  }
153
153
 
154
- type Tool {
155
- toolSpec: ToolSpecification
154
+ type AmplifyAITool {
155
+ toolSpec: AmplifyAIToolSpecification
156
156
  }
157
157
 
158
- type ToolSpecification {
158
+ type AmplifyAIToolSpecification {
159
159
  name: String!
160
160
  description: String
161
- inputSchema: ToolInputSchema!
161
+ inputSchema: AmplifyAIToolInputSchema!
162
162
  }
163
163
 
164
- type ToolInputSchema {
164
+ type AmplifyAIToolInputSchema {
165
165
  json: AWSJSON
166
166
  }
167
167
 
168
- type ConversationMessageStreamPart @aws_cognito_user_pools {
168
+ type AmplifyAIConversationMessageStreamPart @aws_cognito_user_pools {
169
169
  id: ID!
170
170
  owner: String
171
171
  conversationId: ID!
@@ -173,13 +173,13 @@ type ConversationMessageStreamPart @aws_cognito_user_pools {
173
173
  contentBlockIndex: Int
174
174
  contentBlockText: String
175
175
  contentBlockDeltaIndex: Int
176
- contentBlockToolUse: ToolUseBlock
176
+ contentBlockToolUse: AmplifyAIToolUseBlock
177
177
  contentBlockDoneAtIndex: Int
178
178
  stopReason: String
179
- errors: [ConversationTurnError]
179
+ errors: [AmplifyAIConversationTurnError]
180
180
  }
181
181
 
182
- type ConversationTurnError @aws_cognito_user_pools {
182
+ type AmplifyAIConversationTurnError @aws_cognito_user_pools {
183
183
  message: String!
184
184
  errorType: String!
185
185
  }`;
@@ -1 +1 @@
1
- {"version":3,"file":"ConversationSchemaGraphQLTypes.mjs","sources":["../../../src/ai/ConversationSchemaGraphQLTypes.ts"],"sourcesContent":["export const CONVERSATION_SCHEMA_GRAPHQL_TYPES = \n/* GraphQL */ `enum ConversationParticipantRole {\n user\n assistant\n}\n\ninterface ConversationMessage {\n id: ID!\n conversationId: ID!\n associatedUserMessageId: ID\n role: ConversationParticipantRole\n content: [ContentBlock]\n aiContext: AWSJSON\n toolConfiguration: ToolConfiguration\n createdAt: AWSDateTime\n updatedAt: AWSDateTime\n owner: String\n}\n\ninput DocumentBlockSourceInput {\n bytes: String\n}\n\ninput DocumentBlockInput {\n format: String!\n name: String!\n source: DocumentBlockSourceInput!\n}\n\ninput ImageBlockSourceInput {\n bytes: String\n}\n\ninput ImageBlockInput {\n format: String!\n source: ImageBlockSourceInput!\n}\n\ninput ToolUseBlockInput {\n toolUseId: String!\n name: String!\n input: AWSJSON!\n}\n\ninput ToolResultContentBlockInput {\n document: DocumentBlockInput\n image: ImageBlockInput\n json: AWSJSON\n text: String\n}\n\ninput ToolResultBlockInput {\n content: [ToolResultContentBlockInput!]!\n toolUseId: String!\n status: String\n}\n\ntype DocumentBlockSource {\n bytes: String\n}\n\ntype DocumentBlock {\n format: String!\n name: String!\n source: DocumentBlockSource!\n}\n\ntype ImageBlock {\n format: String!\n source: ImageBlockSource!\n}\n\ntype ImageBlockSource {\n bytes: String\n}\n\ntype ToolUseBlock {\n toolUseId: String!\n name: String!\n input: AWSJSON!\n}\n\ntype ToolResultContentBlock {\n document: DocumentBlock\n image: ImageBlock\n json: AWSJSON\n text: String\n}\n\ntype ToolResultBlock {\n content: [ToolResultContentBlock!]!\n toolUseId: String!\n status: String\n}\n\ntype ContentBlockText {\n text: String\n}\n\ntype ContentBlockImage {\n image: ImageBlock\n}\n\ntype ContentBlockDocument {\n document: DocumentBlock\n}\n\ntype ContentBlockToolUse {\n toolUse: ToolUseBlock\n}\n\ntype ContentBlockToolResult {\n toolResult: ToolResultBlock\n}\n\ninput ContentBlockInput {\n text: String\n document: DocumentBlockInput\n image: ImageBlockInput\n toolResult: ToolResultBlockInput\n toolUse: ToolUseBlockInput\n}\n\ntype ContentBlock {\n text: String\n document: DocumentBlock\n image: ImageBlock\n toolResult: ToolResultBlock\n toolUse: ToolUseBlock\n}\n\ninput ToolConfigurationInput {\n tools: [ToolInput]\n}\n\ninput ToolInput {\n toolSpec: ToolSpecificationInput\n}\n\ninput ToolSpecificationInput {\n name: String!\n description: String\n inputSchema: ToolInputSchemaInput!\n}\n\ninput ToolInputSchemaInput {\n json: AWSJSON\n}\n\ntype ToolConfiguration {\n tools: [Tool]\n}\n\ntype Tool {\n toolSpec: ToolSpecification\n}\n\ntype ToolSpecification {\n name: String!\n description: String\n inputSchema: ToolInputSchema!\n}\n\ntype ToolInputSchema {\n json: AWSJSON\n}\n\ntype 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}\n\ntype ConversationTurnError @aws_cognito_user_pools {\n message: String!\n errorType: String!\n}`;\n"],"names":[],"mappings":"AAAY,MAAC,iCAAiC;AAC9C,cAAc,CAAC;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;"}
1
+ {"version":3,"file":"ConversationSchemaGraphQLTypes.mjs","sources":["../../../src/ai/ConversationSchemaGraphQLTypes.ts"],"sourcesContent":["export const CONVERSATION_SCHEMA_GRAPHQL_TYPES = \n/* GraphQL */ `enum AmplifyAIConversationParticipantRole {\n user\n assistant\n}\n\ninterface AmplifyAIConversationMessage {\n id: ID!\n conversationId: ID!\n associatedUserMessageId: ID\n role: AmplifyAIConversationParticipantRole\n content: [AmplifyAIContentBlock]\n aiContext: AWSJSON\n toolConfiguration: AmplifyAIToolConfiguration\n createdAt: AWSDateTime\n updatedAt: AWSDateTime\n owner: String\n}\n\ninput AmplifyAIDocumentBlockSourceInput {\n bytes: String\n}\n\ninput AmplifyAIDocumentBlockInput {\n format: String!\n name: String!\n source: AmplifyAIDocumentBlockSourceInput!\n}\n\ninput AmplifyAIImageBlockSourceInput {\n bytes: String\n}\n\ninput AmplifyAIImageBlockInput {\n format: String!\n source: AmplifyAIImageBlockSourceInput!\n}\n\ninput AmplifyAIToolUseBlockInput {\n toolUseId: String!\n name: String!\n input: AWSJSON!\n}\n\ninput AmplifyAIToolResultContentBlockInput {\n document: AmplifyAIDocumentBlockInput\n image: AmplifyAIImageBlockInput\n json: AWSJSON\n text: String\n}\n\ninput AmplifyAIToolResultBlockInput {\n content: [AmplifyAIToolResultContentBlockInput!]!\n toolUseId: String!\n status: String\n}\n\ntype AmplifyAIDocumentBlockSource {\n bytes: String\n}\n\ntype AmplifyAIDocumentBlock {\n format: String!\n name: String!\n source: AmplifyAIDocumentBlockSource!\n}\n\ntype AmplifyAIImageBlock {\n format: String!\n source: AmplifyAIImageBlockSource!\n}\n\ntype AmplifyAIImageBlockSource {\n bytes: String\n}\n\ntype AmplifyAIToolUseBlock {\n toolUseId: String!\n name: String!\n input: AWSJSON!\n}\n\ntype AmplifyAIToolResultContentBlock {\n document: AmplifyAIDocumentBlock\n image: AmplifyAIImageBlock\n json: AWSJSON\n text: String\n}\n\ntype AmplifyAIToolResultBlock {\n content: [AmplifyAIToolResultContentBlock!]!\n toolUseId: String!\n status: String\n}\n\ntype AmplifyAIContentBlockText {\n text: String\n}\n\ntype AmplifyAIContentBlockImage {\n image: AmplifyAIImageBlock\n}\n\ntype AmplifyAIContentBlockDocument {\n document: AmplifyAIDocumentBlock\n}\n\ntype AmplifyAIContentBlockToolUse {\n toolUse: AmplifyAIToolUseBlock\n}\n\ntype AmplifyAIContentBlockToolResult {\n toolResult: AmplifyAIToolResultBlock\n}\n\ninput AmplifyAIContentBlockInput {\n text: String\n document: AmplifyAIDocumentBlockInput\n image: AmplifyAIImageBlockInput\n toolResult: AmplifyAIToolResultBlockInput\n toolUse: AmplifyAIToolUseBlockInput\n}\n\ntype AmplifyAIContentBlock {\n text: String\n document: AmplifyAIDocumentBlock\n image: AmplifyAIImageBlock\n toolResult: AmplifyAIToolResultBlock\n toolUse: AmplifyAIToolUseBlock\n}\n\ninput AmplifyAIToolConfigurationInput {\n tools: [AmplifyAIToolInput]\n}\n\ninput AmplifyAIToolInput {\n toolSpec: AmplifyAIToolSpecificationInput\n}\n\ninput AmplifyAIToolSpecificationInput {\n name: String!\n description: String\n inputSchema: AmplifyAIToolInputSchemaInput!\n}\n\ninput AmplifyAIToolInputSchemaInput {\n json: AWSJSON\n}\n\ntype AmplifyAIToolConfiguration {\n tools: [AmplifyAITool]\n}\n\ntype AmplifyAITool {\n toolSpec: AmplifyAIToolSpecification\n}\n\ntype AmplifyAIToolSpecification {\n name: String!\n description: String\n inputSchema: AmplifyAIToolInputSchema!\n}\n\ntype AmplifyAIToolInputSchema {\n json: AWSJSON\n}\n\ntype AmplifyAIConversationMessageStreamPart @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: AmplifyAIToolUseBlock\n contentBlockDoneAtIndex: Int\n stopReason: String\n errors: [AmplifyAIConversationTurnError]\n}\n\ntype AmplifyAIConversationTurnError @aws_cognito_user_pools {\n message: String!\n errorType: String!\n}`;\n"],"names":[],"mappings":"AAAY,MAAC,iCAAiC;AAC9C,cAAc,CAAC;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;"}
@@ -33,7 +33,7 @@ const createConversationField = (typeDef, typeName) => {
33
33
  ? `, tools: [${getConversationToolsString(tools)}]`
34
34
  : '';
35
35
  const conversationDirective = `@conversation(${argsString}${authString}${handlerString}${toolsString})`;
36
- const field = `${typeName}(conversationId: ID!, content: [ContentBlockInput], aiContext: AWSJSON, toolConfiguration: ToolConfigurationInput): ConversationMessage ${conversationDirective} @aws_cognito_user_pools`;
36
+ const field = `${typeName}(conversationId: ID!, content: [AmplifyAIContentBlockInput], aiContext: AWSJSON, toolConfiguration: AmplifyAIToolConfigurationInput): AmplifyAIConversationMessage ${conversationDirective} @aws_cognito_user_pools`;
37
37
  return { field, functionHandler };
38
38
  };
39
39
  const isRef = (query) => query?.data?.type === 'ref';