Skip to content

Commit 0e1c15d

Browse files
committed
bugfix(search-component): display correct currency in product carousel
1 parent 4713bbc commit 0e1c15d

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

clients/search-component/src/TrieveModal/Chat/ResponseMessage.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ export const Message = ({
133133
)
134134
.map((chunk) => ({
135135
chunk,
136+
currencyCode: chunk.metadata?.currency ?? "USD",
136137
title:
137138
chunk.metadata.heading ||
138139
chunk.metadata.title ||
@@ -196,14 +197,17 @@ export const Message = ({
196197
),
197198
}}
198199
/>
199-
{!props.hidePrice && (
200+
{!props.hidePrice && item.price && (
200201
<p
201202
className="ecomm-item-price"
202203
style={{
203204
color: props.brandColor ?? "#CB53EB",
204205
}}
205206
>
206-
${item.price}
207+
{Intl.NumberFormat("en-US", {
208+
style: "currency",
209+
currency: item.currencyCode,
210+
}).format(item.price)}
207211
</p>
208212
)}
209213
{!props.hideChunkHtml && props.showResultHighlights && (

clients/trieve-shopify-extension/app/utils/onboarding.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const DEFAULT_SYSTEM_PROMPT =
1919
"[[personality]]\nYou are a friendly, helpful, and knowledgeable ecommerce sales associate. Your communication style is warm, patient, and enthusiastic without being pushy. You're approachable and conversational while maintaining professionalism. You balance being personable with being efficient, understanding that customers value both connection and their time. You're solution-oriented and genuinely interested in helping customers find the right products for their needs.\n\n[[goal]]\nYour primary goal is to help customers find products that genuinely meet their needs while providing an exceptional shopping experience. You aim to:\n1. Understand customer requirements through thoughtful questions\n2. Provide relevant product recommendations based on customer preferences\n3. Offer detailed, accurate information about products\n4. Address customer concerns and objections respectfully\n5. Guide customers through the purchasing process\n6. Encourage sales without being pushy or manipulative\n7. Create a positive impression that builds long-term customer loyalty\n\n[[response structure]]\n1. Begin with a warm greeting and acknowledgment of the customer's query or concern\n2. Ask clarifying questions if needed to better understand their requirements\n3. Provide concise, relevant information that directly addresses their needs\n4. Include specific product recommendations when appropriate, with brief explanations of why they might be suitable\n5. Address any potential concerns proactively\n6. Close with a helpful next step or question that moves the conversation forward\n7. Keep responses conversational yet efficient, balancing thoroughness with respect for the customer's time.\n";
2020

2121
export const DEFAULT_RAG_PROMPT =
22-
"You may use the retrieved context to help you respond. When discussing products, prioritize information from the provided product data while using your general knowledge to create helpful, natural responses. If a customer asks about products or specifications not mentioned in the context, acknowledge the limitation and offer to check for more information rather than inventing details. Replace the currency name with the currency symbol in the price from the context.";
22+
"You may use the retrieved context to help you respond. When discussing products, prioritize information from the provided product data while using your general knowledge to create helpful, natural responses. If a customer asks about products or specifications not mentioned in the context, acknowledge the limitation and offer to check for more information rather than inventing details.";
2323

2424
export type OnboardingBody = FC<{
2525
goToNextStep: () => void;

server/src/handlers/message_handler.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ pub struct RegenerateMessageReqPayload {
384384
pub no_result_message: Option<String>,
385385
/// Only include docs used in the completion. If not specified, this defaults to false.
386386
pub only_include_docs_used: Option<bool>,
387-
/// The currency to use for the completion. If not specified, this defaults to "USD".
387+
/// The currency symbol to use for the completion. If not specified, this defaults to "$".
388388
pub currency: Option<String>,
389389
/// Search_type can be either "semantic", "fulltext", or "hybrid". "hybrid" will pull in one page (10 chunks) of both semantic and full-text results then re-rank them using scores from a cross encoder model. "semantic" will pull in one page (10 chunks) of the nearest cosine distant vectors. "fulltext" will pull in one page (10 chunks) of full-text results based on SPLADE. Default is "hybrid".
390390
pub search_type: Option<SearchMethod>,
@@ -436,7 +436,7 @@ pub struct EditMessageReqPayload {
436436
pub no_result_message: Option<String>,
437437
/// Only include docs used in the completion. If not specified, this defaults to false.
438438
pub only_include_docs_used: Option<bool>,
439-
/// The currency to use for the completion. If not specified, this defaults to "USD".
439+
/// The currency symbol to use for the completion. If not specified, this defaults to "$".
440440
pub currency: Option<String>,
441441
/// Search_type can be either "semantic", "fulltext", or "hybrid". "hybrid" will pull in one page (10 chunks) of both semantic and full-text results then re-rank them using scores from a cross encoder model. "semantic" will pull in one page (10 chunks) of the nearest cosine distant vectors. "fulltext" will pull in one page (10 chunks) of full-text results based on SPLADE. Default is "hybrid".
442442
pub search_type: Option<SearchMethod>,

0 commit comments

Comments
 (0)