@plteam/chat-ui
Version:
CUI Kit is a free and open-source library for creating AI assistant chat interfaces, built with React, Material UI, and TypeScript
21 lines (20 loc) • 994 B
TypeScript
import * as React from 'react';
import { AdapterType } from './AdapterType';
import { MessageModel } from '../../models';
/**
* @deprecated - We abandoned (perhaps temporarily) React Context because it created unnecessary renders and slowed down the chat
*/
declare const AdapterContext: React.Context<AdapterType<any, any>>;
declare const useAdapterContext: () => AdapterType;
/**
* A custom hook that provides a function to reverse transform a message using the
* `reverseMessageTransforming` function from the adapter context.
*
* The returned callback function takes a message model as input and applies the
* reverse transformation to the `data` property of the message if the
* `reverseMessageTransforming` function is available in the adapter context.
* If not, it returns the `data` property of the message as-is.
*
*/
export declare const useInternalMessageTransformer: () => (message: MessageModel) => any;
export { AdapterContext, useAdapterContext };