X
Xata2mo ago
alihammad

ask ai

Hi, I have a bug with my code, when I add sessionId to the options, I receive error (invalid key [rules] in request). It works when I remove rules and searchType
const ask = await xata.db.docs.ask(
// Pass in a simple question
message,
{
sessionId: phone,
rules,
searchType: "keyword",
search: {
fuzziness: 2,
prefix: "phrase",
},
}
);
const ask = await xata.db.docs.ask(
// Pass in a simple question
message,
{
sessionId: phone,
rules,
searchType: "keyword",
search: {
fuzziness: 2,
prefix: "phrase",
},
}
);
Note: I use Xata SDK for Node.js
3 Replies
cmck
cmck2mo ago
Hi Ali, the Xata Lite /ask endpoint has been deprecated and we do not recommend using it for applications. We've removed its documentation from the Xata Lite website. Does it work without sessionId completely or is it only rules that throws the error?
alihammad
alihammadOP5w ago
The rules error returned when I added the sessionId. It works without sessionID
cmck
cmck5w ago
Ok thanks for the clarification, and for your patience. I'll forward this on to the team and let you know as soon as I have an update. Let me know if you have any queries or observations in the meantime.

Did you find this page helpful?