You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Products/ProductsPage.razor.cs
Copy file name to clipboardExpand all lines: src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Products/ProductController.cs
+4-6Lines changed: 4 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ public partial class ProductController : AppControllerBase, IProductController
ignoreQueryOptions:AllowedQueryOptions.Top|AllowedQueryOptions.Skip|AllowedQueryOptions.OrderBy/* Ordering can disrupt the results of the embedding service. */);
Copy file name to clipboardExpand all lines: src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/Chatbot/SystemPromptConfiguration.cs
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -174,7 +174,8 @@ These are the primary functional areas of the application beyond account managem
174
174
- If the user asks multiple questions, list them back to the user to confirm understanding, then address each one separately with clear headings. If needed, ask them to prioritize: ""I see you have multiple questions. Which issue would you like me to address first?""
175
175
176
176
- Never request sensitive information (e.g., passwords, PINs). If a user shares such data unsolicited, respond: ""For your security, please don't share sensitive information like passwords. Rest assured, your data is safe with us."" "+
* **If a user asks for help choosing a car, for recommendations, or expresses purchase intent (e.g., ""looking for an SUV"", ""recommend a car for me"", ""what sedans do you have under $50k?""):**
@@ -195,6 +196,7 @@ These are the primary functional areas of the application beyond account managem
Copy file name to clipboardExpand all lines: src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/Configurations/Product/ProductConfiguration.cs
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,12 @@ public void Configure(EntityTypeBuilder<Product> builder)
Copy file name to clipboardExpand all lines: src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Services/ProductEmbeddingService.cs
/// 3- Vector-based search using embeddings (e.g., using OpenAI's embeddings).
14
-
/// This service implements vector-based search using embeddings that has the following advantages:
15
-
/// - More accurate search results based on semantic meaning rather than just similarity matching.
16
-
/// - Multi-language support, as embeddings can capture the meaning of words across different languages.
17
-
/// And has the following disadvantages:
18
-
/// - Requires additional processing to generate embeddings for the text.
19
-
/// - Require more storage space for embeddings compared to simple text search.
20
-
/// The simple full-text search would be enough for product search case, but we have implemented the vector-based search to demonstrate how to use embeddings in the project.
14
+
/// 4- Hybrid approach combining full-text search and vector-based search.
15
+
/// The vector-based search is overkill for products search, but we implemented it here so you can see how to implement it in case you need it for other scenarios.
// The RAG has been implemented for PostgreSQL / SQL Server only. Check out https://github.com/bitfoundation/bitplatform/blob/develop/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Services/ProductEmbeddingService.cs
thrownewInvalidOperationException("Embeddings are not enabled. Please enable them to use this feature.");
28
+
29
+
// It would be a good idea to try finding products using full-text search first, and if not enough results are found, then use the vector-based search.
30
+
// Note that test products data that have been seeded do not have embeddings, so searching for them will not return any results.
0 commit comments