-
When using an agent with FunctionChoiceBehavior.Auto(), when chatting with the agent like so: var kernelArgs = new KernelArguments()
{
["Testing"] = "Testing"
};
var response = _agent.InvokeAsync(chatHistory, kernelArgs, cancellationToken: cancellationToken); And if the agent makes a decision to invoke a plugin, public class TimePlugin
{
[KernelFunction("get_time")]
[Description("Get current date and time in utc timezone")]
public DateTime GetTime(KernelArguments kernelArgs)
{
// Demonstrating purposes
var testing = kernelArgs["Testing"]?.ToString();
return DateTime.UtcNow;
}
} Should it pass the kernelArguments to that plugin? Currently it doesn't. Am I doing something wrong or what. Only thing I can use to pass custom data to the plugin is to use kernel.Data, because that does get passed down. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
@markwallace-microsoft can you take a look? |
Beta Was this translation helpful? Give feedback.
-
@tojuasp What type of Agent are you using? |
Beta Was this translation helpful? Give feedback.
-
@crickman what do you think of this request? |
Beta Was this translation helpful? Give feedback.
-
I think I misunderstood a bit how KernelArguments work when trying this out. We ended up using kernel.Data anyway to pass that kind of information around that the LLM doesn't need. At first we were intrigued by the KernelArguments because it seemed like a way to pass information without having to bind it to kernel's lifecycle but then found a fix to our initial bot lifecycle issue that made us look into this in the first place. So for now, this "issue" is not that relevant for us, only in terms of understanding how KernelArguments work. Is there any scenario even that a plugin like this would receive KernelArguments? Are those just something that if the prompt given to the LLM includes some parameters, the LLM would then also provide those back with values as KernelArguments? So in our case, nothing gets injected because our Plugin, when converted to LLM prompt, doesn't actually include any parameters. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the follow-up @tojuasp. Generally, the intent of the |
Beta Was this translation helpful? Give feedback.
Thanks for the follow-up @tojuasp. Generally, the intent of the
KernelArguments
passed to the agent is for it be used for parameterized instructions.