Coder Social home page Coder Social logo

azure-samples / azure-search-openai-demo Goto Github PK

View Code? Open in Web Editor NEW
5.3K 5.3K 3.3K 9.52 MB

A sample app for the Retrieval-Augmented Generation pattern running in Azure, using Azure AI Search for retrieval and Azure OpenAI large language models to power ChatGPT-style and Q&A experiences.

Home Page: https://azure.microsoft.com/products/search

License: MIT License

Python 65.61% HTML 0.06% TypeScript 14.94% CSS 1.71% Bicep 15.13% PowerShell 1.37% Shell 1.17%
azd-templates azure azurecognitivesearch azureopenai chatgpt openai

azure-search-openai-demo's Introduction

name description languages products page_type urlFragment
ChatGPT + Enterprise data
Chat with your data using OpenAI and AI Search.
python
typescript
bicep
azdeveloper
azure-openai
azure-cognitive-search
azure-app-service
azure
sample
azure-search-openai-demo

ChatGPT + Enterprise data with Azure OpenAI and AI Search

Important

As of November 15, 2023, Azure Cognitive Search has been renamed to Azure AI Search.

Announcing JavaScript, .NET, and Java samples based on this one (Python). Learn more at https://aka.ms/azai.

Table of Contents

Open in GitHub Codespaces Open in Dev Containers

This sample demonstrates a few approaches for creating ChatGPT-like experiences over your own data using the Retrieval Augmented Generation pattern. It uses Azure OpenAI Service to access a GPT model (gpt-35-turbo), and Azure AI Search for data indexing and retrieval.

The repo includes sample data so it's ready to try end to end. In this sample application we use a fictitious company called Contoso Electronics, and the experience allows its employees to ask questions about the benefits, internal policies, as well as job descriptions and roles.

RAG Architecture

Features

  • Chat and Q&A interfaces
  • Explores various options to help users evaluate the trustworthiness of responses with citations, tracking of source content, etc.
  • Shows possible approaches for data preparation, prompt construction, and orchestration of interaction between model (OpenAI) and retriever (AI Search)
  • Settings directly in the UX to tweak the behavior and experiment with options
  • Performance tracing and monitoring with Application Insights

Chat screen

๐Ÿ“บ Watch a video overview of the app.

Azure account requirements

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

Azure deployment

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: Standard 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.

Project setup

You have a few options for setting up this project. The easiest way to get started is GitHub Codespaces, since it will setup all the tools for you, but you can also set it up locally if desired.

GitHub Codespaces

You can run this repo virtually by using GitHub Codespaces, which will open a web-based VS Code in your browser:

Open in GitHub Codespaces

Once the codespace opens (this may take several minutes), open a terminal window.

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:

  1. Start Docker Desktop (install it if not already installed)
  2. Open the project: Open in Dev Containers
  3. 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:

    • Azure Developer CLI
    • 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.
    • Node.js 14+
    • Git
    • 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.

    • 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.
    • 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:

'Output from running azd up'

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.

Deploying again

If you've only changed the backend/frontend code in the app folder, then you don't need to re-provision the Azure resources. You can just run:

azd deploy

If you've changed the infrastructure files (infra folder or azure.yaml), then you'll need to re-provision the Azure resources. You can do that by running:

azd up

Sharing environments

To give someone else access to a completely deployed and existing environment, either you or they can follow these steps:

  1. Install the Azure CLI
  2. Run azd init -t azure-search-openai-demo or clone this repository.
  3. Run azd env refresh -e {environment name} They will need the azd environment name, subscription ID, and location to run this command. You can find those values in your .azure/{env name}/.env file. This will populate their azd environment's .env file with all the settings needed to run the app locally.
  4. Set the environment variable AZURE_PRINCIPAL_ID either in that .env file or in the active shell to their Azure ID, which they can get with az ad signed-in-user show.
  5. Run ./scripts/roles.ps1 or .scripts/roles.sh to assign all of the necessary roles to the user. If they do not have the necessary permission to create roles in the subscription, then you may need to run this script for them. Once the script runs, they should be able to run the app locally.

Running locally

You can only run locally after having successfully run the azd up command. If you haven't yet, follow the steps in Azure deployment above.

  1. Run azd auth login
  2. Change dir to app
  3. Run ./start.ps1 or ./start.sh or run the "VS Code Task: Start App" to start the project locally.

See more tips in the local development guide.

Using the app

  • In Azure: navigate to the Azure WebApp deployed by azd. The URL is printed out when azd completes (as "Endpoint"), or you can find it in the Azure portal.
  • Running locally: navigate to 127.0.0.1:50505

Once in the web app:

  • Try different topics in chat or Q&A context. For chat, try follow up questions, clarifications, ask to simplify or elaborate on answer, etc.
  • Explore citations and sources
  • Click on "settings" to try different options, tweak prompts, etc.

Monitoring with Application Insights

By default, deployed apps use Application Insights for the tracing of each request, along with the logging of errors.

To see the performance data, go to the Application Insights resource in your resource group, click on the "Investigate -> Performance" blade and navigate to any HTTP request to see the timing data. To inspect the performance of chat requests, use the "Drill into Samples" button to see end-to-end traces of all the API calls made for any chat request:

Tracing screenshot

To see any exceptions and server errors, navigate to the "Investigate -> Failures" blade and use the filtering tools to locate a specific exception. You can see Python stack traces on the right-hand side.

You can also see chart summaries on a dashboard by running the following command:

azd monitor

Customizing the UI and data

Once you successfully deploy the app, you can start customizing it for your needs: changing the text, tweaking the prompts, and replacing the data. Consult the app customization guide as well as the data ingestion guide for more details.

Productionizing

This sample is designed to be a starting point for your own production application, but you should do a thorough review of the security and performance before deploying to production. Read through our productionizing guide for more details.

Clean up

To clean up all the resources created by this sample:

  1. Run azd down
  2. When asked if you are sure you want to continue, enter y
  3. When asked if you want to permanently delete the resources, enter y

The resource group and all the resources will be deleted.

Troubleshooting

Here are the most common failure scenarios and solutions:

  1. The subscription (AZURE_SUBSCRIPTION_ID) doesn't have access to the Azure OpenAI service. Please ensure AZURE_SUBSCRIPTION_ID matches the ID specified in the OpenAI access request process.

  2. You're attempting to create resources in regions not enabled for Azure OpenAI (e.g. East US 2 instead of East US), or where the model you're trying to use isn't enabled. See this matrix of model availability.

  3. You've exceeded a quota, most often number of resources per region. See this article on quotas and limits.

  4. You're getting "same resource name not allowed" conflicts. That's likely because you've run the sample multiple times and deleted the resources you've been creating each time, but are forgetting to purge them. Azure keeps resources for 48 hours unless you purge from soft delete. See this article on purging resources.

  5. You see CERTIFICATE_VERIFY_FAILED when the prepdocs.py script runs. That's typically due to incorrect SSL certificates setup on your machine. Try the suggestions in this StackOverflow answer.

  6. After running azd up and visiting the website, you see a '404 Not Found' in the browser. Wait 10 minutes and try again, as it might be still starting up. Then try running azd deploy and wait again. If you still encounter errors with the deployed app, consult the guide on debugging App Service deployments. Please file an issue if the logs don't help you resolve the error.

Resources

Getting help

This is a sample built to demonstrate the capabilities of modern Generative AI apps and how they can be built in Azure. For help with deploying this sample, please post in GitHub Issues. If you're a Microsoft employee, you can also post in our Teams channel.

This repository is supported by the maintainers, not by Microsoft Support, so please use the support mechanisms described above, and we will do our best to help you out.

Note

Note: The PDF documents used in this demo contain information generated using a language model (Azure OpenAI Service). The information contained in these documents is only for demonstration purposes and does not reflect the opinions or beliefs of Microsoft. Microsoft makes no representations or warranties of any kind, express or implied, about the completeness, accuracy, reliability, suitability or availability with respect to the information contained in this document. All rights reserved to Microsoft.

azure-search-openai-demo's People

