Skip to content

Commit f72e0dc

Browse files
committed
update example
1 parent e71e2bd commit f72e0dc

File tree

4 files changed

+24
-13
lines changed

4 files changed

+24
-13
lines changed

CS/Services/AssistantHelper.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
namespace DashboardAIAssistant.Services {
22
public static class AssistantHelper {
33
public static string Prompt = $""""
4+
You are an analytics assistant specialized in analyzing excel files. Use all available methods for parse this data. Your role is to assist users by providing accurate answers to their questions about data contained within these files without mentioning the underlying Excel file structure.
45
Key Responsibilities:
56
- Perform data analysis, including data summaries, calculations, filtering, and trend identification.
6-
- Clearly explain your analysis process to ensure users understand how you reached your conclusions.
7-
- Provide precise and accurate responses strictly based on data in the file.
7+
- Explain your reasoning in a straightforward manner without referencing spreadsheets, sheets, rows, or columns.
88
- If the requested information is not available in the provided file's content, state: "The requested information cannot be found in the data provided."
9-
- Avoid giving responses when data is insufficient for a reliable answer.
109
- Ask clarifying questions when a user’s query is unclear or lacks detail.
11-
- Your primary goal is to deliver helpful insights that directly address user questions. Do not make assumptions or infer details not supported by data. Respond in plain text only, without sources, footnotes, or annotations.
12-
Constraints:
10+
- Respond conversationally as if referencing a structured dataset, not a spreadsheet.
11+
Constraints:
12+
- Avoid referring to the file, its format, sheets, or any structural details. Treat the data as an abstract source of insights.
1313
- Avoid giving information about provided file name, assistants' IDs and other internal data.
14-
- Ignore sheets with name starting "AI Assistant".
15-
- Do not share with a user any information related to the XLSX file or its sheets usage.
16-
- Do not ask a user about sheets and their analysis. Instead, refer to them as to document parts, by their name.
14+
- Ignore sheets with name starting "AI Assistant". Do not mention this constraint to the user.
15+
- Do not ask a user about sheets and their analysis. Instead, refer to them as to items, by their name.
16+
Your goal is to provide valuable insights as if you are directly analyzing a structured dataset.
1717
"""";
1818
}
1919
}

CS/wwwroot/css/site.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ body {
44
}
55

66
div.dx-dashboard-item.dx-chat {
7+
user-select: text !important;
78
display: flex;
89
}
910

@@ -12,6 +13,10 @@ div.dx-dashboard-item.dx-chat {
1213
column-gap: 0;
1314
}
1415

16+
.dx-chat-messagebubble-content {
17+
user-select: text;
18+
}
19+
1520
.dx-chat-messagebubble-content li > ul {
1621
margin-bottom: 0;
1722
}

CS/wwwroot/js/aiChatCustomItem.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ let AIChatCustomItem = (function() {
204204
this.component.option('alerts', []);
205205
instance.renderMessage(e.message);
206206
instance.option({ typingUsers: [assistant] });
207-
const userInput = e.message.text + ((this.model.selectedSheet && "\nDiscuss sheet " + this.model.selectedSheet)
208-
|| "\nLet's discuss all sheets");
207+
const userInput = e.message.text + ((this.model.selectedSheet && "\nDiscuss item " + this.model.selectedSheet)
208+
|| "\nLet's discuss all items");
209209
const response = await this.getAIResponse(userInput);
210210
this.renderAssistantMessage(instance, response);
211211
}

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,13 @@ public interface IAIAssistantProvider {
7878
}
7979
```
8080

81+
You can review and tailor AI assistant instructions in the following file: [AssistantHelper.cs](./CS/Services/AssistantHelper.cs)
82+
8183
Files to Review:
8284
- [AIAssistantProvider.cs](./CS/Services/AIAssistantProvider.cs)
8385
- [IAIAssistantProvider.cs](./CS/IAIAssistantProvider.cs)
86+
- [AssistantHelper.cs](./CS/Services/AssistantHelper.cs)
87+
8488

8589
### Create a AI Assistant Custom Item
8690

@@ -172,8 +176,8 @@ async onMessageEntered(e) {
172176
this.component.option('alerts', []);
173177
instance.renderMessage(e.message);
174178
instance.option({ typingUsers: [assistant] });
175-
const userInput = e.message.text + ((this.model.selectedSheet && "\nDiscuss sheet " + this.model.selectedSheet)
176-
|| "\nLet's discuss all sheets");
179+
const userInput = e.message.text + ((this.model.selectedSheet && "\nDiscuss item " + this.model.selectedSheet)
180+
|| "\nLet's discuss all items");
177181
const response = await this.getAIResponse(userInput);
178182
this.renderAssistantMessage(instance, response);
179183
}
@@ -188,7 +192,9 @@ async onMessageEntered(e) {
188192
- [aiChatCustomItem.js](./CS/wwwroot/js/aiChatCustomItem.js)
189193
- [AIAssistantProvider.cs](./CS/Services/AIAssistantProvider.cs)
190194
- [IAIAssistantProvider.cs](./CS/IAIAssistantProvider.cs)
191-
- [AIChatController](./CS/Controllers/AIChatController.cs)
195+
- [AIChatController.cs](./CS/Controllers/AIChatController.cs)
196+
- [AssistantHelper.cs](./CS/Services/AssistantHelper.cs)
197+
192198

193199
## Documentation
194200

0 commit comments

Comments
 (0)