Skip to content

Commit

Permalink
new endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
btopro committed Apr 29, 2024
1 parent 64fa542 commit 665cb44
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/apps/haxcms/aiChat.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ curl -X POST http://ec2-44-205-57-53.compute-1.amazonaws.com/handle-query \
import { stdPostBody, stdResponse, invalidRequest } from "../../../utilities/requestHelpers.js";
import { resolveSiteData } from "./lib/JOSHelpers.js";

const aiChatSource = "http://ec2-44-205-57-53.compute-1.amazonaws.com/handle-query";
const aiChatSource = "https://askalfred.vercel.app/api/query";

// site object to validate response from passed in url
export default async function handler(req, res) {
Expand Down Expand Up @@ -64,13 +64,13 @@ export default async function handler(req, res) {
})
.then((response) => {
if (response && response.data) {
console.log(response.data);
return {
answers: response.data.answers,
answers: [response.data.answers],
question: response.data.question,
status: 200
}
}
console.log(response);
return {answer: "Offline", question: body.question, status: 500};
}).catch((error) => {
console.error(error);
Expand Down

0 comments on commit 665cb44

Please sign in to comment.