Contributors

achandmsft avatar adamdougal avatar ahnl avatar anatolip avatar darrenturchiarelli avatar dependabot[bot] avatar diberry avatar giterinhub avatar gkulin avatar gukoff avatar hyoshioka0128 avatar john0isaac avatar jongio avatar kesavarajark avatar kokuljose avatar liamca avatar lukemurraynz avatar maciejlitwiniec avatar marekjakimiuk1 avatar mattgotteiner avatar microsoftopensource avatar pablocastro avatar pamelafox avatar sogue avatar srbalakr avatar tonybaloney avatar vhvb1989 avatar weikanglim avatar wherewith avatar yuvalyaron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azure-search-openai-demo's Issues

The App can't understand the Chinese documents

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

  1. build a VM(Win10) in Azure and use it to deploy the APP.
  2. simply run azd loginใ€azd init -t azure-search-openai-demo
  3. put the Chinese documents in ./data folder.
  4. run azd up and ./script/prepdocs.ps1 to split the documents and upload to blob and insert imformation to search index.
  5. open the endpoint and start to use the app.
  6. issue๏ผšcan't answer the question based on the Chinese document.

Any log messages given by the failure

No.

Expected/desired behavior

Only can read English documents and answer. Can't read Chinese documents and answer the questions.

OS and Version?

Windows 10

Versions

0eed611

Mention any other details that might be useful

Try to change the analyzer in cognitive search service to Chinese, but the app still can't read Chinese documents, the search service can. I have tried the cognitive service on Azure portal.


Thanks! We'll be in touch soon.

Deployment failed using existing OpenAI resource

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Follow the document and use existing OpenAI resource instead of creating new:
Run azd env set AZURE_OPENAI_SERVICE {Name of existing OpenAI service}
Run azd env set AZURE_OPENAI_RESOURCE_GROUP {Name of existing resource group that OpenAI service is provisioned to}
Run azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT {Name of existing ChatGPT deployment}. Only needed if your ChatGPT deployment is not the default 'chat'.
Run azd env set AZURE_OPENAI_GPT_DEPLOYMENT {Name of existing GPT deployment}. Only needed if your ChatGPT deployment is not the default 'davinci'.
Run azd up

Any log messages given by the failure

In deployment detail, it shows the OpenAI resource is conflict with existing one.

Expected/desired behavior

When I use existing OpenAI resource, it should not deploy OpenAI resource:
{ "status": "Failed", "error": { "code": "InvalidResourceLocation", "message": "The resource 'xxx' already exists in location 'southcentralus' in resource group 'xxx'. A resource with the same name cannot be created in location 'eastus'. Please select a new resource name." } }

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

Inject other formats different to PDF and creating custom indexes in Azure Search

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ X] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Any log messages given by the failure

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

Hi

Is there any easy way to inject other source file formats like .doc, .txt or .json?
I'm also trying to create new indexes created by parsing files in Azure Search directly, but looks like the demo heavily relays on an index with just "content" and "sourcefile" fields created. Is there an easy hack to modify this?

Thanks!

Fail to change gptDeploymentName and chatGptDeploymentName

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

When using existing openAi service and model, change variables AZURE_OPENAI_CHATGPT_DEPLOYMENT and AZURE_OPENAI_GPT_DEPLOYMENT not works.

OS and Version?

Windows 11 in powershell.

Mention any other details that might be useful

Have created a bug fix PR: #41

The index 'gptkbindex' for service 'gptkb-d3g3thoxsz5ve' was not found.

I'm done with the deployment but when using the app (chat or ask question) I got this error message. Looking into the ressource there's no index that have been created.

Error: () The index 'gptkbindex' for service 'gptkb-d3g3thoxsz5ve' was not found.
Code:
Message: The index 'gptkbindex' for service 'gptkb-d3g3thoxsz5ve' was not found.

Control plane for existing Cognitive Services OpenAI deployments is inactive. Unable to delete.

Please provide us with the following information:

