diff --git a/apps/www/components/docs/ParametersTable.tsx b/apps/www/components/docs/ParametersTable.tsx index 8d21bfbe0..24240c92e 100644 --- a/apps/www/components/docs/ParametersTable.tsx +++ b/apps/www/components/docs/ParametersTable.tsx @@ -4,7 +4,7 @@ type ParameterDef = { name: string; type: string; description: string; - isOptional?: boolean; + required?: boolean; children?: Array<{ type: string; parameters: Array; @@ -24,12 +24,12 @@ const Parameter: FC = ({ parameter, isLast }) => {

{parameter.name} - {parameter.isOptional && "?"}: + {!parameter.required && "?"}:

{parameter.type}
-
+

{parameter.description}

diff --git a/apps/www/pages/reference/_meta.tsx b/apps/www/pages/reference/_meta.tsx index 7da66d702..c4933f88c 100644 --- a/apps/www/pages/reference/_meta.tsx +++ b/apps/www/pages/reference/_meta.tsx @@ -1,4 +1,5 @@ export default { + runtime: "Runtime API", "-- integrations": { title: "Integrations", type: "separator", diff --git a/apps/www/pages/reference/integrations/react-hook-form.mdx b/apps/www/pages/reference/integrations/react-hook-form.mdx index 7182ba064..8bea5de18 100644 --- a/apps/www/pages/reference/integrations/react-hook-form.mdx +++ b/apps/www/pages/reference/integrations/react-hook-form.mdx @@ -28,6 +28,7 @@ Drop-in replacement hook for `useForm` that adds support for `@assistant-ui/reac { name: "assistant", type: 'object', + optional: true, description: "Configuration for useAssistantForm", children: [ { diff --git a/apps/www/pages/reference/runtime.mdx b/apps/www/pages/reference/runtime.mdx new file mode 100644 index 000000000..94e08e884 --- /dev/null +++ b/apps/www/pages/reference/runtime.mdx @@ -0,0 +1,98 @@ +--- +title: Runtime API +description: A React Hook Form integration for @assistant-ui. +--- + +import { ParametersTable } from "@/components/docs"; + +### `AssistantRuntimeProvider` + +The `AssistantRuntimeProvider` is a React component that wraps your entire app and provides the `Runtime` to the rest of your app. + +```tsx {1, 8, 10} +import { AssistantRuntimeProvider } from "@assistant-ui/react"; + +const MyApp = () => { + const chat = useChat(); + const runtime = useVercelUseChatRuntime(chat); + + return ( + + {/* your app */} + + ); +}; +``` + +### Properties + + readonly string[]', + required: true, + description: "A function to get the branches for a message.", + }, + { + name: "switchToBranch", + type: '(branchId: string) => void', + required: true, + description: "A function to switch to a branch.", + }, + { + name: "append", + type: '(message: AppendMessage) => void', + required: true, + description: "A function to append a message to the thread.", + }, + { + name: "startRun", + type: '(parentId: string | null) => void', + required: true, + description: "A function to start a run.", + }, + { + name: "cancelRun", + type: '() => void', + required: true, + description: "A function to cancel a run.", + }, + { + name: "subscribe", + type: '(callback: () => void) => Unsubscribe', + required: true, + description: "A function to subscribe to updates.", + }, + { + name: "registerModelConfigProvider", + type: '(provider: ModelConfigProvider) => Unsubscribe', + required: true, + description: "A function to register a model config provider.", + }, + ], + }, + ], + }, + ]} +/> \ No newline at end of file diff --git a/apps/www/pages/styles.css b/apps/www/pages/styles.css index 901e3b8fd..6377040a6 100644 --- a/apps/www/pages/styles.css +++ b/apps/www/pages/styles.css @@ -36,7 +36,7 @@ } .dark { - --background: 240 10% 3.9%; + --background: 0 0% 7%; --foreground: 0 0% 98%; --card: 240 10% 3.9%;