Skip to content

Commit

Permalink
fix(ai-help): add short and extended explanatory guidance (#9215)
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoMcA committed Jul 2, 2023
1 parent 47d75f2 commit 1da1d4e
Showing 1 changed file with 55 additions and 1 deletion.
56 changes: 55 additions & 1 deletion client/src/plus/ai-help/index.tsx
Expand Up @@ -21,6 +21,7 @@ import { useLocation } from "react-router-dom";
import { isExternalUrl } from "./utils";
import { useGleanClick } from "../../telemetry/glean-context";
import { AI_HELP } from "../../telemetry/constants";
import MDNModal from "../../ui/atoms/modal";

type Category = "apis" | "css" | "html" | "http" | "js" | "learn";

Expand Down Expand Up @@ -101,6 +102,7 @@ export function AIHelpInner() {
const footerRef = useRef<HTMLDivElement>(null);
const [query, setQuery] = useState("");
const [isExample, setIsExample] = useState(false);
const [showDisclaimer, setShowDisclaimer] = useState(false);
const { hash } = useLocation();
const gleanClick = useGleanClick();

Expand Down Expand Up @@ -337,8 +339,60 @@ export function AIHelpInner() {
<div className="ai-help-footer-text">
<span>
Results based on MDN's most recent documentation and powered by
OpenAI GPT-3.5
GPT-3.5, an LLM by OpenAI. Please verify information
independently as LLM responses may not be 100% accurate. Read
our{" "}
<Button
type="link"
onClickHandler={() => setShowDisclaimer(true)}
>
full guidance
</Button>{" "}
for more details.
</span>
<MDNModal
isOpen={showDisclaimer}
onRequestClose={() => setShowDisclaimer(false)}
>
<header className="modal-header">
<h2 className="modal-heading">AI Help Usage Guidance</h2>
<Button
onClickHandler={() => setShowDisclaimer(false)}
type="action"
icon="cancel"
extraClasses="close-button"
/>
</header>
<div className="modal-body">
<p>
Our AI Help feature employs GPT-3.5, a Language Learning
Model (LLM) developed by OpenAI. While it's designed to
offer helpful and relevant information drawn from MDN's
comprehensive documentation, it's important to bear in mind
that it is an LLM and may not produce perfectly accurate
information in every circumstance.
</p>
<p>
We strongly advise all users to cross-verify the information
generated by this AI Help feature, particularly for complex
or critical topics. While we strive for accuracy and
relevance, the nature of AI means that responses may vary in
precision.
</p>
<p>
The AI Help feature provides links at the end of its
responses to support further reading and verification within
the MDN documentation. These links are intended to
facilitate deeper understanding and context.
</p>
<p>
As you use the AI Help feature, keep in mind its nature as
an LLM. It's not perfect, but it's here to assist you as
best as it can. We're excited to have you try AI Help, and
we hope it makes your MDN experience even better.
</p>
</div>
</MDNModal>
</div>
</>
)}
Expand Down

1 comment on commit 1da1d4e

@keiyakins
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not strong enough. A giant flashing "THIS EXPLANATION IS PROBABLY COMPLETELY INCORRECT" is the minimum for integrating a LLM.

Please sign in to comment.