File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55
66import dotnet from 'node-api-dotnet' ;
77import './bin/Microsoft.SemanticKernel.Core.js' ;
8+ import './bin/Microsoft.SemanticKernel.Functions.Semantic.js' ;
89import './bin/Microsoft.SemanticKernel.Connectors.AI.OpenAI.js' ;
910
10- // The PromptTemplateEngine assembly must be explicitly loaded here, because
11- // SK KernelBuilder uses Assembly.Load() to load it, and that is not detected
12- // by the JS exporter.
13- import './bin/Microsoft.SemanticKernel.TemplateEngine.PromptTemplateEngine.js' ;
14-
1511const SK = dotnet . Microsoft . SemanticKernel ;
1612const Logging = dotnet . Microsoft . Extensions . Logging ;
1713
@@ -56,9 +52,10 @@ does not conflict with the First or Second Law.
5652` ;
5753
5854// The JS marshaller does not yet support extension methods.
59- const summaryFunction = SK . InlineFunctionsDefinitionExtension
55+ const summaryFunction = SK . KernelSemanticFunctionExtensions
6056 . CreateSemanticFunction ( kernel , skPrompt ) ;
6157
62- const summary = await SK . SKFunctionExtensions . InvokeAsync ( summaryFunction , textToSummarize ) ;
58+ const summary = await SK . SKFunctionExtensions . InvokeAsync (
59+ summaryFunction , textToSummarize , kernel ) ;
6360
6461console . log ( summary . toString ( ) ) ;
Original file line number Diff line number Diff line change 99 </PropertyGroup >
1010
1111 <ItemGroup >
12- <PackageReference Include =" Microsoft.SemanticKernel" Version =" 0.24.230918.1-preview " />
12+ <PackageReference Include =" Microsoft.SemanticKernel" Version =" 1.0.0-beta2 " />
1313 <PackageReference Include =" Microsoft.JavaScript.NodeApi.Generator" Version =" 0.4.*-*" />
1414 </ItemGroup >
1515
Original file line number Diff line number Diff line change @@ -159,8 +159,7 @@ internal static bool IsConvertedType(Type type)
159159 }
160160
161161 if ( type . IsGenericTypeDefinition &&
162- ( type == typeof ( Task < > ) ||
163- type == typeof ( CancellationToken ) ||
162+ ( type == typeof ( CancellationToken ) ||
164163 type == typeof ( IEnumerable < > ) ||
165164 type == typeof ( IAsyncEnumerable < > ) ||
166165 type == typeof ( ICollection < > ) ||
Original file line number Diff line number Diff line change @@ -172,6 +172,7 @@ void ExportTypeIfSupported(Type dependencyType)
172172 {
173173 Type genericTypeDefinition = dependencyType . GetGenericTypeDefinition ( ) ;
174174 if ( genericTypeDefinition == typeof ( Nullable < > ) ||
175+ genericTypeDefinition == typeof ( Task < > ) ||
175176 genericTypeDefinition . Namespace == typeof ( IList < > ) . Namespace )
176177 {
177178 foreach ( Type typeArg in dependencyType . GetGenericArguments ( ) )
@@ -217,6 +218,8 @@ void ExportTypeIfSupported(Type dependencyType)
217218 {
218219 ExportTypeIfSupported( interfaceMethodParameter . ParameterType ) ;
219220 }
221+
222+ ExportTypeIfSupported( interfaceMethod . ReturnType ) ;
220223 }
221224 }
222225 }
You can’t perform that action at this time.
0 commit comments