This issue is for a: (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Deploy an OpenAI service. Attempt to delete the OpenAI service.

Any log messages given by the failure

The control plane for my existing Cognitive Services OpenAI deployments seems to be inactive. I have two deployments for this sample (Chat and DaVinci), and when I click on either of them in the OpenAI Studio, the "Delete Deployment" button is greyed out. Please see images below. This is from a deployment 12 hours ago. There is no action I can take to delete these services in either the Azure Portal or the OpenAI Studio. I have "purged" any previously deleted deployments via the OpenAI pane in the Azure Portal, so there are no other older deployments still pending. In addition, when I try to deploy via the CLI, I receive this error message:

ERROR: deployment failed: error deploying infrastructure: failed deploying: starting deployment to subscription: PUT https://management.azure.com/subscriptions/7c9469c0-29ac-424a-85ab-d01f2-xxxx-xxxx/providers/Microsoft.Resources/deployments/openai-georgem-22

RESPONSE 409: 409 Conflict
ERROR CODE: DeploymentActive

{
"error": {
"code": "DeploymentActive",
"message": "Unable to edit or replace deployment 'openai-georgem-22': previous deployment from '3/22/2023 12:21:06 AM' is still active (expiration time is '3/28/2023 11:24:15 PM'). Please see https://aka.ms/arm-deploy-resources for usage details."
}
}

Expected/desired behavior

The delete button should work, allowing me to clean up any previous OpenAI service deployment. See below:
OpenAI Studio 2023-03-22 061144

All Cognitive Services resources are purged for this subscription:
Purged Resources 2023-03-22 061351

Current image from the portal showing a successful deployment:

OpenAI Succeeded 2023-03-22 061425

OS and Version?

Windows 11

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

DefaultAzureCredential failed to retrieve a token from the included credentials

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

When i run azd up ( part of predocs.ps1), i am getting following error and search index gptkbindex didn't get created as part of this process. I created gptkbindex manually. Data files are not getting uploaded to storage account.

Any log messages given by the failure

DefaultAzureCredential failed to retrieve a token from the included credentials.
Attempted credentials:
EnvironmentCredential: EnvironmentCredential authentication unavailable. Environment variables are not fully configured.
Visit https://aka.ms/azsdk/python/identity/environmentcredential/troubleshoot to troubleshoot.this issue.
ManagedIdentityCredential: ManagedIdentityCredential authentication unavailable, no response from the IMDS endpoint.
SharedTokenCacheCredential: SharedTokenCacheCredential authentication unavailable. No accounts were found in the cache.
AzureCliCredential: Azure CLI not found on path
AzurePowerShellCredential: Az.Account module >= 2.2.0 is not installed
To mitigate this issue, please refer to the troubleshooting guidelines here at https://aka.ms/azsdk/python/identity/defaultazurecredential/troubleshoot.
Traceback (most recent call last):
File "โ€ฆโ€ฆโ€ฆ...Documents\workspace\lia\azure-search-openai-demo\scripts\prepdocs.py", line 208, in
create_search_index()
File "โ€ฆโ€ฆโ€ฆ...Documents\workspace\lia\azure-search-openai-demo\scripts\prepdocs.py", line 146, in create_search_index
if args.index not in index_client.list_index_names():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "โ€ฆโ€ฆโ€ฆ...AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\core\paging.py", line 132, in next
return next(self._page_iterator)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "โ€ฆโ€ฆโ€ฆ...AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\core\paging.py", line 76, in next
self._response = self._get_next(self.continuation_token)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "โ€ฆโ€ฆโ€ฆ...AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\search\documents\indexes_generated\operations_indexes_operations.py", line 512, in get_next
pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "โ€ฆโ€ฆโ€ฆ...AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\core\pipeline_base.py", line 205, in run
return first_node.send(pipeline_request) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "โ€ฆโ€ฆโ€ฆ...AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\core\pipeline_base.py", line 69, in send
response = self.next.send(request)
^^^^^^^^^^^^^^^^^^^^^^^
File "โ€ฆโ€ฆโ€ฆ...AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\core\pipeline_base.py", line 69, in send
response = self.next.send(request)
^^^^^^^^^^^^^^^^^^^^^^^
File "โ€ฆโ€ฆโ€ฆ...AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\core\pipeline_base.py", line 69, in send
response = self.next.send(request)
^^^^^^^^^^^^^^^^^^^^^^^
[Previous line repeated 2 more times]
File "โ€ฆโ€ฆโ€ฆ...AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\core\pipeline\policies_redirect.py", line 160, in send
response = self.next.send(request)
^^^^^^^^^^^^^^^^^^^^^^^
File "โ€ฆโ€ฆโ€ฆ...AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\core\pipeline\policies_retry.py", line 474, in send
response = self.next.send(request)
^^^^^^^^^^^^^^^^^^^^^^^
File "โ€ฆโ€ฆโ€ฆ...AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\core\pipeline\policies_authentication.py", line 115, in send
self.on_request(request)
File "โ€ฆโ€ฆโ€ฆ...AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\core\pipeline\policies_authentication.py", line 92, in on_request
self._token = self._credential.get_token(*self._scopes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "โ€ฆโ€ฆโ€ฆ...AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\identity_credentials\default.py", line 168, in get_token
return super(DefaultAzureCredential, self).get_token(*scopes, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "โ€ฆโ€ฆโ€ฆ...AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\identity_credentials\chained.py", line 101, in get_token
raise ClientAuthenticationError(message=message)
azure.core.exceptions.ClientAuthenticationError: DefaultAzureCredential failed to retrieve a token from the included credentials.
Attempted credentials:
EnvironmentCredential: EnvironmentCredential authentication unavailable. Environment variables are not fully configured.
Visit https://aka.ms/azsdk/python/identity/environmentcredential/troubleshoot to troubleshoot.this issue.
ManagedIdentityCredential: ManagedIdentityCredential authentication unavailable, no response from the IMDS endpoint.
SharedTokenCacheCredential: SharedTokenCacheCredential authentication unavailable. No accounts were found in the cache.
AzureCliCredential: Azure CLI not found on path
AzurePowerShellCredential: Az.Account module >= 2.2.0 is not installed
To mitigate this issue, please refer to the troubleshooting guidelines here at https://aka.ms/azsdk/python/identity/defaultazurecredential/troubleshoot.

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

Could this demo support Data Source from Azure SQL or Azure Cosmo DB?

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Any log messages given by the failure

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Versions

Mention any other details that might be useful

I saw the demo architecture on the readme,it can process data of Azure SQL and Cosmos DB with Azure Cognitive Search,but I can not see azure sql or cosmos service are created after I deployed this demo on Azure.Are there any ways to config the Azure SQL or Comos?So that we can search more data sources.

Thanks,

Teo


Thanks! We'll be in touch soon.

Feedback to the responses will be helpful ( Like and Dislike Button) for the Answer

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [X ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Any log messages given by the failure

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

Add devcontainer

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Ideally we'd have a devcontainer for isolation. It'll also avoid ppl running into troubles on Mac, Linux, ...

Azure Principal not getting used

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

when running azd up,

Any log messages given by the failure, I'm getting following errors:

RROR: deployment failed: error deploying infrastructure: failed deploying: deploying to subscription:

Deployment Error Details:
PrincipalNotFound: Principal 267b477fa2b74713828bac0b521997c0 does not exist in the directory aef24f28-acf3-4248-b8c4-4d5a0e42b3b0. Check that you have the correct principal ID. If you are creating this principal and then immediately assigning a role, this error might be related to a replication delay. In this case, set the role assignment principalType property to a value, such as ServicePrincipal, User, or Group. See https://aka.ms/docs-principaltype
PrincipalNotFound: Principal 267b477fa2b74713828bac0b521997c0 does not exist in the directory aef24f28-acf3-4248-b8c4-4d5a0e42b3b0. Check that you have the correct principal ID. If you are creating this principal and then immediately assigning a role, this error might be related to a replication delay. In this case, set the role assignment principalType property to a value, such as ServicePrincipal, User, or Group. See https://aka.ms/docs-principaltype
PrincipalNotFound: Principal 267b477fa2b74713828bac0b521997c0 does not exist in the directory aef24f28-acf3-4248-b8c4-4d5a0e42b3b0. Check that you have the correct principal ID. If you are creating this principal and then immediately assigning a role, this error might be related to a replication delay. In this case, set the role assignment principalType property to a value, such as ServicePrincipal, User, or Group. See https://aka.ms/docs-principaltype
PrincipalNotFound: Principal 267b477fa2b74713828bac0b521997c0 does not exist in the directory aef24f28-acf3-4248-b8c4-4d5a0e42b3b0. Check that you have the correct principal ID. If you are creating this principal and then immediately assigning a role, this error might be related to a replication delay. In this case, set the role assignment principalType property to a value, such as ServicePrincipal, User, or Group. See https://aka.ms/docs-principaltype
PrincipalNotFound: Principal 267b477fa2b74713828bac0b521997c0 does not exist in the directory aef24f28-acf3-4248-b8c4-4d5a0e42b3b0. Check that you have the correct principal ID. If you are creating this principal and then immediately assigning a role, this error might be related to a replication delay. In this case, set the role assignment principalType property to a value, such as ServicePrincipal, User, or Group. See https://aka.ms/docs-principaltype

Expected/desired behavior

Roles and rights assigned correctly.

OS and Version?

Windows 11

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

New pdf files do not get recognized as a provided source

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [X] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Not sure if this belongs to the intended purpose of this demo, but this is what I tried to do:

Upload a random pdf file to the storage account in the 'content' container
Restart the Web App
Ask a question about information provided in the uploaded pdf

Output provided in the Web App

The newly uploaded pdf file doesn't seem to be in scope.
image

Expected/desired behavior

The new pdf gets recognized and the questions about content in the pdf get answered.


Thanks! We'll be in touch soon.

Control Plane failures for OpenAI Resource Provider ("RequestConflict")

Please provide us with the following information:

This issue is for a: (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Create a new OpenAI resource with the Chat and Davinci models. Now delete the individual OpenAI models in OpenAI Studio, then attempt to delete the parent OpenAI resource in the Azure Portal. I am unable to delete the parent (empty) OpenAI resource in the Azure Portal until a multi-hour timeout window has passed. Until the internal issue resolves itself, I receive an "RequestConflict" error message from the Cognitive Services Resource Provider. Please see typical error message below.

I have no other OpenAI resources deployed or in process of deployment, so I do not understand why there would be a "RequestConflict" upon an empty OpenAI resource.

This makes it essentially impossible for me to use OpenAI because any cleanup operation or entirely new deployment can take hours for the Cognitive Services Conflict timeout to resolve. This is 100% reproducible for every deployment. Since I only have quota for one deployment at a time, this entirely blocks me. Please provide me with a workaround to this issue, perhaps with an additional quota so that I can still deploy a new resource while the deleting of the old resource times-out.

As an aside, even when it's working properly, it can still take >10 minutes to create a new OpenAI deployment via the Cognitive Services RP. Why does it take so long to create these resources? I can create an entirely new Virtual Machine in <2 minutes, so why is this RP so slow?

Any log messages given by the failure

Here is a typical error message from the Azure Portal:

Executed delete command on 1 selected items
Succeeded: 0, Failed: 1, Canceled: 0.
Error details
cog-k2mxpzdim5yjs: Cannot modify resource with id '/subscriptions/7c9469c0-29ac-424a-85ab-d01f2cexxxxx/resourceGroups/rg-openai-operator/providers/Microsoft.CognitiveServices/accounts/cog-k2mxpzdim5yjs' because the resource entity provisioning state is not terminal. Please wait for the provisioning state to become terminal and then retry the request. (Code: RequestConflict)

Expected/desired behavior

Delete operations should immediately delete the resources without internal conflicts.

OS and Version?

Windows 11

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

ChatGPT model version needs to be changed to '0301'

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Run the az up on the sample.

Any log messages given by the failure

ERROR: deployment failed: error deploying infrastructure: failed deploying: deploying to subscription:

Deployment Error Details:
InvalidTemplateDeployment: The template deployment 'openai' is not valid according to the validation procedure. The tracking id is '72f18fff-ca05-4848-8786-e08a33fad548'. See inner errors for details.
DeploymentModelNotSupported: The model 'Format: OpenAI, Name: gpt-35-turbo, Version: 1' of account deployment is not supported.

Expected/desired behavior

The demo deploys correctly without error.

OS and Version?

Windows 11

Versions

Latest

Mention any other details that might be useful

To fix, change https://github.com/Azure-Samples/azure-search-openai-demo/blob/main/infra/main.bicep#L109 to 0301.


Thanks! We'll be in touch soon.

Deployment Error: formrecognizer

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

New installation in GitHub Codespaces
azd up

Any log messages given by the failure

image

Expected/desired behavior

Successful deployment

OS and Version?

GitHub Codespaces

Versions

Version as of April 3, 2023

Mention any other details that might be useful


Thanks! We'll be in touch soon.

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: app/frontend/node_modules/vite/bin/vite.js

Please provide us with the following information:

This issue is for a: (mark with an x)

- [V] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

azd up

Any log messages given by the failure

[email protected] build /azure-search-openai-demo/app/frontend
tsc && vite build

internal/modules/cjs/loader.js:1174
throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath);
^

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /azure-search-openai-demo/app/frontend/node_modules/vite/bin/vite.js
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1174:13)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47 {
code: 'ERR_REQUIRE_ESM'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: tsc && vite build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /.npm/_logs/2023-03-20T04_37_36_756Z-debug.log

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

macOS (13.2.1) with Powershell 7.3.3 or zsh

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

deployment with error "MissingApiVersionParameter"

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

when I init my environment and set the related environment variables as requested, and run azd up, got the error:

"error": {
"code": "AuthorizationFailed",
"message": "The client '[email protected]' with object id 'f47a3dc3-8b3e-4578-8e38-14135e261148' does not have authorization to perform action 'Microsoft.Resources/deployments/write' over scope '/subscriptions/ddc66e55-305a-4e39-95b5-898b4da795d3/providers/Microsoft.Resources/deployments/apac-demo' or the scope is invalid. If access was recently granted, please refresh your credentials."

when I open the url it showd, and found the folling information:
{"error":{"code":"MissingApiVersionParameter","message":"The api-version query parameter (?api-version=) is required for all requests."}}

Any log messages given by the failure

{"error":{"code":"MissingApiVersionParameter","message":"The api-version query parameter (?api-version=) is required for all requests."}}

any account privilege requested? I'm the owner of resource group, if it's not enough, what permission I need set?

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
windows 10

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

Deployment failed using existing OpenAI resource (also see #61)

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Follow the document and use existing OpenAI resource instead of creating new:

SUCCESS: New project initialized!
You can view the template code in your directory: C:\src\uscg
Learn more about running 3rd party code on our DevHub: https://learn.microsoft.com/azure/developer/azure-developer-cli/azd-templates#guidelines-for-using-azd-templates
PS C:\src\uscg> azd env set AZURE_OPENAI_SERVICE demo-openai
PS C:\src\uscg> azd env set AZURE_OPENAI_RESOURCE_GROUP demo
PS C:\src\uscg> azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT gpt-35-turbo
PS C:\src\uscg> azd env set AZURE_OPENAI_GPT_DEPLOYMENT text-davinci-003
PS C:\src\uscg> azd up

Per existing bug report, I also added the following to /infra/main.parameters.json

"openAiResourceGroupLocation": {
  "value": "eastus"
}

Any log messages given by the failure

Initializing a new project (azd init)

Provisioning Azure resources (azd provision)
Provisioning Azure resources can take some time

You can view detailed progress in the Azure Portal:
https://portal.azure.com/#blade/HubsExtension/DeploymentDetailsBlade/overview/id/%2Fsubscriptions%2Fd47760dc-cfac-4bc4-992a-d28135b3df3a%2Fproviders%2FMicrosoft.Resources%2Fdeployments%2Fuscg

(โœ“) Done: Resource group: rg-uscg
(โœ“) Done: Storage account: st6yvb6xqgquhis
(โœ“) Done: App Service plan: plan-6yvb6xqgquhis

ERROR: deployment failed: error deploying infrastructure: failed deploying: deploying to subscription:

Deployment Error Details:
DuplicatedDeploymentForSameModel: The deployment 'davinci' has the same model with an existing deployment 'text-davinci-003'. Only 1 deployment is allowed for the same model.

| | Creating/Updating resources

Expected/desired behavior

Use the existing resource I defined in the env and continue deploying.

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

TypeError errors with Python 3.8

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

After install I ran start.ps1 and the web service is not runining.

Any log messages given by the failure

PS C:\Users\niceysj\app> .\start.ps1

Loading azd .env file from current environment

Creating python virtual environment "backend/backend_env"

Restoring backend python packages

Requirement already satisfied: azure-identity==1.13.0b3 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from -r requirements.txt (line 1)) (1.13.0b3)
Requirement already satisfied: Flask==2.2.2 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from -r requirements.txt (line 2)) (2.2.2)
Requirement already satisfied: langchain==0.0.78 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from -r requirements.txt (line 3)) (0.0.78)
Requirement already satisfied: openai==0.26.4 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from -r requirements.txt (line 4)) (0.26.4)
Requirement already satisfied: azure-search-documents==11.4.0b3 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from -r requirements.txt (line 5)) (11.4.0b3)
Requirement already satisfied: azure-storage-blob==12.14.1 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from -r requirements.txt (line 6)) (12.14.1)
Requirement already satisfied: six>=1.12.0 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from azure-identity==1.13.0b3->-r requirements.txt (line 1)) (1.16.0)
Requirement already satisfied: azure-core<2.0.0,>=1.11.0 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from azure-identity==1.13.0b3->-r requirements.txt (line 1)) (1.26.3)
Requirement already satisfied: msal<2.0.0,>=1.20.0 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from azure-identity==1.13.0b3->-r requirements.txt (line 1)) (1.21.0)
Requirement already satisfied: cryptography>=2.5 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from azure-identity==1.13.0b3->-r requirements.txt (line 1)) (40.0.1)
Requirement already satisfied: msal-extensions<2.0.0,>=0.3.0 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from azure-identity==1.13.0b3->-r requirements.txt (line 1)) (1.0.0)
Requirement already satisfied: importlib-metadata>=3.6.0; python_version < "3.10" in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from Flask==2.2.2->-r requirements.txt (line 2)) (6.1.0)
Requirement already satisfied: Werkzeug>=2.2.2 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from Flask==2.2.2->-r requirements.txt (line 2)) (2.2.3)
Requirement already satisfied: click>=8.0 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from Flask==2.2.2->-r requirements.txt (line 2)) (8.1.3)
Requirement already satisfied: itsdangerous>=2.0 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from Flask==2.2.2->-r requirements.txt (line 2)) (2.1.2)
Requirement already satisfied: Jinja2>=3.0 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from Flask==2.2.2->-r requirements.txt (line 2)) (3.1.2)
Requirement already satisfied: PyYAML<7,>=6 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from langchain==0.0.78->-r requirements.txt (line 3)) (6.0)
Requirement already satisfied: pydantic<2,>=1 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from langchain==0.0.78->-r requirements.txt (line 3)) (1.10.7)
Requirement already satisfied: requests<3,>=2 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from langchain==0.0.78->-r requirements.txt (line 3)) (2.28.2)
Requirement already satisfied: numpy<2,>=1 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from langchain==0.0.78->-r requirements.txt (line 3)) (1.24.2)
Requirement already satisfied: SQLAlchemy<2,>=1 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from langchain==0.0.78->-r requirements.txt (line 3)) (1.4.47)
Requirement already satisfied: dataclasses-json<0.6.0,>=0.5.7 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from langchain==0.0.78->-r requirements.txt (line 3)) (0.5.7)
Requirement already satisfied: tenacity<9.0.0,>=8.1.0 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from langchain==0.0.78->-r requirements.txt (line 3)) (8.2.2)
Requirement already satisfied: tqdm in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from openai==0.26.4->-r requirements.txt (line 4)) (4.65.0)
Requirement already satisfied: aiohttp in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from openai==0.26.4->-r requirements.txt (line 4)) (3.8.4)
Requirement already satisfied: isodate>=0.6.0 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from azure-search-documents==11.4.0b3->-r requirements.txt (line 5)) (0.6.1)
Requirement already satisfied: azure-common~=1.1 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from azure-search-documents==11.4.0b3->-r requirements.txt (line 5)) (1.1.28)
Requirement already satisfied: msrest>=0.7.1 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from azure-storage-blob==12.14.1->-r requirements.txt (line 6)) (0.7.1)
Requirement already satisfied: typing-extensions>=4.0.1 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from azure-core<2.0.0,>=1.11.0->azure-identity==1.13.0b3->-r requirements.txt (line 1)) (4.5.0)
Requirement already satisfied: PyJWT[crypto]<3,>=1.0.0 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from msal<2.0.0,>=1.20.0->azure-identity==1.13.0b3->-r requirements.txt (line 1)) (2.6.0)
Requirement already satisfied: cffi>=1.12 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from cryptography>=2.5->azure-identity==1.13.0b3->-r requirements.txt (line 1)) (1.15.1)
Requirement already satisfied: portalocker<3,>=1.6; python_version >= "3.5" and platform_system == "Windows" in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from msal-extensions<2.0.0,>=0.3.0->azure-identity==1.13.0b3->-r requirements.txt (line 1)) (2.7.0)
Requirement already satisfied: zipp>=0.5 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from importlib-metadata>=3.6.0; python_version < "3.10"->Flask==2.2.2->-r requirements.txt (line 2)) (3.15.0)
Requirement already satisfied: MarkupSafe>=2.1.1 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from Werkzeug>=2.2.2->Flask==2.2.2->-r requirements.txt (line 2)) (2.1.2)
Requirement already satisfied: colorama; platform_system == "Windows" in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from click>=8.0->Flask==2.2.2->-r requirements.txt (line 2)) (0.4.6)
Requirement already satisfied: idna<4,>=2.5 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from requests<3,>=2->langchain==0.0.78->-r requirements.txt (line 3)) (3.4)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from requests<3,>=2->langchain==0.0.78->-r requirements.txt (line 3)) (2022.12.7)
Requirement already satisfied: charset-normalizer<4,>=2 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from requests<3,>=2->langchain==0.0.78->-r requirements.txt (line 3)) (3.1.0)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from requests<3,>=2->langchain==0.0.78->-r requirements.txt (line 3)) (1.26.15)
Requirement already satisfied: greenlet!=0.4.17; python_version >= "3" and (platform_machine == "aarch64" or (platform_machine == "ppc64le" or (platform_machine == "x86_64" or (platform_machine == "amd64" or (platform_machine == "AMD64" or (platform_machine == "win32" or platform_machine == "WIN32")))))) in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from SQLAlchemy<2,>=1->langchain==0.0.78->-r requirements.txt (line 3)) (2.0.2)
Requirement already satisfied: marshmallow-enum<2.0.0,>=1.5.1 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from dataclasses-json<0.6.0,>=0.5.7->langchain==0.0.78->-r requirements.txt (line 3)) (1.5.1)
Requirement already satisfied: marshmallow<4.0.0,>=3.3.0 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from dataclasses-json<0.6.0,>=0.5.7->langchain==0.0.78->-r requirements.txt (line 3)) (3.19.0)
Requirement already satisfied: typing-inspect>=0.4.0 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from dataclasses-json<0.6.0,>=0.5.7->langchain==0.0.78->-r requirements.txt (line 3)) (0.8.0)
Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from aiohttp->openai==0.26.4->-r requirements.txt (line 4)) (4.0.2)
Requirement already satisfied: yarl<2.0,>=1.0 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from aiohttp->openai==0.26.4->-r requirements.txt (line 4)) (1.8.2)
Requirement already satisfied: frozenlist>=1.1.1 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from aiohttp->openai==0.26.4->-r requirements.txt (line 4)) (1.3.3)
Requirement already satisfied: multidict<7.0,>=4.5 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from aiohttp->openai==0.26.4->-r requirements.txt (line 4)) (6.0.4)
Requirement already satisfied: aiosignal>=1.1.2 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from aiohttp->openai==0.26.4->-r requirements.txt (line 4)) (1.3.1)
Requirement already satisfied: attrs>=17.3.0 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from aiohttp->openai==0.26.4->-r requirements.txt (line 4)) (22.2.0)
Requirement already satisfied: requests-oauthlib>=0.5.0 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from msrest>=0.7.1->azure-storage-blob==12.14.1->-r requirements.txt (line 6)) (1.3.1)
Requirement already satisfied: pycparser in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from cffi>=1.12->cryptography>=2.5->azure-identity==1.13.0b3->-r requirements.txt (line 1)) (2.21)
Requirement already satisfied: pywin32>=226; platform_system == "Windows" in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from portalocker<3,>=1.6; python_version >= "3.5" and platform_system == "Windows"->msal-extensions<2.0.0,>=0.3.0->azure-identity==1.13.0b3->-r requirements.txt (line 1)) (306)
Requirement already satisfied: packaging>=17.0 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from marshmallow<4.0.0,>=3.3.0->dataclasses-json<0.6.0,>=0.5.7->langchain==0.0.78->-r requirements.txt (line 3)) (23.0)
Requirement already satisfied: mypy-extensions>=0.3.0 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from typing-inspect>=0.4.0->dataclasses-json<0.6.0,>=0.5.7->langchain==0.0.78->-r requirements.txt (line 3)) (1.0.0)
Requirement already satisfied: oauthlib>=3.0.0 in c:\users\niceysj\app\backend\backend_env\lib\site-packages (from requests-oauthlib>=0.5.0->msrest>=0.7.1->azure-storage-blob==12.14.1->-r requirements.txt (line 6)) (3.2.2)
WARNING: You are using pip version 20.1.1; however, version 23.0.1 is available.
You should consider upgrading via the 'C:\Users\niceysj\app\backend\backend_env\scripts\python.exe -m pip install --upgrade pip' command.

