microsoft / semantic-kernel

Integrate cutting-edge LLM technology quickly and easily into your apps
https://aka.ms/semantic-kernel
MIT License
21.82k stars 3.25k forks source link

.Net: Google AI connector throws CORS error in Blazor WebAssembly app #5915

Open AshD opened 6 months ago

AshD commented 6 months ago

Describe the bug Tested the Microsoft.SemanticKernel.Connectors.Google alpha nuget package with a WPF app and it works fine :-) Using it in a Blazor WebAssembly project throws a CORS error. CC @Krzysztof318

To Reproduce Steps to reproduce the behavior:

  1. Create a Blazor WebAssembly project in VS2022 17.9
  2. Add Microsoft.SemanticKernel.Connectors.Google package
  3. Call the Google Gemini API
  4. Throws CORS error - has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Expected behavior Call would succeed since Google Gemini Javascript library works. https://ai.google.dev/tutorials/get_started_web

Platform Blazor WebAssembly .Net 8

github-actions[bot] commented 3 months ago

This issue is stale because it has been open for 90 days with no activity.