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

The sample is not working as intended. (Example07_BingAndGoogleSkills)

Open birdnamoo opened this issue 3 years ago • 2 comments

Describe the bug When running the Example07_BingAndGoogleSkills example in KernelSyntaxExamples, I get an incorrect result...

To Reproduce

  1. Run Example07_BingAndGoogleSkills Project
  2. Step Example2Async Method

** Result Console **

======== Bing and Google Search Skill ========
What's the largest building in the world?
----
Historically, the world's tallest man-made structure was the Great Pyramid of Giza in Egypt, which ...
----
======== Use Search Skill to answer user questions ========
Who is the most followed person on TikTok right now? What's the exchange rate EUR:USD?
---- Fetching information from Bing...
Information found:

반의어: answer. 참조: 함께 사용되는 동사 : [동사 + question] ask (sb) | have | address, put | bombard sb with, fire | frame, phrase | face | answer, reply to, respond to | do (used only about written questions) | field | avoid, dodge, evade, ignore. If you have any questions, please let me know. 질문이 있으시면, 저에게 ....
warn: object[0]
      Function _GLOBAL_FUNCTIONS_.funccfde0e2bde40429face53e4eefb8dc26 has been invoked with an explicit input text that is different and overrides the input text defined in the context

birdnamoo avatar Jun 13 '23 02:06 birdnamoo

I see 2 things going on locally. First, is that the LLM reponse for the first call is \n{{ bing.search \"Question\" }}. which seems incorrect. Second, SKFunctionExtensions.InvokeAsync seems to be ignoring the input given to itself by default.

lemillermicrosoft avatar Jun 13 '23 14:06 lemillermicrosoft

Passing in the input as part of the context here worked for me: https://github.com/microsoft/semantic-kernel/blob/f8d9e84e39af8d7dbc7ab7f5e4aac3ba8216a5f7/dotnet/samples/KernelSyntaxExamples/Example07_BingAndGoogleSkills.cs#L112 context["input"] = questions;

Now the semantic function is being successfully generated with the question from input and I am able to get results:

vman avatar Jun 21 '23 15:06 vman