MCPcopy
hub / github.com/LAION-AI/Open-Assistant / ChatSection

Function ChatSection

website/src/components/Chat/ChatSection.tsx:14–39  ·  view source on GitHub ↗
({ chatId }: { chatId: string | null })

Source from the content-addressed store, hash-verified

12const ChatConfigSummary = dynamic(() => import("./ChatConfigSummary"), { ssr: false });
13
14export const ChatSection = ({ chatId }: { chatId: string | null }) => {
15 const { modelInfos } = useChatContext();
16
17 console.assert(modelInfos.length > 0, "No model config was found");
18
19 const form = useForm<ChatConfigFormData>({
20 defaultValues: getConfigCache() ?? {
21 ...modelInfos[0].parameter_configs[0].sampling_parameters,
22 model_config_name: modelInfos[0].name,
23 },
24 });
25
26 return (
27 <FormProvider {...form}>
28 <Card className="max-w-5xl mx-auto">
29 <CardBody display="flex" flexDirection="column" gap="2">
30 <ChatConversation chatId={chatId} key={chatId} />
31 <ChatConfigSummary />
32 <Divider />
33 <InferencePoweredBy />
34 </CardBody>
35 </Card>
36 <ChatConfigSaver />
37 </FormProvider>
38 );
39};

Callers

nothing calls this directly

Calls 2

useChatContextFunction · 0.90
getConfigCacheFunction · 0.90

Tested by

no test coverage detected