Difference between revisions of "Edge AI SDK/GenAIChatbot"

From ESS-WIKI
Jump to: navigation, search
Line 173: Line 173:
  
 
= Example =
 
= Example =
 +
  
  
Line 181: Line 182:
  
 
== Creating an Audio + RAG Chatbot for Medication Assistant ==
 
== Creating an Audio + RAG Chatbot for Medication Assistant ==
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">[[File:RAG-arch.png|none|900x600px|RAG-arch.png]]</div>  
+
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">[[File:EAS-GenAI DevKit.jpg|none|800x400px|GenAI Chatbot DevKit]]</div>  
 
=== <span style="font-size:large;">1. Configuring TTS with Azure AI Speech API</span> ===
 
=== <span style="font-size:large;">1. Configuring TTS with Azure AI Speech API</span> ===
 
<div style="margin-left: 2em;"><span style="font-size:large;">[[#Create_an_Account_on_Azure_AI_Speech_API|(1). Create an Account on Azure AI Speech API]]</span></div> <div style="margin-left: 2em;"><span style="font-size:larger;">[[#Setting_Up_on_GenAI_Chatbot|(2). Setting Up on GenAI Chatbot]]</span></div> <div style="margin-left: 2em;">&nbsp;</div>  
 
<div style="margin-left: 2em;"><span style="font-size:large;">[[#Create_an_Account_on_Azure_AI_Speech_API|(1). Create an Account on Azure AI Speech API]]</span></div> <div style="margin-left: 2em;"><span style="font-size:larger;">[[#Setting_Up_on_GenAI_Chatbot|(2). Setting Up on GenAI Chatbot]]</span></div> <div style="margin-left: 2em;">&nbsp;</div>  
 
 
=== <span style="font-size:large;">2. Create Knowledge</span>&nbsp; ===
 
=== <span style="font-size:large;">2. Create Knowledge</span>&nbsp; ===
 
<div style="margin-left: 2em;"><div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">[[File:Rag-1.png|none|900x600px|Rag-1.png]]</div>  
 
<div style="margin-left: 2em;"><div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">[[File:Rag-1.png|none|900x600px|Rag-1.png]]</div>  
Line 204: Line 204:
  
 
&nbsp;
 
&nbsp;
</div>
+
</div>  
 
 
 
=== <span style="font-size:large;">3. Create a Chatbot Assistant with RAG ( Knwledge )</span> ===
 
=== <span style="font-size:large;">3. Create a Chatbot Assistant with RAG ( Knwledge )</span> ===
 
<div style="margin-left: 2em;"><div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">[[File:Rag-7.png|none|900x600px|Rag-7.png]]</div>  
 
<div style="margin-left: 2em;"><div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">[[File:Rag-7.png|none|900x600px|Rag-7.png]]</div>  
Line 232: Line 231:
 
&nbsp;
 
&nbsp;
 
</div> <div style="margin-left: 2em;"><div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">[[File:Rag-10.png|none|900x600px|Rag-10.png]]</div>  
 
</div> <div style="margin-left: 2em;"><div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">[[File:Rag-10.png|none|900x600px|Rag-10.png]]</div>  
<span style="font-size:larger;">After successful creation, a notification will appear at icon 1.''</span>
+
<span style="font-size:larger;">After successful creation, a notification will appear at icon 1.</span>
  
 
<span style="font-size:larger;">Then, click on the model ( icon 2 ) to enter the model chat.</span>&nbsp;<span style="font-size:larger;">Start using the audio assistant.</span>
 
<span style="font-size:larger;">Then, click on the model ( icon 2 ) to enter the model chat.</span>&nbsp;<span style="font-size:larger;">Start using the audio assistant.</span>

Revision as of 09:21, 29 May 2025

Brief of GenAI Chatbot


Introduction

GenAI Chatbot is a next-generation conversational AI assistant built on the OLLAMA architecture, supporting all models compatible with OLLAMA. Designed for seamless integration with GenAI Studio, it allows users to directly import models that have been fine-tuned within GenAI Studio, enabling easy deployment and immediate use of custom models in the chatbot. At its core, GenAI Chatbot utilizes efficient Small Language Models (SLMs) to provide natural, context-aware interactions. The chatbot features advanced capabilities, including audio processing (Speech-to-Text [STT], Text-to-Speech [TTS]), Retrieval-Augmented Generation (RAG), and an embedded vector database (VectorDB), all within a flexible configuration suitable for diverse application scenarios. It is currently optimized for embedded platforms such as NVIDIA Jetson Orin Nano and Jetson Orin AGX.

How To

Download SLM Models from GenAI Studio

Genai-studio-1.png
  • Click on icon 1 to open the GenAI Studio Hub page.
  • At icon 2, enter the URL of your GenAI Studio.
  • Click on icon 3 to save your settings.
  • Once the configuration is successful, a notification will appear as shown at icon 4.
  • Icon 5 displays a list of all models supported by GenAI Studio.
  • Click on icon 6 to download the desired model.
Genai-studio-2.png
  • Once the download begins, a loading icon will be displayed.
Genai-studio-3.png
  • After the download is complete, a notification will appear, and the download icon will change to a completion icon.
Genai-studio-4.png
  • After the model has finished downloading, click on icon 1 to create a new conversation.
  • Next, click on icon 2 to select the model you just downloaded and start using it.

 

Create a new chatbot assistant with RAG

Rag-1.png
  • Click on icon 1 to open the Workspace page.
  • Click on icon 2 to open the Knowledge settings.
  • Click on icon 3 to add new Knowledge.
Rag-2.png
  • Enter the title at icon 1.
  • Enter the content at icon 2.
  • Click on icon 3 to create the Knowledge.
Rag-3.png
  • The page will automatically switch back to the Knowledge section. After creation is complete, a notification will appear.
Rag-4.png
  • Click on icon 1, the "+" icon.
  • Click on icon 2, "Upload files."
Rag-5.png
  • A file selection window will pop up. Select the files you want to use.
Rag-6.png
  • After the upload, the files will be displayed and a success notification will appear.
Rag-7.png
  • After the Knowledge is created, click on icon 1 to go to the Models page.
  • Click on icon 2, the "+" icon, to add a new knowledge model.
Rag-8.png
  • On the add new model page, fill in and select the required fields shown in the red box: Title, Subtitle, Base Model, and System Prompt.
Rag-9.png
  • Continuing from the previous page, click on icon 1 to select the Knowledge you just created, then click on icon 2 to save and create the model.
Rag-10.png
  • After successful creation, a notification will appear at icon 1. Then, click on the model at icon 2 to enter the model chat.
Rag-11.png
  • The chat window will display that the model in use is the Knowledge model you created.
Rag-12.png
  • After starting the conversation, you will see that the model retrieves information from the Knowledge you created in its responses.

 

Configuring TTS with Azure AI Speech API

Create an Account on Azure AI Speech API

1. Create an Azure account

Azure-1.png
  • Get started with Azure’s free account: new users receive $200 credit for 30 days and free access to popular services.
Azure-2.png
  • AI Speech – Text-to-Speech: 500,000 neural characters per month for free accounts

2. Set Up the Azure Speech Service

Azure-speech-1.png
Azure-speech-2.png
  • Click on icon 1: "AI + Machine Learning"
  • Then, click on icon 2: "Speech"
Azure-speech-3.png
  • Click on “Start” at the position marked by the red box.
Azure-speech-4.png
  • Click "Create" and fill in the necessary details:
    • Subscription: Choose your Azure subscription.
    • Resource Group: Select an existing group or create a new one.
    • Region: Choose a region close to your location.
    • Name: Provide a unique name for your Speech resource.
    • Pricing Tier: Select Free F0.
    • Click on icon 2: "Review + create"
Azure-speech-5.png
  • After confirming the information, click the “Create” button.
Azure-speech-6.png
  • After entering the overview page, click on the name link of the resource you created under "Resource."
Azure-speech-7.png
  • In the left-hand menu, click on "Keys and Endpoint".
  • Note down the Key1 or Key2 and the Endpoint URL; you'll need these to authenticate your API requests.

Setting Up on GenAI Chatbot

Stt-tts-1.png
  • Select icon 1 and click on "Admin Panel."
Stt-tts-2.png
  • Find the TTS Settings section and select the Engine you want to use, as shown at icon 2: "Azure AI Speech"
Stt-tts-3.png
  • Enter the Azure AI Speech API token at icon 1.
  • Click on icon 2, "Save."
  • Finally, you will see a success notification at icon 3.
Stt-tts-4.png
  • Go to the chat window and click on icon 1, the conversation icon.
  • An icon will appear at the position of icon 2, indicating that the feature is ready to use.

Evaluate the Benchmark of Each Chatbot Response

Chatbot-benchmark.png
  • An information button is provided next to each response. Clicking it reveals detailed performance and inference statistics for that response, including token counts, processing speed, and computation time. This allows developers to monitor and optimize system performance in real time.

Example

Creating an Audio + RAG Chatbot for Medication Assistant

GenAI Chatbot DevKit

1. Configuring TTS with Azure AI Speech API

(1). Create an Account on Azure AI Speech API
(2). Setting Up on GenAI Chatbot
 

2. Create Knowledge 

Rag-1.png

1. Client the Workspace from the left menu.
2. Go to the Knowledge
3. Click the + icon to add a new knowledge 

Here are sample files: * 'tial_Q&As_About_Over-the-Counter_(OTC)_Medication_Use.pdf , * '10_Essential_Q&As_About_Over-the-Counter_(OTC)_Medication_Use.txt  

 
 
Rag-2.png

1. Enter the title.
2. Enter the goal or description.
3. Click the "Create Knowledge" button to finish.

 

 

Rag-4.png

1. Click the "+" icon
2. Click the "Upload files" to upload files.  

 

Rag-6.png

After the upload, the files will be displayed and a success notification will appear.  

 

3. Create a Chatbot Assistant with RAG ( Knwledge )

Rag-7.png

1. Go to the Models tab.
2. Click the "+" icon, to add a new model.  

 

Rag-8.png

 

On the add new model page, fill in and select the required fields shown in the red box:

* Title, * Subtitle, * Base Model, and *System Prompt.  

 

Rag-9.png

 

Continuing from the previous page,

1. Click the "Select Knowledge" to select the Knowledge you just created,

2. Click the "Save & Create" to save and create.  

 

 

Rag-10.png

After successful creation, a notification will appear at icon 1.

Then, click on the model ( icon 2 ) to enter the model chat. Start using the audio assistant.

 

 

Rag-stt-tts-4.png

1. Make sure the select model is the RAG model.
2. Click the mic icon to start voice mode.
3. While speaking, the system will show a listening status.
4. After speaking, your question will appear as text.
5. The Medical Chatbot Assistant will response and play the answer with audio.