|
|
|
|
@ -17,14 +17,13 @@ function formatResponse(text) {
|
|
|
|
|
.replace(/^(.*)$/, "<p>$1</p>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Hooks.on("chatMessage", async (chatLog, message, chatData) => {
|
|
|
|
|
console.log(chatData);
|
|
|
|
|
console.log(message);
|
|
|
|
|
Hooks.on("createChatMessage", async (message, options, userId) => {
|
|
|
|
|
if (message.speaker.alias === 'AI DM') return
|
|
|
|
|
|
|
|
|
|
const response = await fetch('https://ai-dm-api.artisan.al/prompt', {
|
|
|
|
|
//const response = await fetch('http://debianmacbookair:3000/prompt', {
|
|
|
|
|
method: "POST",
|
|
|
|
|
headers: { "Content-Type": "application/json" },
|
|
|
|
|
body: JSON.stringify({ message })
|
|
|
|
|
body: JSON.stringify({ content:message.content })
|
|
|
|
|
});
|
|
|
|
|
const data = await response.json();
|
|
|
|
|
console.log(data);
|
|
|
|
|
|