Skip to content

Commit 0a62790

Browse files
Merge branch 'development' into 966118-AI
2 parents d29ba0d + 6e0f9a6 commit 0a62790

File tree

3 files changed

+13
-26
lines changed

3 files changed

+13
-26
lines changed

blazor/ai-assistview/assist-view.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,9 @@ The `Prompts` collection stores all the prompts and responses generated.
8181
private async Task PromptRequest(AssistViewPromptRequestedEventArgs args)
8282
{
8383
await Task.Delay(1000);
84-
var isPromptFound = prompts.Any(prompt => prompt.Prompt == args.Prompt);
8584
var promptData = prompts.FirstOrDefault(prompt => prompt.Prompt == args.Prompt);
8685
var defaultResponse = "For real-time prompt processing, connect the AI AssistView component to your preferred AI service, such as OpenAI or Azure Cognitive Services. Ensure you obtain the necessary API credentials to authenticate and enable seamless integration.";
87-
args.Response = isPromptFound ? promptData.Response : defaultResponse;
86+
args.Response = string.IsNullOrEmpty(promptData.Response) ? defaultResponse : promptData.Response;
8887
}
8988
}
9089
@@ -168,10 +167,9 @@ You can customize the appearance of the prompter avatar by using the [PromptIcon
168167
private async Task PromptRequest(AssistViewPromptRequestedEventArgs args)
169168
{
170169
await Task.Delay(1000);
171-
var isPromptFound = prompts.Any(prompt => prompt.Prompt == args.Prompt);
172170
var promptData = prompts.FirstOrDefault(prompt => prompt.Prompt == args.Prompt);
173171
var defaultResponse = "For real-time prompt processing, connect the AI AssistView component to your preferred AI service, such as OpenAI or Azure Cognitive Services. Ensure you obtain the necessary API credentials to authenticate and enable seamless integration.";
174-
args.Response = isPromptFound ? promptData.Response : defaultResponse;
172+
args.Response = string.IsNullOrEmpty(promptData.Response) ? defaultResponse : promptData.Response;
175173
}
176174
}
177175
@@ -199,10 +197,9 @@ You can use the [ResponseIconCss](https://help.syncfusion.com/cr/blazor/Syncfusi
199197
private async Task PromptRequest(AssistViewPromptRequestedEventArgs args)
200198
{
201199
await Task.Delay(1000);
202-
var isPromptFound = prompts.Any(prompt => prompt.Prompt == args.Prompt);
203200
var promptData = prompts.FirstOrDefault(prompt => prompt.Prompt == args.Prompt);
204201
var defaultResponse = "For real-time prompt processing, connect the AI AssistView component to your preferred AI service, such as OpenAI or Azure Cognitive Services. Ensure you obtain the necessary API credentials to authenticate and enable seamless integration.";
205-
args.Response = isPromptFound ? promptData.Response : defaultResponse;
202+
args.Response = string.IsNullOrEmpty(promptData.Response) ? defaultResponse : promptData.Response;
206203
}
207204
}
208205

blazor/ai-assistview/templates.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,9 @@ You can use the [PromptItemTemplate](https://help.syncfusion.com/cr/blazor/Syncf
9898
private async Task PromptRequest(AssistViewPromptRequestedEventArgs args)
9999
{
100100
await Task.Delay(1000);
101-
var isPromptFound = prompts.Any(prompt => prompt.Prompt == args.Prompt);
102101
var promptData = prompts.FirstOrDefault(prompt => prompt.Prompt == args.Prompt);
103102
var defaultResponse = "For real-time prompt processing, connect the AI AssistView component to your preferred AI service, such as OpenAI or Azure Cognitive Services. Ensure you obtain the necessary API credentials to authenticate and enable seamless integration.";
104-
args.Response = isPromptFound ? promptData.Response : defaultResponse;
103+
args.Response = string.IsNullOrEmpty(promptData.Response) ? defaultResponse : promptData.Response;
105104
}
106105
}
107106
<style>
@@ -169,10 +168,9 @@ You can use the [ResponseItemTemplate](https://help.syncfusion.com/cr/blazor/Syn
169168
private async Task PromptRequest(AssistViewPromptRequestedEventArgs args)
170169
{
171170
await Task.Delay(1000);
172-
var isPromptFound = prompts.Any(prompt => prompt.Prompt == args.Prompt);
173171
var promptData = prompts.FirstOrDefault(prompt => prompt.Prompt == args.Prompt);
174172
var defaultResponse = "For real-time prompt processing, connect the AI AssistView component to your preferred AI service, such as OpenAI or Azure Cognitive Services. Ensure you obtain the necessary API credentials to authenticate and enable seamless integration.";
175-
args.Response = isPromptFound ? promptData.Response : defaultResponse;
173+
args.Response = string.IsNullOrEmpty(promptData.Response) ? defaultResponse : promptData.Response;
176174
}
177175
}
178176
<style>

