KernelArguments Class
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.
Provides a collection of arguments for operations such as KernelFunction's InvokeAsync and IPromptTemplate's RenderAsync.
public sealed class KernelArguments : System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<string,object>>, System.Collections.Generic.IDictionary<string,object>, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,object>>, System.Collections.Generic.IReadOnlyCollection<System.Collections.Generic.KeyValuePair<string,object>>, System.Collections.Generic.IReadOnlyDictionary<string,object>
type KernelArguments = class
interface IDictionary<string, obj>
interface ICollection<KeyValuePair<string, obj>>
interface seq<KeyValuePair<string, obj>>
interface IEnumerable
interface IReadOnlyDictionary<string, obj>
interface IReadOnlyCollection<KeyValuePair<string, obj>>
Public NotInheritable Class KernelArguments
Implements ICollection(Of KeyValuePair(Of String, Object)), IDictionary(Of String, Object), IEnumerable(Of KeyValuePair(Of String, Object)), IReadOnlyCollection(Of KeyValuePair(Of String, Object)), IReadOnlyDictionary(Of String, Object)
- Inheritance
-
KernelArguments
- Implements
-
ICollection<KeyValuePair<String,Object>> ICollection<KeyValuePair<TKey,TValue>> IDictionary<String,Object> IEnumerable<KeyValuePair<String,Object>> IEnumerable<KeyValuePair<TKey,TValue>> IEnumerable<T> IReadOnlyCollection<KeyValuePair<String,Object>> IReadOnlyCollection<KeyValuePair<TKey,TValue>> IReadOnlyDictionary<String,Object> IEnumerable
Remarks
A KernelArguments is a dictionary of argument names and values. It also carries a PromptExecutionSettings, accessible via the ExecutionSettings property.
Constructors
| Name | Description |
|---|---|
| KernelArguments() |
Initializes a new instance of the KernelArguments class with the specified AI execution settings. |
| KernelArguments(IDictionary<String,Object>, Dictionary<String,PromptExecutionSettings>) |
Initializes a new instance of the KernelArguments class that contains elements copied from the specified IDictionary<TKey,TValue>. |
| KernelArguments(IEnumerable<PromptExecutionSettings>) |
Initializes a new instance of the KernelArguments class with the specified AI execution settings. |
| KernelArguments(PromptExecutionSettings) |
Initializes a new instance of the KernelArguments class with the specified AI execution settings. |
Properties
| Name | Description |
|---|---|
| Count |
Gets the number of arguments contained in the KernelArguments. |
| ExecutionSettings |
Gets or sets the prompt execution settings. |
| Item[String] |
Gets or sets the value associated with the specified argument name. |
| Names |
Gets an ICollection<T> of all of the arguments' names. |
| Values |
Gets an ICollection<T> of all of the arguments' values. |
Methods
| Name | Description |
|---|---|
| Add(String, Object) |
Adds the specified argument name and value to the KernelArguments. |
| Clear() |
Removes all arguments names and values from the KernelArguments. |
| ContainsName(String) |
Determines whether the KernelArguments contains an argument with the specified name. |
| Remove(String) |
Removes the argument value with the specified name from the KernelArguments. |
| TryGetValue(String, Object) |
Gets the value associated with the specified argument name. |
Explicit Interface Implementations
Extension Methods
| Name | Description |
|---|---|
| ContinueLoop(KernelArguments) |
Signal the orchestrator to go to the next iteration of the loop in the AtLeastOnce or ZeroOrMore step. |
| ExitLoop(KernelArguments, String) |
Signal the orchestrator to exit out of the AtLeastOnce or ZeroOrMore loop. If response is non-null, that value will be outputted to the user. |
| GetChatHistory(KernelArguments) |
Get ChatHistory from context. |
| GetChatInput(KernelArguments) |
Get latest chat input from context. |
| IsComplete(KernelArguments, Flow) |
Check if all arguments to be provided with the flow is available in the context |
| IsTerminateFlow(KernelArguments) |
Check if we should terminate flow based on current context. |
| PromptInput(KernelArguments) |
Signal the orchestrator to prompt user for input with current function response. |
| TerminateFlow(KernelArguments) |
Signal the orchestrator to terminate the flow. |