Nothing Special   »   [go: up one dir, main page]

Synopsis-1

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Synopsis

Introduction: Welcome to the OpenAI Demo Project! This project


demonstrates the integration of Azure Cognitive Search with Azure
OpenAI Service to create an intelligent and highly efficient search
application. By leveraging the advanced capabilities of OpenAI’s language
models, this demo enhances search functionality, providing more
accurate and contextually relevant results.

OBJECTIVES: Showcase Integration: Demonstrate how Azure Cognitive


Search and OpenAI Service can be combined to improve search
capabilities.

Enhance Search Experience: Provide a more intuitive and accurate search


experience using AI-driven insights.

Offer Practical Insights: Present a practical example of how AI can be


utilized to solve real-world search challenges.

FETURES:

 Chat (multi-turn) and Q&A (single turn) interfaces


 Renders citations and thought process for each answer
 Includes settings directly in the UI to tweak the behaviour and
experiment with options
 Integrates Azure AI Search for indexing and retrieval of documents,
with support for many document formats as well as integrated
vectorisation
 Optional usage of GPT-4 with vision to reason over image-heavy
documents
 Optional addition of speech input/output for accessibility
 Optional automation of user login and data access via Microsoft
Entra
 Performance tracing and monitoring with Application Insights

WORKING:
Azure Account requirements :

IMPORTANT: In order to deploy and run this example, you'll need:

Azure account. If you're new to Azure, get an Azure account for free and
you'll get some free Azure credits to get started. See guide to deploying
with the free trial.

Azure subscription with access enabled for the Azure OpenAI service. You
can request access with this form. If your access request to Azure OpenAI
service doesn't match the acceptance criteria, you can use OpenAI public
API instead. Learn how to switch to an OpenAI instance.

Azure account permissions:

Your Azure account must have


Microsoft.Authorization/roleAssignments/write permissions, such as Role
Based Access Control Administrator, User Access Administrator, or Owner.
If you don't have subscription-level permissions, you must be granted
RBAC for an existing resource group and deploy to that existing group.

Your Azure account also needs Microsoft.Resources/deployments/write


permissions on the subscription level.

Cost Estimation :

Pricing varies per region and usage, so it isn’t possible to predict exact
costs for your usage. However, you can try the Azure pricing calculator for
the resources below.
Azure App Service: Basic Tier with 1 CPU core, 1.75 GB RAM. Pricing per
hour. Pricing

Azure OpenAI: Standard tier, GPT and Ada models. Pricing per 1K tokens
used, and at least 1K tokens are used per question. Pricing Azure AI
Document Intelligence: SO (Standard) tier using pre-built layout. Pricing
per document page, sample documents have 261 pages total. Pricing
Azure AI Search: Basic tier, 1 replica, free level of semantic search.
Pricing per hour. Pricing Azure Blob Storage: Standard tier with ZRS
(Zone-redundant storage). Pricing per storage and read operations.
Pricing

Azure Monitor: Pay-as-you-go tier. Costs based on data ingested. Pricing

To reduce costs, you can switch to free SKUs for various services, but
those SKUs have limitations. See this guide on deploying with minimal
costs for more details.

⚠️To avoid unnecessary costs, remember to take down your app if it’s no
longer in use, either by deleting the resource group in the Portal or
running azd down.

GitHub Codespace :

You can run this repo virtually by using GitHub Codespaces, which will
open a web-based VS Code in your browser: Once the codespace opens
(this may take several minutes), open a terminal window.

 open GitHub Codespace

VS Code Dev Containers :

A related option is VS Code Dev Containers, which will open the project in
your local VS Code using the Dev Containers extension:

Start Docker Desktop (install it if not already installed)

Open the project: In the VS Code window that opens, once the project
files show up (this may take several minutes), open a terminal window.

Local Environment:

1. Install the required tools:


o Azure Developer CLI
o Python 3.9, 3.10, or 3.11
 Important: Python and the pip package manager must be in the path in Windows
for the setup scripts to work.
 Important: Ensure you can run python --version from console. On Ubuntu, you
might need to run sudo apt install python-is-python3 to link python to python3.
o Node.js 18+
o Git
o Powershell 7+ (pwsh) - For Windows users only.
 Important: Ensure you can run pwsh.exe from a PowerShell terminal. If this fails,
you likely need to upgrade PowerShell.

2. Create a new folder and switch to it in the terminal.

3. Run this command to download the project code:

azd init -t azure-search-openai-demo

Note that this command will initialize a git repository, so you do not need to
clone this repository.

Deploying:
Follow these steps to provision Azure resources and deploy the application code:

1. Login to your Azure account:

azd auth login

2. Create a new azd environment:

azd env new


Enter a name that will be used for the resource group. This will create a new
folder in the .azure folder, and set it as the active environment for any calls
to azd going forward.

3. (Optional) This is the point where you can customize the deployment by setting
environment variables, in order to use existing resources, enable optional
features (such as auth or vision), or deploy to free tiers.

4. Run azd up - This will provision Azure resources and deploy this sample to those
resources, including building the search index based on the files found in
the ./data folder.
o Important: Beware that the resources created by this command will incur immediate
costs, primarily from the AI Search resource. These resources may accrue costs even if
you interrupt the command before it is fully executed. You can run azd down or delete the
resources manually to avoid unnecessary spending.
o You will be prompted to select two locations, one for the majority of resources and one
for the OpenAI resource, which is currently a short list. That location list is based on
the OpenAI model availability table and may become outdated as availability changes.
5. After the application has been successfully deployed you will see a URL printed
to the console. Click that URL to interact with the application in your browser. It
will look like the following:

NOTE: It may take 5-10 minutes after you see 'SUCCESS' for the application to be fully
deployed. If you see a "Python Developer" welcome screen or an error page, then wait
a bit and refresh the page. See guide on debugging App Service deployments.

You might also like