semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

sk_function.invoke_async(input=context) seems to have an empty prompt

Open Enteli opened this issue 2 years ago • 2 comments

Describe the bug When running this sample, the notebook cell below always returns Hi there! What would you like to talk about? as if the prompt is empty no matter what the user_input is set to

context["user_input"] = "Hi, I'm looking for book suggestions"
bot_answer = await chat_function.invoke_async(input=context)
print(bot_answer)

On the other hand, this works as expected

context["user_input"] = "Hi, I'm looking for book suggestions"
bot_answer = await kernel.run_on_vars_async(context, chat_function)
print(bot_answer)

Therefore something is not right with invoke_async()

To Reproduce Steps to reproduce the behavior:

  1. Go to this sample
  2. Run the 6th cell
  3. Scroll down to
context["user_input"] = "Hi, I'm looking for book suggestions"
bot_answer = await chat_function.invoke_async(input=context)
print(bot_answer)
  1. See the output always being "Hi, I'm looking for book suggestions" no matter what the user_input is set to

Expected behavior An output changing in relation with the user_input

Screenshots If applicable, add screenshots to help explain your problem. Screenshot 2023-04-25 at 9 23 22 PM Desktop (please complete the following information):

  • OS: MacOSX
  • IDE: VS Code, Jupyter Notebook

Additional context Add any other context about the problem here.

Enteli avatar Apr 26 '23 04:04 Enteli

Known issue! A few things, make sure you have the latest code and latest pip. We don't have the run_on_vars_async anymore.

For this example invoke_async needs to be called with variables=context so chat_function.invoke_async(variables=context)

Will update the notebooks soon with this!

alexchaomander avatar Apr 26 '23 07:04 alexchaomander

Closed by https://github.com/microsoft/semantic-kernel/pull/672

awharrison-28 avatar Apr 26 '23 17:04 awharrison-28

Closing due to #672 being done.

evchaki avatar Apr 27 '23 20:04 evchaki