sissimonster / medicalassistantdemo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enhancing Patient Care with OpenAI: A Blazor and Azure Speech AI Medical Assistant Web App

This project is a sample application that uses OpenAI and Azure Speech to create a QnA "Medical Assistant". It can answer questions about a patient's medical history in natural language, much like ChatGPT but with its own knowledge base.

OpenAI Medical Assistant

Components

The project has two principal components.

OpenAI QnA API

The project Azure_Functions_OpenAI is an Azure Function API that uses the OpenAI Python SDK to send the request to OpenAI service and returns the response

Blazor Web App

The project Blazor_QnA_OpenAI is a Blazor WASM app that asks the user for a prompt (in text or voice), uses the Azure Speech SDK to convert voice to text, sends the prompt to the Azure Function API, and displays the response.

Prerequisites

Run the Project

First, we need to run the Azure Functions API, open the project Azure_Functions_OpenAI in VS Code, edit the file local.settings.json and change the next key with your OpenAI subscription key

"OPENAI_API_KEY": "{OpenAI KEY}"

Then open a terminal to run the command:

func start

The API runs in http://localhost:7071/api/CallQnAApi

Second, we need to run the web project, open the project Blazor_QnA_OpenAI in VS Code, edit the file CQnAOpenAI.razor.js and change the next line with your Azure Speech subscription key and region

var subscriptionKey = "{Azure Speech Subscription Key}", serviceRegion = "{Azure Speech Region}";

If you want the project to understand you in English you have to change the value of the next line to en-US

speechConfig.speechRecognitionLanguage = "es-MX";

Then open a terminal to run the command:

dotnet watch

The project runs in http://localhost:5082

You can change the dummy patient history and ask any question about the history in text or by voice. Much like ChatGPT it will understand the natural language and give you a response.

Blog Post ChatGPT | Asistente MĂ©dico con OpenAI usando Blazor y Azure Speech

About


Languages

Language:HTML 51.3%Language:CSS 28.4%Language:JavaScript 9.9%Language:Python 8.2%Language:C# 2.2%