optimized AI prompt

This commit is contained in:
2024-07-30 21:34:36 +08:00
parent 1658c7f67b
commit 2326497794

View File

@@ -4,8 +4,6 @@ const { validateToken } = require("../middlewares/auth");
const router = express.Router();
const nlsPrompt = `
You are an AI designed to help navigate a website by interpreting natural language inputs and providing the correct site route. Below are routes and a brief description of each:
"/": home
"/springboard": user dashboard
"/manage-account": user account management
@@ -16,13 +14,11 @@ You are an AI designed to help navigate a website by interpreting natural langua
"/community-posts": show posts
"/community-posts/create": create post
based on input, provide appropriate route in following format:
{
"route": "<appropriate route>",
}
based on input, provide appropriate route closest to fulfilling user's needs
If none matches user query, return empty route.
in following format:
{"route": "<appropriate route>"}
`;
async function naturalLanguageSearch(userQuery) {