/react-component-toolkit-openai-demo

A sample demo for building and testing react components and includes a set of unique features including AI component generation and automatic conversion to Azure APIM Widgets

Primary LanguageBicepMIT LicenseMIT

page_type languages products urlFragment name description
sample
azdeveloper
bicep
powershell
azure
azure-api-management
azure-openai
react-component-toolkit-openai-demo
React Component Toolkit with ChatGPT and Azure OpenAI
A sample demo for building and testing react components and includes a set of unique features including AI component generation and automatic conversion to Azure APIM Widgets.

React Component Toolkit with ChatGPT and Azure OpenAI

The React Component Toolkit is a toolkit for building and testing react components and includes a set of unique features including AI component generation and automatic conversion to Azure APIM Widgets. This samples provides auto-provisioning of necessary Azure resources and an interactive process of utilizing the toolkit.

RCT Architecture

Features

This project framework provides the following features:

  • Integrates with Azure Open AI allowing the creation of components from a description alone.
  • Can convert a react component into an Azure API Management Widget.
  • Can be tested standalone using ladle which is built into the toolkit stack.
  • Includes a few example components including a markdown viewer, force-graph-3d component, etc.
  • Automatically adds dependencies for created components.
  • Uses css as code through Styled Components out of the box.

Getting Started

IMPORTANT: In order to deploy and run this example, you'll need an Azure subscription with access enabled for the Azure OpenAI service. You can request access here. You can also visit here to get some free Azure credits to get you started.

Prerequisites

To Run Locally

NOTE: Your Azure Account must have Microsoft.Authorization/roleAssignments/write permissions, such as User Access Administrator or Owner.

Quickstart

  1. git clone https://github.com/Azure-Samples/react-component-toolkit-openai-demo.git
  2. cd react-component-toolkit-openai-demo
  3. Run azd auth login
  4. Run azd up - This will provision Azure resources in your specified azd environment.

NOTE: For the target location, the regions that currently support the models used in this sample are East US, South Central US, or West Europe For an up-to-date list of regions and models, check here. It may take a minute for the services to be provisioned and te application to be fully deployed.

  1. After the services have been successfully provisioned, a post-provision script would automatically execute doing the following:
    • the react-component-toolkit would be cloned locally
    • you would be able to follow the prompts in console and interact with the local toolkit to generate new react components (for full documentation on the react component toolkit, refer to here)

Resources