Restoring frontend npm packages

up to date, audited 122 packages in 833ms

10 packages are looking for funding
run npm fund for details

found 0 vulnerabilities

Building frontend

[email protected] build
tsc && vite build

vite v4.1.1 building for production...
โœ“ 1250 modules transformed.
../backend/static/index.html 0.49 kB
../backend/static/assets/github-fab00c2d.svg 0.96 kB
../backend/static/assets/index-6b2c2cfa.css 7.46 kB โ”‚ gzip: 2.20 kB
../backend/static/assets/index-3d122da9.js 625.76 kB โ”‚ gzip: 204.86 kB โ”‚ map: 5,057.29 kB

(!) Some chunks are larger than 500 kBs after minification. Consider:

Starting backend

Traceback (most recent call last):
File "./app.py", line 12, in
from approaches.chatreadretrieveread import ChatReadRetrieveReadApproach
File "C:\Users\niceysj\app\backend\approaches\chatreadretrieveread.py", line 10, in
class ChatReadRetrieveReadApproach(Approach):
File "C:\Users\niceysj\app\backend\approaches\chatreadretrieveread.py", line 51, in ChatReadRetrieveReadApproach
def run(self, history: list[dict], overrides: dict) -> any:
TypeError: 'type' object is not subscriptable

Expected/desired behavior

