From 23b78d9a001bb5a50e318cb1c02a3ff695392ebc Mon Sep 17 00:00:00 2001
From: Claas Augner <495429+caugner@users.noreply.github.com>
Date: Tue, 19 Dec 2023 16:35:20 +0100
Subject: [PATCH] fix(ai-help): use GPT-3.5 for free users (#10205)
---
client/src/plus/ai-help/banners.tsx | 32 +++++++++++++++++++
client/src/plus/ai-help/index.tsx | 15 +++------
client/src/plus/ai-help/landing.scss | 2 +-
client/src/plus/ai-help/landing.tsx | 2 +-
.../offer-overview-feature/index.tsx | 5 +--
copy/plus/features/ai-help.md | 13 ++++----
6 files changed, 49 insertions(+), 20 deletions(-)
diff --git a/client/src/plus/ai-help/banners.tsx b/client/src/plus/ai-help/banners.tsx
index 2aab2d47fea0..aa4ddf9431e4 100644
--- a/client/src/plus/ai-help/banners.tsx
+++ b/client/src/plus/ai-help/banners.tsx
@@ -1,6 +1,38 @@
+import { useMemo } from "react";
import { AI_HELP } from "../../telemetry/constants";
+import { Icon } from "../../ui/atoms/icon";
import { SignUpLink } from "../../ui/atoms/signup-link";
+import { useUserData } from "../../user-context";
import { PlusLoginBanner } from "../common/login-banner";
+import { isPlusSubscriber } from "../../utils";
+
+export function AiHelpBanner() {
+ const user = useUserData();
+
+ const isSubscriber = useMemo(() => isPlusSubscriber(user), [user]);
+
+ return (
+
+
+
+
+ {isSubscriber
+ ? "GPT-4-powered AI Help."
+ : "Supercharge your AI Help experience with our paid subscriptions."}
+
+
+
+ {isSubscriber
+ ? "Now with chat history, enhanced context, and optimized prompts."
+ : "Upgrade to MDN Plus 5 or MDN Supporter 10 to unlock the potential of GPT-4-powered AI Help."}
+
+
This is a beta feature.
+ {!isSubscriber && (
+
+ )}
+
+ );
+}
export function AiLoginBanner() {
return (
diff --git a/client/src/plus/ai-help/index.tsx b/client/src/plus/ai-help/index.tsx
index 41fad629caf0..9225fdf8a76f 100644
--- a/client/src/plus/ai-help/index.tsx
+++ b/client/src/plus/ai-help/index.tsx
@@ -19,7 +19,7 @@ import {
Quota,
useAiChat,
} from "./use-ai";
-import { AiUpsellBanner } from "./banners";
+import { AiHelpBanner, AiUpsellBanner } from "./banners";
import { useUserData } from "../../user-context";
import Container from "../../ui/atoms/container";
import { FeatureId, MDN_PLUS_TITLE } from "../../constants";
@@ -57,6 +57,7 @@ import {
MESSAGE_SEARCHED,
} from "./constants";
import InternalLink from "../../ui/atoms/internal-link";
+import { isPlusSubscriber } from "../../utils";
type Category = "apis" | "css" | "html" | "http" | "js" | "learn";
@@ -124,14 +125,7 @@ function AIHelpAuthenticated() {
-
-
-
- GPT-4-powered AI Help.
-
-
Now with chat history, enhanced context, and optimized prompts.
Unlock GPT-4's potential with our paid subscriptions
diff --git a/client/src/plus/offer-overview/offer-overview-feature/index.tsx b/client/src/plus/offer-overview/offer-overview-feature/index.tsx
index c1cdc46b3665..c976aade6ff0 100644
--- a/client/src/plus/offer-overview/offer-overview-feature/index.tsx
+++ b/client/src/plus/offer-overview/offer-overview-feature/index.tsx
@@ -1,5 +1,6 @@
import { Button } from "../../../ui/atoms/button";
import "./index.scss";
+import screenshotAiHelp from "../../../../public/assets/ai-help/ai-help_light.png";
function OfferOverviewFeature({ id, img, imgAlt, children }) {
return (
@@ -23,14 +24,14 @@ function OfferOverviewFeature({ id, img, imgAlt, children }) {
export default function OfferOverviewFeatures() {
return (
-
+
AI Help
Get real-time assistance and support.
No need to scroll through page after page to find your answers.
Introducing an AI assistant that can answer all your web development
- questions in real time. Powered by OpenAI GPT 3.5.
+ questions in real time. Powered by OpenAI GPT-3.5 and GPT-4.