- {' '}
+ {" "}
{text.split(regex).map((part, i) => {
// When splitting, the even parts are basic text sections, while the odd ones are
// citations
if (i % 2 == 0) {
- return textRenderer(part)
+ return textRenderer(part);
} else {
- return
+ return ;
}
})}
- )
-}
+ );
+};
diff --git a/web/src/components/controls.tsx b/web/src/components/controls.tsx
index 260c6dd..a92ae63 100644
--- a/web/src/components/controls.tsx
+++ b/web/src/components/controls.tsx
@@ -1,6 +1,12 @@
-import type {Mode} from '../types'
+import type { Mode } from "../types";
-export const Controls = ({mode, setMode}: {mode: [Mode, boolean]; setMode: (m: any) => void}) => {
+export const Controls = ({
+ mode,
+ setMode,
+}: {
+ mode: [Mode, boolean];
+ setMode: (m: any) => void;
+}) => {
{
/* three buttons for the three modes, place far right, 1rem between each */
}
@@ -8,10 +14,11 @@ export const Controls = ({mode, setMode}: {mode: [Mode, boolean]; setMode: (m: a
- )
-}
+ );
+};
diff --git a/web/src/components/entry.tsx b/web/src/components/entry.tsx
index c6d6341..2e052b6 100644
--- a/web/src/components/entry.tsx
+++ b/web/src/components/entry.tsx
@@ -4,14 +4,14 @@ import type {
ErrorMessage,
StampyMessage,
UserEntry,
-} from '../types'
-import {AssistantEntry} from './assistant'
-import {GlossarySpan} from './glossary'
-import Image from 'next/image'
-import logo from '../logo.svg'
-import TextareaAutosize from 'react-textarea-autosize'
+} from "../types";
+import { AssistantEntry } from "./assistant";
+import { GlossarySpan } from "./glossary";
+import Image from "next/image";
+import logo from "../logo.svg";
+import TextareaAutosize from "react-textarea-autosize";
-export const User = ({entry}: {entry: UserEntry}) => {
+export const User = ({ entry }: { entry: UserEntry }) => {
return (
- )
-}
+ );
+};
-export default Header
+export default Header;
diff --git a/web/src/components/html.tsx b/web/src/components/html.tsx
index e23c6dc..8312bb7 100644
--- a/web/src/components/html.tsx
+++ b/web/src/components/html.tsx
@@ -5,28 +5,28 @@
// the source file for it to be included in the build
export const Colours = [
- 'bg-red-100 border-red-300 text-red-800',
- 'bg-amber-100 border-amber-300 text-amber-800',
- 'bg-orange-100 border-orange-300 text-orange-800',
- 'bg-lime-100 border-lime-300 text-lime-800',
- 'bg-green-100 border-green-300 text-green-800',
- 'bg-cyan-100 border-cyan-300 text-cyan-800',
- 'bg-blue-100 border-blue-300 text-blue-800',
- 'bg-violet-100 border-violet-300 text-violet-800',
- 'bg-pink-100 border-pink-300 text-pink-800',
-]
+ "bg-red-100 border-red-300 text-red-800",
+ "bg-amber-100 border-amber-300 text-amber-800",
+ "bg-orange-100 border-orange-300 text-orange-800",
+ "bg-lime-100 border-lime-300 text-lime-800",
+ "bg-green-100 border-green-300 text-green-800",
+ "bg-cyan-100 border-cyan-300 text-cyan-800",
+ "bg-blue-100 border-blue-300 text-blue-800",
+ "bg-violet-100 border-violet-300 text-violet-800",
+ "bg-pink-100 border-pink-300 text-pink-800",
+];
export const A: React.FC<{
- href: string
- className?: string
- children: React.ReactNode
-}> = ({href, className, children}) => {
+ href: string;
+ className?: string;
+ children: React.ReactNode;
+}> = ({ href, className, children }) => {
// link element that only populates the href field if the contents are there
- return href && href !== '' ? (
+ return href && href !== "" ? (
{children}
) : (
{children}
- )
-}
+ );
+};
diff --git a/web/src/components/page.tsx b/web/src/components/page.tsx
index 23f899e..f64337b 100644
--- a/web/src/components/page.tsx
+++ b/web/src/components/page.tsx
@@ -1,8 +1,11 @@
-import React, {ReactNode} from 'react'
-import Head from 'next/head'
-import Header from './header'
+import React, { ReactNode } from "react";
+import Head from "next/head";
+import Header from "./header";
-const Page: React.FC<{children: ReactNode; page: 'index' | 'semantic'}> = ({page, children}) => {
+const Page: React.FC<{ children: ReactNode; page: "index" | "semantic" }> = ({
+ page,
+ children,
+}) => {
return (
<>
@@ -13,6 +16,6 @@ const Page: React.FC<{children: ReactNode; page: 'index' | 'semantic'}> = ({page
{children}
>
- )
-}
-export default Page
+ );
+};
+export default Page;
diff --git a/web/src/components/searchbox.tsx b/web/src/components/searchbox.tsx
index 07b827c..f54470f 100644
--- a/web/src/components/searchbox.tsx
+++ b/web/src/components/searchbox.tsx
@@ -1,100 +1,106 @@
-import React from 'react'
-import {useState, useEffect} from 'react'
-import type {Followup} from '../types'
-import TextareaAutosize from 'react-textarea-autosize'
-import dynamic from 'next/dynamic'
+import React from "react";
+import { useState, useEffect } from "react";
+import type { Followup } from "../types";
+import TextareaAutosize from "react-textarea-autosize";
+import dynamic from "next/dynamic";
// initial questions to fill the search box with.
export const initialQuestions: string[] = [
- 'Are there any regulatory efforts aimed at addressing AI safety and alignment concerns?',
- 'How can I help with AI safety and alignment?',
- 'How could a predictive model - like an LLM - act like an agent?',
+ "Are there any regulatory efforts aimed at addressing AI safety and alignment concerns?",
+ "How can I help with AI safety and alignment?",
+ "How could a predictive model - like an LLM - act like an agent?",
"How could an AI possibly be an x-risk when some populations aren't even connected to the internet?",
"I'm not convinced, why is this important?",
- 'Summarize the differences in opinion between Eliezer Yudkowsky and Paul Christiano.',
+ "Summarize the differences in opinion between Eliezer Yudkowsky and Paul Christiano.",
'What are "RAAPs"?',
'What are "scaling laws" and how are they relevant to safety?',
- 'What are some of the different research approaches?',
- 'What are the differences between Inner and Outer alignment?',
+ "What are some of the different research approaches?",
+ "What are the differences between Inner and Outer alignment?",
'What does the term "x-risk" mean?',
'What is "FOOM"?',
'What is "instrumental convergence"?',
- 'What is a hard takeoff?',
- 'What is a mesa-optimizer?',
- 'What is AI safety and alignment?',
- 'What is an AI arms race?',
- 'What is an Intelligence Explosion?',
+ "What is a hard takeoff?",
+ "What is a mesa-optimizer?",
+ "What is AI safety and alignment?",
+ "What is an AI arms race?",
+ "What is an Intelligence Explosion?",
'What is the "orthogonality thesis"?',
'Why would we expect AI to be "misaligned by default"?',
-]
+];
const SearchBoxInternal: React.FC<{
search: (
query: string,
- query_source: 'search' | 'followups',
+ query_source: "search" | "followups",
enable: (f_set: Followup[] | ((fs: Followup[]) => Followup[])) => void,
controller: AbortController
- ) => void
- onQuery?: (q: string) => any
-}> = ({search, onQuery}) => {
- const initial_query = initialQuestions[Math.floor(Math.random() * initialQuestions.length)] || ''
+ ) => void;
+ onQuery?: (q: string) => any;
+}> = ({ search, onQuery }) => {
+ const initial_query =
+ initialQuestions[Math.floor(Math.random() * initialQuestions.length)] || "";
- const [query, setQuery] = useState(initial_query)
- const [loading, setLoading] = useState(false)
- const [followups, setFollowups] = useState([])
- const [controller, setController] = useState(new AbortController())
+ const [query, setQuery] = useState(initial_query);
+ const [loading, setLoading] = useState(false);
+ const [followups, setFollowups] = useState([]);
+ const [controller, setController] = useState(new AbortController());
- const inputRef = React.useRef(null)
+ const inputRef = React.useRef(null);
// because everything is async, I can't just manually set state at the
// point we do a search. Instead it needs to be passed into the search
// method, for some reason.
const enable =
- (controller: AbortController) => (f_set: Followup[] | ((fs: Followup[]) => Followup[])) => {
- if (!controller.signal.aborted) setQuery('')
+ (controller: AbortController) =>
+ (f_set: Followup[] | ((fs: Followup[]) => Followup[])) => {
+ if (!controller.signal.aborted) setQuery("");
- setLoading(false)
- setFollowups(f_set)
- }
+ setLoading(false);
+ setFollowups(f_set);
+ };
useEffect(() => {
// set focus on the input box
- if (!loading) inputRef.current?.focus()
- }, [loading])
+ if (!loading) inputRef.current?.focus();
+ }, [loading]);
// on first mount focus and set cursor to end of input
useEffect(() => {
- if (!inputRef.current) return
- inputRef.current.focus()
- inputRef.current.selectionStart = inputRef.current.textLength
- inputRef.current.selectionEnd = inputRef.current.textLength
- }, [])
+ if (!inputRef.current) return;
+ inputRef.current.focus();
+ inputRef.current.selectionStart = inputRef.current.textLength;
+ inputRef.current.selectionEnd = inputRef.current.textLength;
+ }, []);
- const runSearch = (query: string, searchtype: 'search' | 'followups') => () => {
- if (loading || query.trim() === '') return
+ const runSearch =
+ (query: string, searchtype: "search" | "followups") => () => {
+ if (loading || query.trim() === "") return;
- setLoading(true)
- const controller = new AbortController()
- setController(controller)
- search(query, 'search', enable(controller), controller)
- }
- const cancelSearch = () => controller.abort()
+ setLoading(true);
+ const controller = new AbortController();
+ setController(controller);
+ search(query, "search", enable(controller), controller);
+ };
+ const cancelSearch = () => controller.abort();
return (
<>