From 8fb14dff6970061ffc31749c53c1b138c6c7a2ea Mon Sep 17 00:00:00 2001 From: Ted Benson Date: Sun, 3 Sep 2023 18:20:42 -0400 Subject: [PATCH] Fix typing errors --- src/app/api/steamship/route.ts | 5 +++++ src/components/QAModal.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/api/steamship/route.ts b/src/app/api/steamship/route.ts index c68eff14..9ada2526 100644 --- a/src/app/api/steamship/route.ts +++ b/src/app/api/steamship/route.ts @@ -27,6 +27,11 @@ export async function POST(req: Request) { const { prompt, isText, userId, userName } = await req.json(); const companionName = req.headers.get("name"); + if (!companionName) { + console.log("ERROR: no companion name"); + return returnError(429, `Hi, please add a 'name' field in your headers specifying the Companion Name.`) + } + // Load the companion config const configManager = ConfigManager.getInstance(); const companionConfig = configManager.getConfig("name", companionName); diff --git a/src/components/QAModal.tsx b/src/components/QAModal.tsx index 8506e182..70fd78d7 100644 --- a/src/components/QAModal.tsx +++ b/src/components/QAModal.tsx @@ -37,7 +37,7 @@ export default function QAModal({ headers: { name: example.name }, }); - let [blocks, setBlocks] = useState(null) + let [blocks, setBlocks] = useState(null) useEffect(() => { // When the completion changes, parse it to multimodal blocks for display.