@aws-amplify/data-schema 1.9.1 → 1.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/SchemaProcessor.js +3 -1
- package/dist/cjs/SchemaProcessor.js.map +1 -1
- package/dist/cjs/ai/ConversationSchemaTypes.js +6 -7
- package/dist/cjs/ai/ConversationSchemaTypes.js.map +1 -1
- package/dist/esm/SchemaProcessor.mjs +3 -1
- package/dist/esm/SchemaProcessor.mjs.map +1 -1
- package/dist/esm/ai/ConversationSchemaTypes.d.ts +5 -1
- package/dist/esm/ai/ConversationSchemaTypes.mjs +6 -7
- package/dist/esm/ai/ConversationSchemaTypes.mjs.map +1 -1
- package/dist/esm/ai/ConversationType.d.ts +1 -1
- package/dist/meta/cjs.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/SchemaProcessor.ts +3 -1
- package/src/ai/ConversationSchemaTypes.ts +8 -7
- package/src/ai/ConversationType.ts +1 -1
|
@@ -15,13 +15,11 @@ const createConversationField = (typeDef, typeName) => {
|
|
|
15
15
|
// It doesn't affect non multi-line string inputs for system prompts
|
|
16
16
|
systemPrompt: systemPrompt.replace(/\r?\n/g, '\\n'),
|
|
17
17
|
};
|
|
18
|
+
const functionHandler = {};
|
|
18
19
|
if (handler) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
else if (typeof handler.getInstance === 'function') {
|
|
23
|
-
args['functionName'] = `Fn${capitalize(typeName)}`;
|
|
24
|
-
}
|
|
20
|
+
const functionName = `Fn${capitalize(typeName)}`;
|
|
21
|
+
args['functionName'] = functionName;
|
|
22
|
+
functionHandler[functionName] = handler;
|
|
25
23
|
}
|
|
26
24
|
const argsString = Object.entries(args)
|
|
27
25
|
.map(([key, value]) => `${key}: "${value}"`)
|
|
@@ -30,7 +28,8 @@ const createConversationField = (typeDef, typeName) => {
|
|
|
30
28
|
? `, tools: [${getConversationToolsString(tools)}]`
|
|
31
29
|
: '';
|
|
32
30
|
const conversationDirective = `@conversation(${argsString}${toolsString})`;
|
|
33
|
-
|
|
31
|
+
const field = `${typeName}(conversationId: ID!, content: [ContentBlockInput], aiContext: AWSJSON, toolConfiguration: ToolConfigurationInput): ConversationMessage ${conversationDirective} @aws_cognito_user_pools`;
|
|
32
|
+
return { field, functionHandler };
|
|
34
33
|
};
|
|
35
34
|
const isRef = (query) => query?.data?.type === 'ref';
|
|
36
35
|
const getConversationToolsString = (tools) => tools
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationSchemaTypes.mjs","sources":["../../../src/ai/ConversationSchemaTypes.ts"],"sourcesContent":["import { capitalize } from '../runtime/utils';\nexport const 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 if (handler) {\n if (typeof handler === 'string') {\n args['functionName'] = handler;\n }\n else if (typeof handler.getInstance === 'function') {\n args['functionName'] = `Fn${capitalize(typeName)}`;\n }\n }\n const argsString = Object.entries(args)\n .map(([key, value]) => `${key}: \"${value}\"`)\n .join(', ');\n const toolsString = tools?.length\n ? `, tools: [${getConversationToolsString(tools)}]`\n : '';\n const conversationDirective = `@conversation(${argsString}${toolsString})`;\n return `${typeName}(conversationId: ID!, content: [ContentBlockInput], aiContext: AWSJSON, toolConfiguration: ToolConfigurationInput): ConversationMessage ${conversationDirective} @aws_cognito_user_pools`;\n};\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}`;\nexport const conversationTypes = [\n ConversationParticipantRole,\n ConversationMessage,\n DocumentBlockSourceInput,\n DocumentBlockInput,\n ImageBlockSourceInput,\n ImageBlockInput,\n ToolUseBlockInput,\n ToolResultContentBlockInput,\n ToolResultBlockInput,\n DocumentBlockSource,\n DocumentBlock,\n ImageBlock,\n ImageBlockSource,\n ToolUseBlock,\n ToolResultContentBlock,\n ToolResultBlock,\n ContentBlockText,\n ContentBlockImage,\n ContentBlockDocument,\n ContentBlockToolUse,\n ContentBlockToolResult,\n ContentBlockInput,\n ContentBlock,\n ToolConfigurationInput,\n ToolInput,\n ToolSpecificationInput,\n ToolInputSchemaInput,\n ToolConfiguration,\n Tool,\n ToolSpecification,\n ToolInputSchema,\n];\n"],"names":[],"mappings":";;AACY,MAAC,uBAAuB,GAAG,CAAC,OAAO,EAAE,QAAQ,KAAK;AAC9D,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,IAAI,OAAO,EAAE;AACjB,QAAQ,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;AACzC,YAAY,IAAI,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC;AAC3C,SAAS;AACT,aAAa,IAAI,OAAO,OAAO,CAAC,WAAW,KAAK,UAAU,EAAE;AAC5D,YAAY,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AAC/D,SAAS;AACT,KAAK;AACL,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,WAAW,GAAG,KAAK,EAAE,MAAM;AACrC,UAAU,CAAC,UAAU,EAAE,0BAA0B,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC3D,UAAU,EAAE,CAAC;AACb,IA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GAAG,CAAC;AACnB;AACA,CAAC,CAAC,CAAC;AACH,MAAM,sBAAsB,GAAG,CAAC;AAChC;AACA;AACA;AACA,CAAC,CAAC,CAAC;AACH,MAAM,oBAAoB,GAAG,CAAC;AAC9B;AACA,CAAC,CAAC,CAAC;AACH,MAAM,iBAAiB,GAAG,CAAC;AAC3B;AACA,CAAC,CAAC,CAAC;AACH,MAAM,IAAI,GAAG,CAAC;AACd;AACA,CAAC,CAAC,CAAC;AACH,MAAM,iBAAiB,GAAG,CAAC;AAC3B;AACA;AACA;AACA,CAAC,CAAC,CAAC;AACH,MAAM,eAAe,GAAG,CAAC;AACzB;AACA,CAAC,CAAC,CAAC;AACS,MAAC,iBAAiB,GAAG;AACjC,IAAI,2BAA2B;AAC/B,IAAI,mBAAmB;AACvB,IAAI,wBAAwB;AAC5B,IAAI,kBAAkB;AACtB,IAAI,qBAAqB;AACzB,IAAI,eAAe;AACnB,IAAI,iBAAiB;AACrB,IAAI,2BAA2B;AAC/B,IAAI,oBAAoB;AACxB,IAAI,mBAAmB;AACvB,IAAI,aAAa;AACjB,IAAI,UAAU;AACd,IAAI,gBAAgB;AACpB,IAAI,YAAY;AAChB,IAAI,sBAAsB;AAC1B,IAAI,eAAe;AACnB,IAAI,gBAAgB;AACpB,IAAI,iBAAiB;AACrB,IAAI,oBAAoB;AACxB,IAAI,mBAAmB;AACvB,IAAI,sBAAsB;AAC1B,IAAI,iBAAiB;AACrB,IAAI,YAAY;AAChB,IAAI,sBAAsB;AAC1B,IAAI,SAAS;AACb,IAAI,sBAAsB;AAC1B,IAAI,oBAAoB;AACxB,IAAI,iBAAiB;AACrB,IAAI,IAAI;AACR,IAAI,iBAAiB;AACrB,IAAI,eAAe;AACnB;;;;"}
|
|
1
|
+
{"version":3,"file":"ConversationSchemaTypes.mjs","sources":["../../../src/ai/ConversationSchemaTypes.ts"],"sourcesContent":["import { capitalize } from '../runtime/utils';\nexport const 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 functionHandler = {};\n if (handler) {\n const functionName = `Fn${capitalize(typeName)}`;\n args['functionName'] = functionName;\n functionHandler[functionName] = handler;\n }\n const argsString = Object.entries(args)\n .map(([key, value]) => `${key}: \"${value}\"`)\n .join(', ');\n const toolsString = tools?.length\n ? `, tools: [${getConversationToolsString(tools)}]`\n : '';\n const conversationDirective = `@conversation(${argsString}${toolsString})`;\n const field = `${typeName}(conversationId: ID!, content: [ContentBlockInput], aiContext: AWSJSON, toolConfiguration: ToolConfigurationInput): ConversationMessage ${conversationDirective} @aws_cognito_user_pools`;\n return { field, functionHandler };\n};\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}`;\nexport const conversationTypes = [\n ConversationParticipantRole,\n ConversationMessage,\n DocumentBlockSourceInput,\n DocumentBlockInput,\n ImageBlockSourceInput,\n ImageBlockInput,\n ToolUseBlockInput,\n ToolResultContentBlockInput,\n ToolResultBlockInput,\n DocumentBlockSource,\n DocumentBlock,\n ImageBlock,\n ImageBlockSource,\n ToolUseBlock,\n ToolResultContentBlock,\n ToolResultBlock,\n ContentBlockText,\n ContentBlockImage,\n ContentBlockDocument,\n ContentBlockToolUse,\n ContentBlockToolResult,\n ContentBlockInput,\n ContentBlock,\n ToolConfigurationInput,\n ToolInput,\n ToolSpecificationInput,\n ToolInputSchemaInput,\n ToolConfiguration,\n Tool,\n ToolSpecification,\n ToolInputSchema,\n];\n"],"names":[],"mappings":";;AACY,MAAC,uBAAuB,GAAG,CAAC,OAAO,EAAE,QAAQ,KAAK;AAC9D,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,CAA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A2B;AAC/B,IAAI,mBAAmB;AACvB,IAAI,wBAAwB;AAC5B,IAAI,kBAAkB;AACtB,IAAI,qBAAqB;AACzB,IAAI,eAAe;AACnB,IAAI,iBAAiB;AACrB,IAAI,2BAA2B;AAC/B,IAAI,oBAAoB;AACxB,IAAI,mBAAmB;AACvB,IAAI,aAAa;AACjB,IAAI,UAAU;AACd,IAAI,gBAAgB;AACpB,IAAI,YAAY;AAChB,IAAI,sBAAsB;AAC1B,IAAI,eAAe;AACnB,IAAI,gBAAgB;AACpB,IAAI,iBAAiB;AACrB,IAAI,oBAAoB;AACxB,IAAI,mBAAmB;AACvB,IAAI,sBAAsB;AAC1B,IAAI,iBAAiB;AACrB,IAAI,YAAY;AAChB,IAAI,sBAAsB;AAC1B,IAAI,SAAS;AACb,IAAI,sBAAsB;AAC1B,IAAI,oBAAoB;AACxB,IAAI,iBAAiB;AACrB,IAAI,IAAI;AACR,IAAI,iBAAiB;AACrB,IAAI,eAAe;AACnB;;;;"}
|
|
@@ -95,7 +95,7 @@ export interface ConversationInput {
|
|
|
95
95
|
systemPrompt: string;
|
|
96
96
|
inferenceConfiguration?: InferenceConfiguration;
|
|
97
97
|
tools?: ToolDefinition[];
|
|
98
|
-
handler?: DefineFunction
|
|
98
|
+
handler?: DefineFunction;
|
|
99
99
|
}
|
|
100
100
|
export interface InternalConversationType extends ConversationType, ConversationInput {
|
|
101
101
|
}
|