OS and Version?

Windows Server 2022

Versions

Powershell 7

Mention any other details that might be useful

Error


Thanks! We'll be in touch soon.

start service failed

When I tried to run start.cmd to start up the service, I got below issue:
vite v4.1.1 building for production...
โœ“ 1250 modules transformed.
../backend/static/index.html 0.49 kB
../backend/static/assets/github-fab00c2d.svg 0.96 kB
../backend/static/assets/index-184dcdbd.css 7.33 kB โ”‚ gzip: 2.17 kB
../backend/static/assets/index-41d57639.js 625.76 kB โ”‚ gzip: 204.86 kB โ”‚ map: 5,057.29 kB

(!) Some chunks are larger than 500 kBs after minification. Consider:

Starting backend

Failed to start backend

Key for storage account using --storagekey

This issue is for a: (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Edit predocs.ps1 add an --storagekey but the function upload_blobs will fail with: "Unsopported key"
It is mandatory to use that type of key, because the normal user needs 2FA. The standard code will not work.
You need to add the --storagekey but it does not work.

I edited upload_blobs
blob_service = BlobServiceClient(account_url=f"https://{args.storageaccount}.blob.core.windows.net", credential="mykey")

and it works.
Can you try using --storagekey and see if it works?
Cheers!

[DevContainer] A hash conflict was encountered for the role Assignment ID. Please use a new Guid.

Please provide us with the following information:

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

For internal subscription, how do we avoid this? Can use exising resources to resolve?
https://github.com/jimmyliao/azure-search-openai-demo#use-existing-resources

{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"HashConflictOnDifferentRoleAssignmentIds","message":"A hash conflict was encountered for the role Assignment ID. Please use a new Guid."}]}

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Any log messages given by the failure

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
Windows 11, Dev Container

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

