@nlux/react
Advanced tools
Comparing version 2.1.2-beta to 2.1.3-beta
import { useEffect, JSX, RefObject, FC, ReactElement, ComponentClass, ReactNode, Context } from 'react'; | ||
import { MessageOptions as MessageOptions$2, StandardChatAdapter as StandardChatAdapter$1, EventsMap as EventsMap$1, LayoutOptions as LayoutOptions$1, ConversationOptions as ConversationOptions$1, PromptBoxOptions as PromptBoxOptions$1, ContextItems, AiContext as AiContext$1, ContextItemDataType, ContextAdapter, ContextAdapterBuilder } from '@nlux/core'; | ||
export { AiChatPropsInEvents, ConversationOptions, ErrorCallback, ErrorEventDetails, EventCallback, EventName, EventsMap, HighlighterExtension, HistoryPayloadSize, LayoutOptions, MessageReceivedCallback, MessageRenderedCallback, MessageSentCallback, MessageStreamStartedCallback, PreDestroyCallback, PreDestroyEventDetails, PromptBoxOptions, ReadyCallback, ReadyEventDetails, UpdatableAiChatProps } from '@nlux/core'; | ||
import { MessageOptions as MessageOptions$2, StandardChatAdapter as StandardChatAdapter$1, EventsMap as EventsMap$1, DisplayOptions as DisplayOptions$1, ConversationOptions as ConversationOptions$1, PromptBoxOptions as PromptBoxOptions$1, ContextItems, AiContext as AiContext$1, ContextItemDataType, ContextAdapter, ContextAdapterBuilder } from '@nlux/core'; | ||
export { AiChatPropsInEvents, ConversationOptions, DisplayOptions, ErrorCallback, ErrorEventDetails, EventCallback, EventName, EventsMap, HighlighterExtension, HistoryPayloadSize, MessageReceivedCallback, MessageRenderedCallback, MessageSentCallback, MessageStreamStartedCallback, PreDestroyCallback, PreDestroyEventDetails, PromptBoxOptions, ReadyCallback, ReadyEventDetails, UpdatableAiChatProps } from '@nlux/core'; | ||
@@ -59,2 +59,3 @@ type UseEffectParams = Parameters<typeof useEffect>; | ||
type HistoryPayloadSize = number | 'max'; | ||
type ConversationDisplayMode = 'bubbles' | 'list'; | ||
interface ConversationOptions { | ||
@@ -68,2 +69,11 @@ /** | ||
/** | ||
* Indicates how items in the conversation should be displayed. | ||
* | ||
* - `list`: Chat items are displayed as a list with the AI responses underneath each user message. | ||
* - `bubbles`: Items are displayed as chat bubbles with the prompts on the right and the AI messages on the left. | ||
* | ||
* @default 'list' | ||
*/ | ||
displayMode?: ConversationDisplayMode; | ||
/** | ||
* Indicates the number of messages from conversation history that should be sent to the backend with each message. | ||
@@ -74,3 +84,3 @@ * For custom adapters, the history will be available as part of `extras.conversationHistory` attribute. | ||
* By default, the entire conversation history is sent with each message. | ||
* Set to `none` or `0` to disable sending conversation history with each message. | ||
* Set to `0` to disable sending conversation history with each message. | ||
* Or set to a positive integer to send a specific number of messages. | ||
@@ -83,11 +93,26 @@ * | ||
type LayoutOptions = { | ||
type DisplayOptions = { | ||
/** | ||
* The height of the chat component. This can be a number or a string with a unit (e.g. '100px'). | ||
* The theme ID to use. | ||
* This should be the ID of a theme that has been loaded into the page. | ||
*/ | ||
height?: number | string; | ||
themeId?: string; | ||
/** | ||
* The width of the chat component. This can be a number or a string with a unit (e.g. '100px'). | ||
* Color scheme for the component. | ||
* This can be 'light', 'dark', or 'auto'. | ||
* | ||
* If 'auto' is used, the component will automatically switch between 'light' and 'dark' based on the user's | ||
* operating system preferences (if it can be detected), otherwise it will default to 'light'. | ||
* | ||
* @default 'auto' | ||
*/ | ||
colorScheme?: 'light' | 'dark' | 'auto'; | ||
/** | ||
* The width of the component. | ||
*/ | ||
width?: number | string; | ||
/** | ||
* The height of the component. | ||
*/ | ||
height?: number | string; | ||
}; | ||
@@ -222,6 +247,5 @@ | ||
adapter: ChatAdapter<AiMsg> | StandardChatAdapter<AiMsg>; | ||
className?: string; | ||
events?: Partial<EventsMap<AiMsg>>; | ||
initialConversation?: ChatItem<AiMsg>[]; | ||
themeId?: string; | ||
className?: string; | ||
promptBoxOptions?: PromptBoxOptions; | ||
@@ -231,3 +255,3 @@ conversationOptions?: ConversationOptions; | ||
personaOptions?: PersonaOptions$1; | ||
layoutOptions?: LayoutOptions; | ||
displayOptions?: DisplayOptions; | ||
}; | ||
@@ -529,14 +553,10 @@ /** | ||
/** | ||
* The theme ID to use. | ||
* This should be the ID of a theme that has been loaded into the page. | ||
*/ | ||
themeId?: string; | ||
/** | ||
* The initial conversation history to display. | ||
* This is not a reactive prop! Changing it after the component is mounted will not update the conversation. | ||
*/ | ||
initialConversation?: ChatItem<AiMsg>[]; | ||
/** | ||
* Layout options. | ||
* Display options, such as color scheme, width, etc. | ||
*/ | ||
layoutOptions?: LayoutOptions$1; | ||
displayOptions?: DisplayOptions$1; | ||
/** | ||
@@ -543,0 +563,0 @@ * Options for the conversation. |
{ | ||
"name": "@nlux/react", | ||
"version": "2.1.2-beta", | ||
"version": "2.1.3-beta", | ||
"description": "nlux React is a library for building conversational AI interfaces, with support for OpenAI, HuggingFace, and more.", | ||
@@ -62,3 +62,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@nlux/core": "2.1.2-beta" | ||
"@nlux/core": "2.1.3-beta" | ||
}, | ||
@@ -65,0 +65,0 @@ "peerDependencies": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1733
311524
+ Added@nlux/core@2.1.3-beta(transitive)
- Removed@nlux/core@2.1.2-beta(transitive)
Updated@nlux/core@2.1.3-beta