@promptbook/utils
Version:
Promptbook: Turn your company's scattered knowledge into AI ready books
68 lines (67 loc) • 2.31 kB
TypeScript
import { CSSProperties } from 'react';
import type { AgentBasicInformation } from '../../book-2.0/agent-source/AgentBasicInformation';
import { string_css_class } from '../../types/typeAliases';
/**
* @private props of PromptbookAgentIntegration component
*/
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;
/**
* 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;
/**
* TODO: !!! Load the full branding
* TODO: !!! <promptbook-agent> element
*/