Authorization failed

Requirement already satisfied: charset-normalizer<4,>=2 in ./scripts/.venv/lib/python3.9/site-packages (from requests>=2.18.4->azure-core<2.0.0,>=1.23.0->azure-ai-formrecognizer==3.2.1->-r ./scripts/requirements.txt (line 4)) (3.1.0)
Requirement already satisfied: idna<4,>=2.5 in ./scripts/.venv/lib/python3.9/site-packages (from requests>=2.18.4->azure-core<2.0.0,>=1.23.0->azure-ai-formrecognizer==3.2.1->-r ./scripts/requirements.txt (line 4)) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./scripts/.venv/lib/python3.9/site-packages (from requests>=2.18.4->azure-core<2.0.0,>=1.23.0->azure-ai-formrecognizer==3.2.1->-r ./scripts/requirements.txt (line 4)) (1.26.15)
Requirement already satisfied: oauthlib>=3.0.0 in ./scripts/.venv/lib/python3.9/site-packages (from requests-oauthlib>=0.5.0->msrest>=0.6.21->azure-ai-formrecognizer==3.2.1->-r ./scripts/requirements.txt (line 4)) (3.2.2)
Running "prepdocs.py"
Ensuring search index gptkbindex exists
Traceback (most recent call last):
File "/workspaces/azure-search-openai-demo/./scripts/prepdocs.py", line 299, in
create_search_index()
File "/workspaces/azure-search-openai-demo/./scripts/prepdocs.py", line 237, in create_search_index
if args.index not in index_client.list_index_names():
File "/workspaces/azure-search-openai-demo/scripts/.venv/lib/python3.9/site-packages/azure/core/paging.py", line 132, in next
return next(self._page_iterator)
File "/workspaces/azure-search-openai-demo/scripts/.venv/lib/python3.9/site-packages/azure/core/paging.py", line 76, in next
self._response = self._get_next(self.continuation_token)
File "/workspaces/azure-search-openai-demo/scripts/.venv/lib/python3.9/site-packages/azure/search/documents/indexes/_generated/operations/_indexes_operations.py", line 520, in get_next
raise HttpResponseError(response=response, model=error)
azure.core.exceptions.HttpResponseError: () Authorization failed.
Code:
Message: Authorization failed.
PS /workspaces/azure-search-openai-demo>

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Any log messages given by the failure

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

Getting Error: Can't instantiate abstract class HtmlCallbackHandler with abstract methods on_agent_action, on_llm_new_token

Please provide us with the following information:

