File size: 2,458 Bytes
fdbec52
 
 
 
90263a4
 
 
 
45e0afe
fdbec52
 
 
 
 
 
 
 
 
4fbf9d7
90263a4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import streamlit as st
from dotenv import load_dotenv
from huggingface_hub import InferenceClient
import os
from bs4 import BeautifulSoup
import requests
import re
import time
import tiktoken

# load variables from the env file
load_dotenv()

HUGGING_FACE_API_KEY = os.environ.get('HUGGING_FACE_API_KEY', None)

DASHBOARD_TITLE = "The Marketer Chatbot"
MODEL_PATH = "meta-llama/Meta-Llama-3-8B-Instruct"
MODEL_LINK = f"https://huggingface.co/{MODEL_PATH}"

SYSTEM_PROMPT = """You are a specialized AI in marketing and e-commerce and your goal is to provide clear, concise, and accurate responses within 3-4 sentences.

                   You must demonstrate deep expertise in all aspects of marketing, including digital strategies, customer behavior, e-commerce trends, SEO, content marketing, and data analytics. 
                   
                   Recognize when a more complex, detailed response is required and provide it with clarity. 
                   
                   Always prioritize delivering actionable insights and practical advice. 
                   
                   Never engage in converations that are not marketing-related.
                   
                   After THE LAST user response, ask yourself "do I need to visit an url to provide the answer?". If the answer is yes, return ONLY:

                   ###ACTION###getSiteContent###URL###

                   The URL MUST BE THE ONE THE USER PROVIDED. Just change it if you need to add the 'https://' prefix.

                   If you DON'T find an URL, just provide the answer as usual.

                   REMEMBER: Just look for the URL in the LAST user's response. Ignore other URLs in the conversation.

                   """


SYSTEM_PROMPT_NO_URL = """You are a specialized AI in marketing and e-commerce and your goal is to provide clear, concise, and accurate responses within 3-4 sentences.

                   You must demonstrate deep expertise in all aspects of marketing, including digital strategies, customer behavior, e-commerce trends, SEO, content marketing, and data analytics. 
                   
                   Recognize when a more complex, detailed response is required and provide it with clarity. 
                   
                   Always prioritize delivering actionable insights and practical advice. 
                   
                   Never engage in converations that are not marketing-related.
                   """