Created
May 19, 2025 19:58
-
-
Save conwid/c169d1e7024f9e283f486a41f2bc529c to your computer and use it in GitHub Desktop.
Gist created from visual studio extension
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var embedder = app.Services.GetRequiredService<LocalEmbedder>(); | |
| var toys = embedder.EmbedRange(["lightsaber", "soccer ball", "rc truck"]); | |
| app.MapSmartComboBox("/api/list-toys", | |
| request => | |
| { | |
| LocalEmbedder embedder = request.HttpContext.RequestServices.GetRequiredService<LocalEmbedder>(); | |
| return embedder.FindClosest(request.Query, toys); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment