-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grounding Web with Gemini Flash 2.0 - google_search field instead of google_search_retrieval #2914
Comments
Possible resolution for issue #2914 The error message indicates that the Here's a plan to address this:
Now, let's execute the plan. Step 1: Retrieve the file content Here's how to modify the C# code: var generateContentRequest = new GenerateContentRequest
{
Model = $"projects/{projectId}/locations/{location}/publishers/{publisher}/models/{model}",
GenerationConfig = new GenerationConfig
{
Temperature = 0.0f
},
Contents =
{
new Content
{
Role = "USER",
Parts = { new Part { Text = "When is the next total solar eclipse in US?" } }
}
},
Tools =
{
new Tool
{
GoogleSearch = new GoogleSearch() // Changed GoogleSearchRetrieval to GoogleSearch
}
}
}; Reasoning: The error message clearly states that the |
…google_search_retrieval GoogleCloudPlatform#2914
Sorry for the late response @fatihyildizhan but I just sent a pull request to show what to change |
I'll close this now. PR should be merged soon. |
Hello,
I get the following error in the grounding web sample with Gemini Flash 2.0. How can I make this request with C# .Net 8?
Thank you for your time.
Error message:
Status(StatusCode="InvalidArgument", Detail="Unable to submit request because Please use google_search field instead of google_search_retrieval field.. Learn more: https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/gemini")
Sample:
https://github.com/GoogleCloudPlatform/dotnet-docs-samples/blob/main/aiplatform/api/AIPlatform.Samples/GroundingWebSample.cs#L57
The text was updated successfully, but these errors were encountered: