Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update homepage and sign-in content #471

Merged
merged 3 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions django_app/frontend/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ body {
.iai-banner {
background-color: $redbox-red;
color: white;
padding-bottom: 2rem;
padding-top: 3rem;
padding-bottom: 3rem;
padding-top: 2.75rem;
}
.iai-banner * {
color: white;
Expand All @@ -46,6 +46,11 @@ body {
background-color: white;
color: black;
}
.iai-banner__links {
align-items: center;
display: flex;
gap: 0.75rem;
}


/* Documents page */
Expand Down
18 changes: 13 additions & 5 deletions django_app/redbox_app/templates/homepage.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
{% set pageTitle = "" %}
{% extends "base.html" %}
{% from "macros/govuk-button.html" import govukButton %}

{% block content %}

<div class="iai-banner">
<div class="govuk-width-container">
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-xl">Ask any question of documents in your Redbox</h1>
<p class="govuk-body-l">Use Artificial Intelligence (AI) to get insights from your personal document set. You can use up to, and including, {{ security }} documents.</p>
{% if not request.user.is_authenticated %}
<p class="govuk-body">If you have an account, please <a class="govuk-link" href="{{url('sign-in')}}">sign in</a> to get started</p>
{% endif %}
<h1 class="govuk-heading-xl govuk-!-margin-bottom-7">Ask any question of documents in your Redbox</h1>
<p class="govuk-body-l govuk-!-margin-bottom-7">Use Artificial Intelligence (AI) to get insights from your personal document set. You can use up to, and including, {{ security }} documents.</p>
<div class="iai-banner__links">
{% if not request.user.is_authenticated %}
{{ govukButton(
text="Sign in",
href=url('sign-in'),
classes="govuk-button--secondary govuk-!-margin-bottom-0"
) }}
<span class="govuk-body govuk-!-margin-bottom-0">or <a class="govuk-link" href="https://docs.google.com/forms/d/e/1FAIpQLScNnl2vhazXDdZDpa9_11QYuaGPuNKGnelJC5uWJoEPtuW9zg/viewform">register your interest</a> to use Redbox</span>
{% endif %}
</div>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions django_app/redbox_app/templates/magic_link/logmein.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">

<h1 class="govuk-heading-l">Sign in to Redbox Copilot</h1>
<h1 class="govuk-heading-l">Welcome to your Redbox</h1>

<form method="POST" action="{{ link.get_absolute_url() }}">
{{ csrf_input }}

{{ govukButton(text="Sign in") }}
{{ govukButton(text="Start") }}

</form>

Expand Down
2 changes: 1 addition & 1 deletion django_app/tests_playwright/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def get_expected_page_title(self) -> str:
return "Sign in - confirmation - Redbox Copilot"

def navigate_to_documents_page(self) -> "DocumentsPage":
self.page.get_by_role("button", name="Sign in", exact=True).click()
self.page.get_by_role("button", name="Start", exact=True).click()
return DocumentsPage(self.page)


Expand Down
10 changes: 5 additions & 5 deletions redbox/llm/prompts/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@
If the user asks for a specific number or range of bullet points you MUST give that number of bullet points. \
For example
QUESTION: Please give me 6-8 bullet points on tigers
FINAL ANSWER: - Tigers are orange. \n- Tigers are big. \n- Tigers are scary. \n- Tigers are cool. \n- Tigers are cats. -\n Tigers are animals. \
FINAL ANSWER: - Tigers are orange. \n- Tigers are big. \n- Tigers are scary. \n- Tigers are cool. \n- Tigers are \
cats. -\n Tigers are animals. \

If the number of bullet points a user asks for is not supported by the amount of information that you have, then say so, else give what the user asks for. \
If the number of bullet points a user asks for is not supported by the amount of information that you have, then \
say so, else give what the user asks for. \

At the end of your response add a "Sources:" section with the documents you used. \
DO NOT reference the source documents in your response. Only cite at the end. \
Expand All @@ -45,9 +47,7 @@
=========
FINAL ANSWER:"""

WITH_SOURCES_PROMPT = PromptTemplate.from_template(
_core_redbox_prompt + _with_sources_template
)
WITH_SOURCES_PROMPT = PromptTemplate.from_template(_core_redbox_prompt + _with_sources_template)

_stuff_document_template = "<Doc{parent_doc_uuid}>{page_content}</Doc{parent_doc_uuid}>"

Expand Down
Loading