IPromptTemplate.RenderAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Renders the template using the supplied kernel
and arguments
.
public System.Threading.Tasks.Task<string> RenderAsync (Microsoft.SemanticKernel.Kernel kernel, Microsoft.SemanticKernel.KernelArguments? arguments = default, System.Threading.CancellationToken cancellationToken = default);
abstract member RenderAsync : Microsoft.SemanticKernel.Kernel * Microsoft.SemanticKernel.KernelArguments * System.Threading.CancellationToken -> System.Threading.Tasks.Task<string>
Public Function RenderAsync (kernel As Kernel, Optional arguments As KernelArguments = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of String)
Parameters
- kernel
- Kernel
The Kernel containing services, plugins, and other state for use throughout the operation.
- arguments
- KernelArguments
The arguments to use to satisfy any input variables in the prompt template.
- cancellationToken
- CancellationToken
The CancellationToken to monitor for cancellation requests. The default is None.
Returns
The prompt rendered to a string.
Exceptions
kernel
is null.