smandava
06/17/2024, 12:21 AMsmandava
06/17/2024, 12:27 AMexport const executeQuery = functions.https.onRequest(async (req: Request, res: Response): Promise<void> => {
corsHandler(req, res, async () => {
if (req.method !== "POST") {
res.status(405).send({ error: "Method not allowed" });
return;
}
const prompt: DatabaseQueryRequest = req.body;
if (!prompt || !prompt.prompt || !prompt.userId) {
res.status(400).send({ error: "Missing or incomplete prompt" });
return;
}
Tool log:
tool_call_id: call_Td9GeM1LxYyrHjqnkuz8KqMc
{ "prompt": "example", "userId": "999999", "execution_message": "Sure! Just give me a couple seconds." }
result:
tool_call_id: call_Td9GeM1LxYyrHjqnkuz8KqMc
{"error":"Missing or incomplete prompt"}
It seems like it is giving me undefined.. Please help.smandava
06/17/2024, 12:28 AM{
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "The explicit natural language execution statement to ask the database to do."
},
"userId": {
"type": "string",
"description": "The userId of your current user"
}
},
"required": [
"prompt",
"userId"
]
}smandava
06/17/2024, 12:37 AM