DevExtreme v25.2 is now available.

Explore our newest features/capabilities and share your thoughts with us.

Your search did not match any results.

React Chat - AI and Chatbot Integration

This demo leverages the Azure OpenAI service alongside the DevExtreme JavaScript Chat component. You can integrate JavaScript Chat with multiple AI services, including OpenAI, Google Dialogflow, and Microsoft Bot Framework.

Handling dataSource (reloadOnChange: false)

The JavaScript Chat component's dataSource is a CustomStore that implements its own load and insert functions. The DevExtreme JavaScript Chat component deactivates reloadOnChange to push updates directly into the store and update the conversation manually. See the onMessageEntered event handler and the processMessageSending function to review the code that manages data transfer between our JavaScript Chat component and its data store.

The source code for the React version of this demo will be available soon.

Custom Message Template

The JavaScript Chat specifies a messageTemplate that displays "Copy" and "Regenerate" buttons in bot messages.

Response Format Conversion: Markdown to HTML

The AI model outputs responses in Markdown, while the JavaScript Chat requires HTML output. This example uses the unified plugin library to convert response content. Review convertToHtml function code for implementation details.

Default Caption Customization

The JavaScript Chat component in this demo displays modified captions when the conversation is empty. The demo uses localization techniques to alter built-in text.