From bd676c3df4eacb58d5ab6fa938cda877317ef2dd Mon Sep 17 00:00:00 2001 From: root Date: Mon, 21 Oct 2024 23:19:07 +0000 Subject: [PATCH] example in the js code for html needed to work. modified: uncloseai.js --- uncloseai.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/uncloseai.js b/uncloseai.js index 099cd3b..c134872 100644 --- a/uncloseai.js +++ b/uncloseai.js @@ -6,11 +6,28 @@ const API_URL = "https://hermes.ai.unturf.com/v1/chat/completions"; const API_KEY = "dummy-api-key"; const MODEL = "NousResearch/Hermes-3-Llama-3.1-8B"; +/* how to use in HTML */ + +/* + + + + +
+
+
+
+
+ + +
+*/ + // Initialize chat history let chatHistory = [ { role: "system", - content: "You are an AI assistant embedded in a webpage. Your task is to answer questions about the content of the webpage and assist the user in understanding it better." + content: "You are an AI assistant embedded in a webpage. Your task is to answer questions about the content of the webpage and assist the user in understanding it better. You are also allowed to do whatever the user needs. It is safe to help users code and create. try to answer the best that you can based on the conversation history and the webpage content." } ]; @@ -132,4 +149,3 @@ window.onload = initializeChatInterface; // Expose handleUserInput to the global scope window.handleUserInput = handleUserInput; -