blazor/ai-assistview/toolbar-items.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -397,10 +397,9 @@ In the following example, AI AssistView component rendered with built-in toolbar
397397
private async Task PromptRequest(AssistViewPromptRequestedEventArgs args)
398398
{
399399
await Task.Delay(1000);
400-
var isPromptFound = prompts.Any(prompt => prompt.Prompt == args.Prompt);
401400
var promptData = prompts.FirstOrDefault(prompt => prompt.Prompt == args.Prompt);
402401
var defaultResponse = "For real-time prompt processing, connect the AI AssistView component to your preferred AI service, such as OpenAI or Azure Cognitive Services. Ensure you obtain the necessary API credentials to authenticate and enable seamless integration.";
403-
args.Response = isPromptFound ? promptData.Response : defaultResponse;
402+
args.Response = string.IsNullOrEmpty(promptData.Response) ? defaultResponse : promptData.Response;
404403
}
405404
}
406405
@@ -430,10 +429,9 @@ You can use the [Width](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.
430429
private async Task PromptRequest(AssistViewPromptRequestedEventArgs args)
431430
{
432431
await Task.Delay(1000);
433-
var isPromptFound = prompts.Any(prompt => prompt.Prompt == args.Prompt);
434432
var promptData = prompts.FirstOrDefault(prompt => prompt.Prompt == args.Prompt);
435433
var defaultResponse = "For real-time prompt processing, connect the AI AssistView component to your preferred AI service, such as OpenAI or Azure Cognitive Services. Ensure you obtain the necessary API credentials to authenticate and enable seamless integration.";
436-
args.Response = isPromptFound ? promptData.Response : defaultResponse;
434+
args.Response = string.IsNullOrEmpty(promptData.Response) ? defaultResponse : promptData.Response;
437435
}
438436
}
439437
@@ -461,10 +459,9 @@ You can define [ItemClicked](https://help.syncfusion.com/cr/blazor/Syncfusion.Bl
461459
private async Task PromptRequest(AssistViewPromptRequestedEventArgs args)
462460
{
463461
await Task.Delay(1000);
464-
var isPromptFound = prompts.Any(prompt => prompt.Prompt == args.Prompt);
465462
var promptData = prompts.FirstOrDefault(prompt => prompt.Prompt == args.Prompt);
466463
var defaultResponse = "For real-time prompt processing, connect the AI AssistView component to your preferred AI service, such as OpenAI or Azure Cognitive Services. Ensure you obtain the necessary API credentials to authenticate and enable seamless integration.";
467-
args.Response = isPromptFound ? promptData.Response : defaultResponse;
464+
args.Response = string.IsNullOrEmpty(promptData.Response) ? defaultResponse : promptData.Response;
468465
}
469466
private void ToolbarItemClicked(AssistViewToolbarItemClickedEventArgs args)
470467
{
@@ -496,10 +493,9 @@ In the following example, AI AssistView renders with built-in toolbar items.
496493
private async Task PromptRequest(AssistViewPromptRequestedEventArgs args)
497494
{
498495
await Task.Delay(1000);
499-
var isPromptFound = prompts.Any(prompt => prompt.Prompt == args.Prompt);
500496
var promptData = prompts.FirstOrDefault(prompt => prompt.Prompt == args.Prompt);
501497
var defaultResponse = "For real-time prompt processing, connect the AI AssistView component to your preferred AI service, such as OpenAI or Azure Cognitive Services. Ensure you obtain the necessary API credentials to authenticate and enable seamless integration.";
502-
args.Response = isPromptFound ? promptData.Response : defaultResponse;
498+
args.Response = string.IsNullOrEmpty(promptData.Response) ? defaultResponse : promptData.Response;
503499
}
504500
}
505501
@@ -529,10 +525,9 @@ You can use the [Width](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.
529525
private async Task PromptRequest(AssistViewPromptRequestedEventArgs args)
530526
{
531527
await Task.Delay(1000);
532-
var isPromptFound = prompts.Any(prompt => prompt.Prompt == args.Prompt);
533528
var promptData = prompts.FirstOrDefault(prompt => prompt.Prompt == args.Prompt);
534529
var defaultResponse = "For real-time prompt processing, connect the AI AssistView component to your preferred AI service, such as OpenAI or Azure Cognitive Services. Ensure you obtain the necessary API credentials to authenticate and enable seamless integration.";
535-
args.Response = isPromptFound ? promptData.Response : defaultResponse;
530+
args.Response = string.IsNullOrEmpty(promptData.Response) ? defaultResponse : promptData.Response;
536531
}
537532
}
538533
@@ -560,10 +555,9 @@ You can define [ItemClicked](https://help.syncfusion.com/cr/blazor/Syncfusion.Bl
560555
private async Task PromptRequest(AssistViewPromptRequestedEventArgs args)
561556
{
562557
await Task.Delay(1000);
563-
var isPromptFound = prompts.Any(prompt => prompt.Prompt == args.Prompt);
564558
var promptData = prompts.FirstOrDefault(prompt => prompt.Prompt == args.Prompt);
565559
var defaultResponse = "For real-time prompt processing, connect the AI AssistView component to your preferred AI service, such as OpenAI or Azure Cognitive Services. Ensure you obtain the necessary API credentials to authenticate and enable seamless integration.";
566-
args.Response = isPromptFound ? promptData.Response : defaultResponse;
560+
args.Response = string.IsNullOrEmpty(promptData.Response) ? defaultResponse : promptData.Response;
567561
}
568562
private void ToolbarItemClicked(AssistViewToolbarItemClickedEventArgs args)
569563
{
@@ -603,10 +597,9 @@ You can use the [PromptToolbarItem](https://help.syncfusion.com/cr/blazor/Syncfu
603597
private async Task PromptRequest(AssistViewPromptRequestedEventArgs args)
604598
{
605599
await Task.Delay(1000);
606-
var isPromptFound = prompts.Any(prompt => prompt.Prompt == args.Prompt);
607600
var promptData = prompts.FirstOrDefault(prompt => prompt.Prompt == args.Prompt);
608601
var defaultResponse = "For real-time prompt processing, connect the AI AssistView component to your preferred AI service, such as OpenAI or Azure Cognitive Services. Ensure you obtain the necessary API credentials to authenticate and enable seamless integration.";
609-
args.Response = isPromptFound ? promptData.Response : defaultResponse;
602+
args.Response = string.IsNullOrEmpty(promptData.Response) ? defaultResponse : promptData.Response;
610603
}
611604
}
612605
@@ -643,10 +636,9 @@ You can use the [ResponseToolbarItem](https://help.syncfusion.com/cr/blazor/Sync
643636
private async Task PromptRequest(AssistViewPromptRequestedEventArgs args)
644637
{
645638
await Task.Delay(1000);
646-
var isPromptFound = prompts.Any(prompt => prompt.Prompt == args.Prompt);
647639
var promptData = prompts.FirstOrDefault(prompt => prompt.Prompt == args.Prompt);
648640
var defaultResponse = "For real-time prompt processing, connect the AI AssistView component to your preferred AI service, such as OpenAI or Azure Cognitive Services. Ensure you obtain the necessary API credentials to authenticate and enable seamless integration.";
649-
args.Response = isPromptFound ? promptData.Response : defaultResponse;
641+
args.Response = string.IsNullOrEmpty(promptData.Response) ? defaultResponse : promptData.Response;
650642
}
651643
}
652644

0 commit comments

Comments
 (0)