UNPKG

@promptbook/remote-server

Version:

Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action

80 lines (79 loc) 2.6 kB
import { CSSProperties } from 'react'; import type { AgentBasicInformation } from '../../book-2.0/agent-source/AgentBasicInformation'; import type { string_css_class } from '../../types/string_markdown'; /** * Props of PromptbookAgentIntegration component. * * @private */ export type PromptbookAgentIntegrationProps = { /** * URL of the agent to connect to * * @example "http://s6.ptbk.io/benjamin-white" */ readonly agentUrl: string; /** * Form of the agent integration * * @default `seamless` * * - `seamless` Default, current behavior * - `book` Show the Agent as a book in BookEditor * - `chat` Show the Agent as a chat which is not floating but as AgentChat component * - `profile` Show the Agent as a profile using */ readonly formfactor?: 'seamless' | 'book' | 'chat' | 'profile'; /** * Optional metadata to show before the agent is connected * Or to override the agent metadata if the agent does not provide it */ readonly meta?: Partial<AgentBasicInformation['meta']>; /** * Callback when the window is opened or closed */ onOpenChange?(isOpen: boolean): void; /** * Controlled open state of the seamless widget. * * When omitted, the widget manages its own open state. * * @default undefined */ readonly isOpen?: boolean; /** * Initial open state of the seamless widget in uncontrolled mode. * * @default false */ readonly defaultOpen?: boolean; /** * Optional CSS class name which will be added to root element */ readonly className?: string_css_class; /** * Optional CSS style which will be added to root element */ readonly style?: CSSProperties; /** * Is the writing textarea automatically focused? * * @default false (to prevent focus being stolen when widget loads) */ readonly isFocusedOnLoad?: boolean; /** * Use iframe instead of implementing the chat directly * * When `true`, the chat will be rendered in an iframe pointing to the agent's chat endpoint. * When `false`, the chat will be rendered directly using React components. * * @default true */ readonly isIframeUsed?: boolean; }; /** * Renders a floating agent button that opens a chat window with the remote agent. * * @public exported from `@promptbook/components` */ export declare function PromptbookAgentIntegration(props: PromptbookAgentIntegrationProps): import("react/jsx-runtime").JSX.Element | undefined;