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

PR to update lightspeed chatbot UI design for fixing AAP 32342 #1386

Merged
merged 11 commits into from
Nov 12, 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
2 changes: 1 addition & 1 deletion ansible_ai_connect/main/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

BASE_DIR: Path = files("ansible_ai_connect")
ANSIBLE_AI_PROJECT_NAME = os.getenv("ANSIBLE_AI_PROJECT_NAME") or "Ansible AI Connect"
ANSIBLE_AI_CHATBOT_NAME = os.getenv("ANSIBLE_AI_CHATBOT_NAME") or "Ansible AI Virtual Assistant"
ANSIBLE_AI_CHATBOT_NAME = os.getenv("ANSIBLE_AI_CHATBOT_NAME") or "Ansible Lightspeed"

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import ExpandIcon from "@patternfly/react-icons/dist/esm/icons/expand-icon";
import OpenDrawerRightIcon from "@patternfly/react-icons/dist/esm/icons/open-drawer-right-icon";
import OutlinedWindowRestoreIcon from "@patternfly/react-icons/dist/esm/icons/outlined-window-restore-icon";

import AnsibleLogo from "./AAP2LineLightMode.png";
import AnsibleLogoDark from "./AAP2LineDarkMode.png";
import lightspeedLogo from "../assets/lightspeed.svg";
import lightspeedLogoDark from "../assets/lightspeed_dark.svg";

import "./AnsibleChatbot.scss";
import { botMessage, useChatbot } from "../useChatbot/useChatbot";
Expand Down Expand Up @@ -106,10 +106,10 @@ export const AnsibleChatbot: React.FunctionComponent = () => {
<ChatbotHeaderTitle>
<Bullseye>
<div className="show-light">
<Brand src={AnsibleLogo} alt="Ansible" />
<Brand src={lightspeedLogo} alt="Ansible" />
</div>
<div className="show-dark">
<Brand src={AnsibleLogoDark} alt="Ansible" />
<Brand src={lightspeedLogoDark} alt="Ansible" />
</div>
</Bullseye>
</ChatbotHeaderTitle>
Expand Down
73 changes: 73 additions & 0 deletions ansible_ai_connect_chatbot/src/assets/lightspeed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 68 additions & 0 deletions ansible_ai_connect_chatbot/src/assets/lightspeed_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 8 additions & 7 deletions ansible_ai_connect_chatbot/src/useChatbot/useChatbot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import type {
ChatRequest,
ChatResponse,
} from "../types/Message";
import logo from "../assets/lightspeed.svg";
import userLogo from "../assets/user_logo.png";

const userName = document.getElementById("user_name")?.innerText ?? "User";
const botName =
document.getElementById("bot_name")?.innerText ??
"Ansible AI Virtual Assistant";
document.getElementById("bot_name")?.innerText ?? "Ansible Lightspeed";

export const readCookie = (name: string): string | null => {
const nameEQ = name + "=";
Expand All @@ -33,8 +34,7 @@ export const botMessage = (content: string): MessageProps => ({
role: "bot",
content,
name: botName,
avatar:
"https://access.redhat.com/sites/default/files/images/product_icon-red_hat-ansible_automation_platform-rgb_0.png",
avatar: logo,
justjais marked this conversation as resolved.
Show resolved Hide resolved
timestamp: getTimestamp(),
actions: {
positive: { onClick: () => console.log("Good response") },
Expand All @@ -50,7 +50,9 @@ type AlertMessage = {

const INITIAL_NOTICE: AlertMessage = {
title: "Notice",
message: `Please do not include any personal or confidential information
message: `<This is a placeholder to inform the user of our chatbot disclaimer,
to be determined at some point before we release to external customers.>
Please do not include any personal or confidential information
in your interaction with the virtual assistant. The tool is
intended to assist with general queries.`,
variant: "info",
Expand All @@ -71,8 +73,7 @@ export const useChatbot = () => {
role: "user",
content: message,
name: userName,
avatar:
"https://developers.redhat.com/sites/default/files/inline-images/Skill%20development_0.png",
avatar: userLogo,
timestamp: getTimestamp(),
referenced_documents: [],
};
Expand Down
Loading