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
| public class CustomInferenceBackend(IConfiguration configuration) : IInferenceBackend | |
| { | |
| private readonly OpenAIInferenceBackend openAIInferenceBackend = new OpenAIInferenceBackend(configuration); | |
| public async Task<string> GetChatResponseAsync(ChatParameters options) | |
| { | |
| var resp = await openAIInferenceBackend.GetChatResponseAsync(options); | |
| return resp; | |
| } | |
| } |
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); | |
| }); |
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
| <form> | |
| <SmartComboBox Url="api/list-toys" @bind-Value=@toy /> | |
| </form> | |
| @code { | |
| string? toy; | |
| } |
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
| public class CustomSmartTextAreaInference : SmartTextAreaInference | |
| { | |
| public override ChatParameters BuildPrompt( | |
| SmartTextAreaConfig config, string textBefore, string textAfter) | |
| { | |
| var prompt = base.BuildPrompt(config, textBefore, textAfter); | |
| return prompt; | |
| } | |
| } |
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
| <SmartTextArea @bind-Value="@text" UserRole="@userRole" UserPhrases="@userPhrases"/> | |
| @code { | |
| private string? text; | |
| private string userRole = "HR professional replying to applications for a role"; | |
| private string[] userPhrases = [ | |
| "Thank your for your interest in NEED_INFO", | |
| "We have reviewed your application", | |
| "Unfortunately we have decided not to move forward", |
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
| Hi Gopas, | |
| My name is Akos Nagy. I'm writing to apply for the role AI trainer. I have a master's degree in computer engineering from the Budapest Unviersity of technology and economics and have passed Microsoft AI-900 and AI-102. |
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
| public class CustomSmartPasteInference : SmartPasteInference | |
| { | |
| public override ChatParameters BuildPrompt(SmartPasteRequestData data) | |
| { | |
| var prompt = base.BuildPrompt(data); | |
| return prompt; | |
| } | |
| } |
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
| "SmartComponents": { | |
| "ApiKey": "AWTI4Cdf1YIcfu7SgHbvKdfpmEQkWFs8d8C3lfHXaawAIqq1lXM9JQQJ99BEAC5RqLJXJ3w3AAABACOGMbXv", | |
| "DeploymentName": "gpt-4.1-nano", | |
| "Endpoint": "https://akos.openai.azure.com/" | |
| } |
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
| builder.Services.AddSmartComponents() | |
| .WithInferenceBackend<CustomInferenceBackend>() | |
| .WithAntiforgeryValidation(); |
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
| <EditForm Model="@applyModelSource" OnValidSubmit="SubmitAsync"> | |
| <DataAnnotationsValidator /> | |
| <ValidationSummary /> | |
| <div class="form-group"> | |
| <InputText @bind-Value="applyModelSource.Name" /> | |
| </div> | |
| <div class="form-group"> | |
| <InputText @bind-Value="applyModelSource.Role" /> | |
| </div> |
NewerOlder