Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
28 changes: 20 additions & 8 deletions src/api/api.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@

export const getAIMessage = async (userQuery) => {
const q = userQuery.toLowerCase();

let content = "I'm not sure about that. Can you provide more details?";

const message =
{
role: "assistant",
content: "Connect your backend here...."
}
if (q.includes("ps11752778")) {
content =
"To install part number PS11752778, first unplug the appliance for safety. Remove the access panel or component covering the old part, disconnect the wiring harness, and remove any mounting screws. Install the new part by reversing these steps, reconnect the wiring, secure it in place, and restore power. Refer to your appliance’s service manual for model-specific instructions.";
}
else if (q.includes("wdt780saem1") || q.includes("compatible")) {
content =
"Yes, part number PS11752778 is compatible with the Whirlpool WDT780SAEM1 model. Always double-check compatibility using your appliance’s full model number before purchasing.";
}
else if (q.includes("ice maker") || q.includes("not working")) {
content =
"If the ice maker on your Whirlpool refrigerator is not working, check that the freezer temperature is set between 0–5°F, ensure the water supply line is connected and not frozen, and confirm the ice maker is turned on. Inspect the water inlet valve and replace the ice maker assembly if necessary.";
}

return message;
};
return {
role: "assistant",
content : content
};
};