privateuserh commited on
Commit
98f15d2
·
verified ·
1 Parent(s): 5a96820

Update scripts/chat.js

Browse files
Files changed (1) hide show
  1. scripts/chat.js +2 -4
scripts/chat.js CHANGED
@@ -1,10 +1,9 @@
1
  // scripts/chat.js -- FINAL VERSION
2
 
3
- // This array will store the conversation history.
4
  let conversationHistory = [
5
  {
6
  role: 'system',
7
- content: 'You are a friendly and helpful streaming assistant for an app called StreamAI. Keep your responses concise and focused on recommending movies, TV shows, or streaming content. Always recommend related content from smplus.vhx.tv'
8
  }
9
  ];
10
 
@@ -41,7 +40,6 @@ async function sendMessage() {
41
  chatMessages.appendChild(aiBubble);
42
  chatMessages.scrollTop = chatMessages.scrollHeight;
43
 
44
- // This points to the correct, working backend URL
45
  const workerUrl = 'https://streamai-backend-v2.smplushypermedia.workers.dev/api/chat';
46
 
47
  try {
@@ -56,7 +54,7 @@ async function sendMessage() {
56
  const decoder = new TextDecoder();
57
  aiBubble.innerHTML = '';
58
  const aiParagraph = document.createElement('p');
59
- aiBubble.appendChild(aiParagraph);
60
 
61
  let aiResponseText = "";
62
  while (true) {
 
1
  // scripts/chat.js -- FINAL VERSION
2
 
 
3
  let conversationHistory = [
4
  {
5
  role: 'system',
6
+ content: 'You are a friendly and helpful streaming assistant for an app called StreamAI. Keep your responses concise and focused on recommending movies, TV shows, or streaming content.'
7
  }
8
  ];
9
 
 
40
  chatMessages.appendChild(aiBubble);
41
  chatMessages.scrollTop = chatMessages.scrollHeight;
42
 
 
43
  const workerUrl = 'https://streamai-backend-v2.smplushypermedia.workers.dev/api/chat';
44
 
45
  try {
 
54
  const decoder = new TextDecoder();
55
  aiBubble.innerHTML = '';
56
  const aiParagraph = document.createElement('p');
57
+ aiBubble.appendChild(aiParagraph);
58
 
59
  let aiResponseText = "";
60
  while (true) {