This issue is for a: (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

While using ReadRetrieveReadApproach (rrr) readretrieveread.py or ReadDecomposeAsk (rda) readdecomposeask.py I am getting error as mentioned below at line cb_handler = HtmlCallbackHandler()

Minimal steps to reproduce

# app/backend
from langchainadapters import HtmlCallbackHandler
from langchain.callbacks.base import CallbackManager

cb_handler = HtmlCallbackHandler()
cb_manager = CallbackManager(handlers=[cb_handler])

langchainadapters.py

Any log messages given by the failure

TypeError: Can't instantiate abstract class HtmlCallbackHandler with abstract methods on_agent_action, on_llm_new_token

OS and Version?

Python 3.8 - AzureML

Support different locations for existing resources

          @briansmi - Do you think it is common for folks to have existing openai, search, or storage that aren't in the same locations?  Right now, the template is easy if all are in the same location, but more difficult if they are in different locations.  There would be more work required to support resources in different locations than the location the application is deployed to.

Is that common enough scenario that we want to make it very easy to support that?

Originally posted by @jongio in #25 (comment)

Same demo with c# backend

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Any log messages given by the failure

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

First of all, thanks for the GREAT demo. We had very little trouble getting it up and running. Is there any chance there could be a similar demo in c# for the backend? Or get some assitance on how we can create this ourselves? Sorry if this is not the place to post the question. Please advice me in case there is another forum.

Thanks in advance.

Error Running App Locally

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

When starting the app locally via the start.cmd in the app folder, the website does start up but its just a blank white page with. The error message is in the console window.

Any log messages given by the failure

Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.

Followed By

SyntaxError: Unexpected end of JSON input
at JSON.parse ()
at window.onload (app.js:59:731)

image

Expected/desired behavior

The start.cmd should fire the website up without issue.

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Versions

Windows 10

Mention any other details that might be useful

Using VS Code


Thanks! We'll be in touch soon.

Postprovision hook fails if repository is cloned to a path containing spaces

This issue is for a: (mark with an x)

- [x] bug report 
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

  • Clone the repository to a path with spaces (example - C:\Ex Path\azure-openai-search) with azd init -t azure-search-openai-demo
  • Run azd up. Observe that the post-provision script fails

Any log messages given by the failure

  • prepdocs.py: error: unrecognized arguments: Path\azure-openai-search/data/*

Expected/desired behavior

  • Sample works when cloned to a path with spaces

OS and Version?

Windows 11

Additional comments

This is caused due to the $cwd variable not being quoted in the powershell launch script

webpage is not responsive for different screen types

Web Page is not compatible with different screen types, guess we should use react-responsive to make it compatible on different screen sizes

This issue is for a: (mark with an x)

- [ X] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Any log messages given by the failure

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

Unable to complete deployment due to a previous deleted version of formrecognizer in the softdelete state

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Unable to complete deployment due to a previous deleted version of formrecognizer in the softdelete state

Any log messages given by the failure

ERROR: deployment failed: error deploying infrastructure: failed deploying: deploying to subscription:

Deployment Error Details:
InvalidTemplateDeployment: The template deployment 'formrecognizer' is not valid according to the validation procedure. The tracking id is 'xxxxxxxxxxxxxxxxxx'. See inner errors for details.
FlagMustBeSetForRestore: An existing resource with ID '/subscriptions/xxxxxxxxxxxxxxxxxxxxxxxxxxxxx/resourceGroups/rg-MIPGPT/providers/Microsoft.CognitiveServices/accounts/cog-fr-yf62qdrpvjeuo' has been soft-deleted. To restore the resource, you must specify 'restore' to be 'true' in the property. If you don't want to restore existing resource, please purge it first.

Expected/desired behavior

Mention any other details that might be useful


Thanks! We'll be in touch soon.

azd deployment fails over Cognitive Service domain creation

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

deploy via "azd up -t azure-search-openai-demo"

Any log messages given by the failure

{
    "status": "Failed",
    "error": {
        "code": "CustomDomainInUse",
        "message": "Sub domain name 'cog-xejrw6segqcvq' is already in use. This condition is caused by sub domain name being taken at the same time."
    }
}

Expected/desired behavior

sub domain should be created successfully

OS and Version?

macOS Ventura

Versions

current

Mention any other details that might be useful

I tried re-deploying several times. every time the auto-generated domain name is claimed to be already existing although it is different each time.

Azure Cognitive Search - Index not deployed. Why?

Hi, I followed the installation guide and run "azd up" and deployed the resources on Azure. However, I got below error. It seems the Indexer was not deployed. I verified from my Azure Portal and couldn't find the indexer.

Could you help?

Thanks!
Tim

error2

Issue Installing with Existing Model

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Use an existing OpenAI GPT deployment model that do uses a different name (other than davinci)
Run azd env set AZURE_OPENAI_GPT_DEPLOYMENT {Name of existing GPT deployment}

Any log messages given by the failure

ERROR: deployment failed: error deploying infrastructure: failed deploying: deploying to subscription:

Deployment Error Details:
DuplicatedDeploymentForSameModel: The deployment 'davinci' has the same model with an existing deployment 'text-davinci-003'. > Only 1 deployment is allowed for the same model.

Expected/desired behavior

Successful deployment using an existing Azure OpenAI deployment model

OS and Version?

GitHub Codespaces

Versions

Version as of April 3, 2023.

Mention any other details that might be useful

Workaround is to change the code and replaced everything 'davinci' to my deployment name.


Thanks! We'll be in touch soon.

Resource not found

Please provide us with the following information:

This issue is for a: (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Run through the deployment and once azd up is run we get the errors

Any log messages given by the failure

Microsoft.CognitiveServices/accounts/cog-fr-n5ibctygita4e' under resource group 'rg-dev' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
The Resource 'Microsoft.Search/searchServices/gptkb-n5ibctygita4e' under resource group 'rg-dev' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix

Expected/desired behavior

Deployment to finish successfully

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
Windows 10 Enterprise

Versions

10 Enterprise

Mention any other details that might be useful

When i look inside the resource group both the resources do exist so a bit confused on what is the deal


Thanks! We'll be in touch soon.

Is there a way to search document language other than English?

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [x ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

I have upload some Traditional Chinese document file and follow the steps to use prepdocs to parse the document, but when I asked related question in Chinese related to the document, it cannot answer any of it.

Any log messages given by the failure

Expected/desired behavior

It can answer questions regardless of the document language.

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
Windows 11

Versions

Mention any other details that might be useful

I have tryied to build my own index and run indexer with Chinese Analyzer but it's not working. (Already set the env variable AZURE_SEARCH_INDEX to the new one). The default content analyzer in gptkbindex is English.


Thanks! We'll be in touch soon.

How to upload our own content and start query against our docs

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Any log messages given by the failure

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

PrincipalNotFound: Principal XXXXXXXXXX does not exist in the directory XXXXXXXXXX.

I cloned the repo locally and set my subscription via the Set-AzContext Powershell PowerShell command. However when I run the azd up command, I get the error below. It is also attached.

How can I resolve this error.

ERROR: deployment failed: error deploying infrastructure: failed deploying: deploying to subscription:

Deployment Error Details:
PrincipalNotFound: Principal XXXXXXXXXX does not exist in the directory XXXXXXXXXX. Check that you have the correct principal ID. If you are creating this principal and then immediately assigning a role, this error might be related to a replication delay. In this case, set the role assignment principalType property to a value, such as ServicePrincipal, User, or Group. See https://aka.ms/docs-principaltype
PrincipalNotFound: Principal XXXXXXXXXX does not exist in the directory XXXXXXXXXX. Check that you have the correct principal ID. If you are creating this principal and then immediately assigning a role, this error might be related to a replication delay. In this case, set the role assignment principalType property to a value, such as ServicePrincipal, User, or Group. See https://aka.ms/docs-principaltype
PrincipalNotFound: Principal XXXXXXXXXX does not exist in the directory XXXXXXXXXX. Check that you have the correct principal ID. If you are creating this principal and then immediately assigning a role, this error might be related to a replication delay. In this case, set the role assignment principalType property to a value, such as ServicePrincipal, User, or Group. See https://aka.ms/docs-principaltype
PrincipalNotFound: Principal XXXXXXXXXX does not exist in the directory XXXXXXXXXX. Check that you have the correct principal ID. If you are creating this principal and then immediately assigning a role, this error might be related to a replication delay. In this case, set the role assignment principalType property to a value, such as ServicePrincipal, User, or Group. See https://aka.ms/docs-principaltype
PrincipalNotFound: Principal XXXXXXXXXX does not exist in the directory XXXXXXXXXX. Check that you have the correct principal ID. If you are creating this principal and then immediately assigning a role, this error might be related to a replication delay. In this case, set the role assignment principalType property to a value, such as ServicePrincipal, User, or Group. See https://aka.ms/docs-principaltype

OpenAI Install Error

Unable to request for OpenAI azure services to setup this project

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [x] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Setting up this service but unable to request for the OpenAI services. I have other azure setup was successful.
Screenshot 2023-03-11 115816

Screenshot 2023-03-11 115759

Any log messages given by the failure

{
"status": "Failed",
"error": {
"code": "InvalidTemplateDeployment",
"message": "The template deployment 'openai' is not valid according to the validation procedure. The tracking id is 'tracking-id'. See inner errors for details.",
"details": [
{
"code": "SpecialFeatureOrQuotaIdRequired",
"message": "The subscription does not have QuotaId/Feature required by SKU 'S0' from kind 'OpenAI' ."
}
]
}
}

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
Windows 11

Note : I am setting up for POC project on my personal azure account.

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

Force chatgpt to only retrieve answer on the enterprise data

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ x] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Any log messages given by the failure

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Versions

Mention any other details that might be useful

Hi, I am currently working on a use case with regards to some Enterprise data. Can it be made possible to tweak the pipeline so that it only retrieves answer from the data which I provide? What I have seen so far is that the model is giving answer on with respect to the context of the data which I have provided (Eg. Contract docs) as well as anything from the outside world (For eg. What is the height of the Eiffel Tower?). Can we do something to stop this behaviour and restrict any queries from the outside world? Thank you !


Thanks! We'll be in touch soon.

upload file exception in prepdocs

This issue is for a: (mark with an x)

- [ x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

image

OS and Version?

Windows 11
python verson 3.11

I changed file to my own document,and when i excute the prepdocs.ps1,the exception was thrown in the picture.
Could you please help check how it heppened? Thanks a lot .

Support for GPT-4 and 0613

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [X] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

In this blog post, says that this repo will use GPT-4 models:
https://techcommunity.microsoft.com/t5/ai-cognitive-services-blog/working-with-gpt-4-and-chatgpt-models-on-azure-preview/ba-p/3773595

Any log messages given by the failure

I cannot find anywhere that this REPO is deploying GPT-4 models for Azure OpenAI.

Expected/desired behavior

Detail in the documentation or update a parameter to switch to use GPT-4

Deployment error QuotaID/Feature

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Created new folder
Powershell:
Initialized project
Ran azd up

Any log messages given by the failure

Deployment Error Details:
InvalidTemplateDeployment: The template deployment 'openai' is not valid according to the validation procedure. The tracking id is 'a2018f19-5034-4e58-a5a5-0ac5655187f0'. See inner errors for details.
SpecialFeatureOrQuotaIdRequired: The subscription does not have QuotaId/Feature required by SKU 'S0' from kind 'OpenAI' .

Checked deployment in Azure:
openai status = BadRequest
{
"status": "Failed",
"error": {
"code": "InvalidTemplateDeployment",
"message": "The template deployment 'openai' is not valid according to the validation procedure. The tracking id is '5eec9f89-50fc-442d-9400-37c7a022f82b'. See inner errors for details.",
"details": [
{
"code": "SpecialFeatureOrQuotaIdRequired",
"message": "The subscription does not have QuotaId/Feature required by SKU 'S0' from kind 'OpenAI' ."
}
]
}
}

Expected/desired behavior

Create deployment in Azure

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
Windows 10 pro

Versions

10

Mention any other details that might be useful


Thanks! We'll be in touch soon.

Make it possible to deploy for accounts without owner level access

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [x] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

azp up (as an employee, i.e. Microsoft)

Any log messages given by the failure

ERROR: deployment failed: error deploying infrastructure: failed deploying: starting deployment to subscription: PUT https://management.azure.com/subscriptions/12341234-1234-1234-1234-123412341234/providers/Microsoft.Resources/deployments/myNewOrExistingResource


RESPONSE 403: 403 Forbidden
ERROR CODE: AuthorizationFailed

{
"error": {
"code": "AuthorizationFailed",
"message": "The client '[email protected]' with object id '12341234-1234-1234-1234-123412341234' does not have authorization to perform action 'Microsoft.Resources/deployments/write' over scope '/subscriptions/12341234-1234-1234-1234-123412341234/providers/Microsoft.Resources/deployments/myNewOrExistingResource' or the scope is invalid. If access was recently granted, please refresh your credentials."
}
}

Expected/desired behavior

Ideally (if possible), there should be a path to set up preexisting resources in Azure Portal, such as an Azure OpenAI resource, deploying specific models, etc, all which require less creds than requiring a SAW machine to get write access.

(I already have all of these resources, the OpenAI service, two models, blob storage, search service). I changed the app.py to have those values. Not sure how to run/access it all.

OS and Version?

Windows 11

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

PyCryptodome is required for AES algorithm - fails at prepdocs.py

Please provide us with the following information:

This issue is for a: (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

azd up

Any log messages given by the failure

Processing './data/2022-annual-report_spreads.pdf'
Traceback (most recent call last):
File "/mnt/batch/tasks/shared/LS_root/mounts/clusters/julianlenewcompute/code/Users/julianle/openai-demo1232/./scripts/prepdocs.py", line 312, in
upload_blobs(filename)
File "/mnt/batch/tasks/shared/LS_root/mounts/clusters/julianlenewcompute/code/Users/julianle/openai-demo1232/./scripts/prepdocs.py", line 70, in upload_blobs
reader = PdfReader(filename)
File "/mnt/batch/tasks/shared/LS_root/mounts/clusters/julianlenewcompute/code/Users/julianle/openai-demo1232/scripts/.venv/lib/python3.9/site-packages/pypdf/_reader.py", line 339, in init
self._encryption.verify(pwd) == PasswordType.NOT_DECRYPTED
File "/mnt/batch/tasks/shared/LS_root/mounts/clusters/julianlenewcompute/code/Users/julianle/openai-demo1232/scripts/.venv/lib/python3.9/site-packages/pypdf/_encryption.py", line 998, in verify
key, rc = self.verify_v4(pwd) if self.algV <= 4 else self.verify_v5(pwd)
File "/mnt/batch/tasks/shared/LS_root/mounts/clusters/julianlenewcompute/code/Users/julianle/openai-demo1232/scripts/.venv/lib/python3.9/site-packages/pypdf/_encryption.py", line 1049, in verify_v5
key = AlgV5.verify_owner_password(
File "/mnt/batch/tasks/shared/LS_root/mounts/clusters/julianlenewcompute/code/Users/julianle/openai-demo1232/scripts/.venv/lib/python3.9/site-packages/pypdf/_encryption.py", line 650, in verify_owner_password
AlgV5.calculate_hash(R, password, o_value[32:40], u_value[:48])
File "/mnt/batch/tasks/shared/LS_root/mounts/clusters/julianlenewcompute/code/Users/julianle/openai-demo1232/scripts/.venv/lib/python3.9/site-packages/pypdf/_encryption.py", line 695, in calculate_hash
E = AES_CBC_encrypt(K[:16], K[16:32], K1 * 64)
File "/mnt/batch/tasks/shared/LS_root/mounts/clusters/julianlenewcompute/code/Users/julianle/openai-demo1232/scripts/.venv/lib/python3.9/site-packages/pypdf/_encryption.py", line 164, in AES_CBC_encrypt
raise DependencyError("PyCryptodome is required for AES algorithm")
pypdf.errors.DependencyError: PyCryptodome is required for AES algorithm

Expected/desired behavior

Processing './data/2022-annual-report_spreads.pdf'
Uploading blob for page 0 -> 2022-annual-report_spreads-0.pdf
Uploading blob for page 1 -> 2022-annual-report_spreads-1.pdf
Uploading blob for page 2 -> 2022-annual-report_spreads-2.pdf
Uploading blob for page 3 -> 2022-annual-report_spreads-3.pdf
Uploading blob for page 4 -> 2022-annual-report_spreads-4.pdf
Uploading blob for page 5 -> 2022-annual-report_spreads-5.pdf
Uploading blob for page 6 -> 2022-annual-report_spreads-6.pdf
Uploading blob for page 7 -> 2022-annual-report_spreads-7.pdf
Uploading blob for page 8 -> 2022-annual-report_spreads-8.pdf
Uploading blob for page 9 -> 2022-annual-report_spreads-9.pdf

OS and Version?

Linux

Versions

Mention any other details that might be useful

I've updated the requirements.txt file in scripts/requirements.txt to include
PyCryptodome==3.17

and appears to have clear itself up


Thanks! We'll be in touch soon.

ERROR: failed running post hooks

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

ERROR: failed running post hooks: 'postprovision' hook failed with exit code: '1', Path: './scripts/prepdocs.sh'. : exit status 1

Expected/desired behavior

OS and Version?

MAC OS Sierra

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

Error on doc upload in Blob Storage

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [X] regression (a behavior that used to work and stopped in a new release)

Any log messages given by the failure

In the final phase of document uploading I receive the following error logs:

Running "prepdocs.py"
Ensuring search index gptkbindex exists
Search index gptkbindex already exists
Processing files...
Processing 'C:\OpenAITEST02/data\Benefit_Options.pdf'
Uploading blob for page 0 -> Benefit_Options-0.pdf
Traceback (most recent call last):
File "C:\OpenAITEST02\scripts\prepdocs.py", line 225, in
upload_blobs(pages)
File "C:\OpenAITEST02\scripts\prepdocs.py", line 61, in upload_blobs
blob_container.upload_blob(blob_name, f, overwrite=True)
File "C:\OpenAITEST02\scripts.venv\Lib\site-packages\azure\core\tracing\decorator.py", line 78, in wrapper_use_tracer
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\OpenAITEST02\scripts.venv\Lib\site-packages\azure\storage\blob_container_client.py", line 1038, in upload_blob
blob.upload_blob(
File "C:\OpenAITEST02\scripts.venv\Lib\site-packages\azure\core\tracing\decorator.py", line 78, in wrapper_use_tracer
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\OpenAITEST02\scripts.venv\Lib\site-packages\azure\storage\blob_blob_client.py", line 742, in upload_blob
return upload_block_blob(**options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\OpenAITEST02\scripts.venv\Lib\site-packages\azure\storage\blob_upload_helpers.py", line 197, in upload_block_blob
process_storage_error(error)
File "C:\OpenAITEST02\scripts.venv\Lib\site-packages\azure\storage\blob_shared\response_handlers.py", line 185, in process_storage_error
exec("raise error from None") # pylint: disable=exec-used # nosec
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1, in
azure.core.exceptions.HttpResponseError: This request is not authorized to perform this operation using this permission.
RequestId:6812ee97-601e-00eb-12e9-5cc898000000
Time:2023-03-22T18:10:59.8745023Z
ErrorCode:AuthorizationPermissionMismatch
Content: AuthorizationPermissionMismatchThis request is not authorized to perform this operation using this permission.
RequestId:6812ee97-601e-00eb-12e9-5cc898000000
Time:2023-03-22T18:10:59.8745023Z

Expected/desired behavior

OS and Version?

Windows 11

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

Path argument "'.\data\*' in scripts /prepdocs.ps1 does not work on Mac Computers

This issue is for a: (mark with an x)

- [ x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Deploy in a Mac Computer

Any log messages given by the failure

It does not process any file

Expected/desired behavior

Should split and upload all files in data Folder

OS and Version?

MacOS Ventura 13.2.1

Mention any other details that might be useful

I replaced it with the full path, not relative and it works.


Thanks! We'll be in touch soon.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.