semantic-kernel
semantic-kernel copied to clipboard
fix issue 508
Motivation and Context
fix issue #508
Description
WebSearch Results using the Bing Connector has a hard code value of count=1.
We need to return more than 1 result or should be able to pass count of result requested
Contribution Checklist
The code builds clean without any errors or warnings The PR follows SK Contribution Guidelines (https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) The code follows the .NET coding conventions (https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions) verified with dotnet format All unit tests pass, and I have added new tests where possible I didn't break anyone 😄
Instead of
string resultString;
if (countInt == 1)
{
resultString = results.FirstOrDefault() ?? string.Empty;
}
else
{
resultString = JsonSerializer.Serialize(results);
}
return resultString;
you could do something like
return countInt == 1
? results.FirstOrDefault() ?? string.Empty
: JsonSerializer.Serialize(results);
LGTM - please resolve conflicts and we'll bring it in.
Merged from main, updated Google connector too, as common interface changes require it.
Do you have new nuget package for this fix. I downloaded the code locally and trying to run it from a console app adding local references and it is giving me build code.
trying to test this through a console app. As latest Nuget is not available for this issue. Adding local project references to the DLL. It is not working . Getting errors when trying to run it.