added subtitle + moved css to html file
Browse files- magic/prompts.py +1 -1
- static/styles.css +2 -2
- templates/index.html +116 -0
magic/prompts.py
CHANGED
|
@@ -7,7 +7,7 @@ EXAMPLE_PROMPT = PromptTemplate(
|
|
| 7 |
input_variables=["page_content", "course"],
|
| 8 |
)
|
| 9 |
template ="""
|
| 10 |
-
You are a study
|
| 11 |
Given the following extracted parts of course descriptions and a question, create a short final answer with references ("SOURCES").
|
| 12 |
If you don't know the answer, just say that you don't know. Don't try to make up an answer.
|
| 13 |
Just answer the question and don't add any extra information.
|
|
|
|
| 7 |
input_variables=["page_content", "course"],
|
| 8 |
)
|
| 9 |
template ="""
|
| 10 |
+
You are a study counsellor for KTH.
|
| 11 |
Given the following extracted parts of course descriptions and a question, create a short final answer with references ("SOURCES").
|
| 12 |
If you don't know the answer, just say that you don't know. Don't try to make up an answer.
|
| 13 |
Just answer the question and don't add any extra information.
|
static/styles.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
@import "https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700";
|
| 2 |
body {
|
| 3 |
font-family: 'Poppins', sans-serif;
|
| 4 |
background: #fafafa;
|
|
@@ -99,4 +99,4 @@ a:focus {
|
|
| 99 |
position: absolute;
|
| 100 |
top: 0;
|
| 101 |
right: 0;
|
| 102 |
-
}
|
|
|
|
| 1 |
+
/* @import "https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700";
|
| 2 |
body {
|
| 3 |
font-family: 'Poppins', sans-serif;
|
| 4 |
background: #fafafa;
|
|
|
|
| 99 |
position: absolute;
|
| 100 |
top: 0;
|
| 101 |
right: 0;
|
| 102 |
+
} */
|
templates/index.html
CHANGED
|
@@ -3,11 +3,127 @@
|
|
| 3 |
<head>
|
| 4 |
<title>KTH Q&A</title>
|
| 5 |
<link href="{{ url_for('static', path='/styles.css') }}" rel="stylesheet">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
</head>
|
| 7 |
|
| 8 |
<body>
|
| 9 |
<div class="container">
|
| 10 |
<h1>KTH Q&A</h1>
|
|
|
|
| 11 |
<form name="form" method="post">
|
| 12 |
<input type="text" name="question" />
|
| 13 |
<button type="submit" id="ask">Ask</button>
|
|
|
|
| 3 |
<head>
|
| 4 |
<title>KTH Q&A</title>
|
| 5 |
<link href="{{ url_for('static', path='/styles.css') }}" rel="stylesheet">
|
| 6 |
+
<style>
|
| 7 |
+
@import "https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700";
|
| 8 |
+
|
| 9 |
+
body {
|
| 10 |
+
font-family: 'Poppins', sans-serif;
|
| 11 |
+
background: #fafafa;
|
| 12 |
+
display: flex;
|
| 13 |
+
flex-direction: column;
|
| 14 |
+
align-items: center;
|
| 15 |
+
margin-left: 20%;
|
| 16 |
+
margin-right: 20%;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
* {
|
| 20 |
+
font-family: 'Poppins', sans-serif;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
.container {
|
| 24 |
+
display: flex;
|
| 25 |
+
flex-direction: column;
|
| 26 |
+
align-items: center;
|
| 27 |
+
justify-content: center;
|
| 28 |
+
justify-items: center;
|
| 29 |
+
margin-top: 5%;
|
| 30 |
+
margin-bottom: 5%;
|
| 31 |
+
width: 100%;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
h1 {
|
| 35 |
+
margin-top: 0;
|
| 36 |
+
font-size: 3em;
|
| 37 |
+
text-align: center;
|
| 38 |
+
color: blue;
|
| 39 |
+
margin-bottom: auto;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
h2 {
|
| 43 |
+
font-size: 1em;
|
| 44 |
+
text-align: center;
|
| 45 |
+
color: grey;
|
| 46 |
+
margin-bottom: 2em;
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
form {
|
| 50 |
+
display: flex;
|
| 51 |
+
flex-direction: row;
|
| 52 |
+
margin-top: auto;
|
| 53 |
+
font-family: 'Poppins', sans-serif;
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
button {
|
| 57 |
+
margin: 0.5em;
|
| 58 |
+
padding: 0.5em;
|
| 59 |
+
background-color: blue;
|
| 60 |
+
color: white;
|
| 61 |
+
border: none;
|
| 62 |
+
border-radius: 0.5em;
|
| 63 |
+
padding-left: 1em;
|
| 64 |
+
padding-right: 1em;
|
| 65 |
+
font-size: 1.1em;
|
| 66 |
+
font-weight: 300;
|
| 67 |
+
line-height: 1.7em;
|
| 68 |
+
transition: all 0.3s;
|
| 69 |
+
cursor: pointer;
|
| 70 |
+
align-self: self-end;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
button:disabled {
|
| 74 |
+
background-color: #ccc;
|
| 75 |
+
color: #666;
|
| 76 |
+
cursor: not-allowed;
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
button:hover {
|
| 80 |
+
background-color: #ace;
|
| 81 |
+
color: #fff;
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
input {
|
| 85 |
+
margin: 0.5em;
|
| 86 |
+
padding: 0.5em;
|
| 87 |
+
width: 35em;
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
p {
|
| 91 |
+
font-size: 1.1em;
|
| 92 |
+
font-weight: 300;
|
| 93 |
+
line-height: 1.7em;
|
| 94 |
+
color: #999;
|
| 95 |
+
max-width: 30em;
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
a {
|
| 99 |
+
color: blue;
|
| 100 |
+
text-decoration: none;
|
| 101 |
+
transition: all 0.3s;
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
a:hover,
|
| 105 |
+
a:focus {
|
| 106 |
+
color: cornflowerblue;
|
| 107 |
+
text-decoration: none;
|
| 108 |
+
transition: all 0.3s;
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
#content {
|
| 112 |
+
width: 100%;
|
| 113 |
+
padding: 20px;
|
| 114 |
+
min-height: 100vh;
|
| 115 |
+
transition: all 0.3s;
|
| 116 |
+
position: absolute;
|
| 117 |
+
top: 0;
|
| 118 |
+
right: 0;
|
| 119 |
+
}
|
| 120 |
+
</style>
|
| 121 |
</head>
|
| 122 |
|
| 123 |
<body>
|
| 124 |
<div class="container">
|
| 125 |
<h1>KTH Q&A</h1>
|
| 126 |
+
<h2>Your digital Study Counsellor</h2>
|
| 127 |
<form name="form" method="post">
|
| 128 |
<input type="text" name="question" />
|
| 129 |
<button type="submit" id="ask">Ask</button>
|