-
Hi, I have started using semantic kernel. I was trying out a simple plugin execution where the plugin takes some extra arguments, but iam getting error:
I dont know what iam doing wrong, my code snippet is attached below. Can someone help me figure out the issue. Thanks in advance.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @jais001, thanks for your question. There's a simple fix for the issue you're encountering. You'll need to make sure your @kernel_function(
description="Takes recipient as list, cc as list as input and sends email",
name="send_email"
)
def send_email(
self,
recipients: Annotated[List[str], "The input is recipients as list"],
cc: Annotated[List[str], "The input is cc as list"]
) -> Annotated[str, "The output is a string"]:
# rest of your logic You're seeing this error because Python is trying to pass the instance of EmailPlugin as an argument (where self should go), but since self is missing, it ends up being treated as an argument for recipients, which causes the conflict. All kernel functions should be valid instance functions. Once you add the
One other tip: if you only want to see the response you can do: result1 = await kernel.invoke_prompt(
function_name="prompt_test1",
plugin_name="report_test1",
prompt=ask,
settings=settings,
)
print(result1) You can get to the chat history of the result by calling |
Beta Was this translation helpful? Give feedback.
Hi @jais001, thanks for your question. There's a simple fix for the issue you're encountering. You'll need to make sure your
send_email
function includes theself
argument in the method definition.You're seeing this error because Python is trying to pass the instance of EmailPlugin as an argum…