@@ -11,6 +11,7 @@ import {
11
11
import {
12
12
ConversationHandlerFunction ,
13
13
ConversationHandlerFunctionProps ,
14
+ ConversationTurnEventVersion ,
14
15
} from '@aws-amplify/ai-constructs/conversation' ;
15
16
import path from 'path' ;
16
17
import { CallerDirectoryExtractor } from '@aws-amplify/platform-core' ;
@@ -51,9 +52,17 @@ class ConversationHandlerFunctionGenerator
51
52
} ;
52
53
}
53
54
54
- class ConversationHandlerFunctionFactory
55
- implements ConstructFactory < ConversationHandlerFunction >
55
+ export type ConversationHandlerFunctionFactory = ConstructFactory <
56
+ ResourceProvider < FunctionResources >
57
+ > & {
58
+ readonly eventVersion : ConversationTurnEventVersion ;
59
+ } ;
60
+
61
+ class DefaultConversationHandlerFunctionFactory
62
+ implements ConversationHandlerFunctionFactory
56
63
{
64
+ readonly eventVersion : ConversationTurnEventVersion =
65
+ ConversationHandlerFunction . eventVersion ;
57
66
private generator : ConstructContainerEntryGenerator ;
58
67
59
68
constructor (
@@ -121,6 +130,6 @@ export type DefineConversationHandlerFunctionProps = {
121
130
*/
122
131
export const defineConversationHandlerFunction = (
123
132
props : DefineConversationHandlerFunctionProps
124
- ) : ConstructFactory < ResourceProvider < FunctionResources > > =>
133
+ ) : ConversationHandlerFunctionFactory =>
125
134
// eslint-disable-next-line amplify-backend-rules/prefer-amplify-errors
126
- new ConversationHandlerFunctionFactory ( props , new Error ( ) . stack ) ;
135
+ new DefaultConversationHandlerFunctionFactory ( props , new Error ( ) . stack ) ;
0 commit comments