.Net Bug: Google Connector with Nullable Enum in Plugin Call - Bad Request #11395
Labels
ai connector
Anything related to AI connectors
bug
Something isn't working
.NET
Issue or Pull requests regarding .NET code
Describe the bug
I was troubleshooting a scenario where I was getting bad request responses from my custom Semantic Kernel plugin when using the Google connector. The plugin works fine with Open AI. One of the arguments on the method is a nullable
enum
type. If I changed this to no longer be nullable. E.g. instead of aRemoteWork?
enum I just useRemoteWork
the function call goes through fine.To Reproduce
Steps to reproduce the behavior:
enum
type as a method argument, and allow it to benull
(with the default value ofnull
)await chatCompletionService.GetChatMessageContentAsync
from theIChatCompletionService
implementation will fail with a 400 bad request. Looking at the response content from Google you get the below error.{
"error": {
"code": 400,
"message": "* GenerateContentRequest.tools[0].function_declarations[0].parameters.properties[remoteWork].enum: only allowed for STRING type\n* GenerateContentRequest.tools[0].function_declarations[0].parameters.properties[remoteWork].type: must be specified when not using one_of, any_of or all_of fields\n",
"status": "INVALID_ARGUMENT"
}
}
Expected behavior
You should be able to pass in nullable enum parameters and have them parsed correctly by the plugin.
Platform
Additional context
Was initially discussed in the Azure AI Community Discord - conversation starts here.
The text was updated successfully, but these errors were encountered: