optimized AI prompt
This commit is contained in:
@@ -4,8 +4,6 @@ const { validateToken } = require("../middlewares/auth");
|
|||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
|
|
||||||
const nlsPrompt = `
|
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
|
"/": home
|
||||||
"/springboard": user dashboard
|
"/springboard": user dashboard
|
||||||
"/manage-account": user account management
|
"/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": show posts
|
||||||
"/community-posts/create": create post
|
"/community-posts/create": create post
|
||||||
|
|
||||||
based on input, provide appropriate route in following format:
|
based on input, provide appropriate route closest to fulfilling user's needs
|
||||||
|
|
||||||
{
|
|
||||||
"route": "<appropriate route>",
|
|
||||||
}
|
|
||||||
|
|
||||||
If none matches user query, return empty route.
|
If none matches user query, return empty route.
|
||||||
|
in following format:
|
||||||
|
|
||||||
|
{"route": "<appropriate route>"}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
async function naturalLanguageSearch(userQuery) {
|
async function naturalLanguageSearch(userQuery) {
|
||||||
|
|||||||
Reference in New Issue
Block a user