Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add LlamaIndex Vector Search with Azure AI #474

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

manekinekko
Copy link
Member

@manekinekko manekinekko commented Nov 28, 2024

Please fill out this template! There are three different types of contributions, feel free to delete the checklists that are not applicable to your contribution type.

If you are submitting a new azd template to the gallery

Fill this out if you want your template to be added to the awesome-azd gallery!

Your template repository

Place your template repository link here:

  • Added an entry to https://github.com/Azure/awesome-azd/blob/main/website/src/data/users.tsx that includes:

    • Template title - A short title that reflects the local application stack that someone could use to get their application on Azure (e.g. "Containerized React Web App with Java API and MongoDB")

    • Description - 1-2 sentence description of the architecture (e.g. Azure services) or solution that is defined by the template.

    • Architecture Diagram or Application Screenshot - The image should include all services and their connections (example). You should add the image to the website/src/data/images/.

    • Link to Author's GitHub or other relevant website - Used for attribution

    • Author's Name - Name to credit on the gallery card

    • Link to template source - Link to the template GitHub repo

    • Tags - Specify tags to represent the template. If you don't see a relevant tag for your template? Feel free to add one!

      Required tags:

      • Tag your template as Micrsoft-authored ("msft") or Community-authored ("community")
      • Tag the IaC provider ("bicep" or "terraform")
      • At least 1 tag for programming language used
      • At least 1 tag for Azure services integrated
      • Add the "new" tag for any newly authored templates
  • In the PR comment, if you can also add a link to the PR where you made your repo azd compatible this will allow us to provide feedback on your template and speed up the review process.

  • If the template is Microsoft-authored, we encourage you to also publish it to learn.microsoft.com/samples.

If you are submitting a resource to be added to the awesome-azd README:

  • Name of resource
  • Resource author - who created this resource? (so we can credit them!)
  • What section should this resource be included in? -Is the resource an article? A video? Something else?

@manekinekko
Copy link
Member Author

Here is the commit where I added azd config: Azure-Samples/llama-index-vector-search-javascript@82177ef

@hemarina
Copy link
Contributor

hemarina commented Dec 2, 2024

@v-xuto Could you test this template please?

@v-xuto
Copy link
Member

v-xuto commented Dec 3, 2024

@v-xuto Could you test this template please?

Testing.

@v-xuto
Copy link
Member

v-xuto commented Dec 5, 2024

@manekinekko Three issues have been fixed, but we have encountered a new issue. Please see the comments for details and fix it.

@manekinekko
Copy link
Member Author

Thank you @v-xuto I am investigating the issue. Keep you posted.

@manekinekko
Copy link
Member Author

Hi @v-xuto I am unable to reproduce that error. I followed the steps from the readme and I get the app to work as expected. See all logs below.

az provision logs azd provision

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

? Select an Azure Subscription to use: 116. ca-javascript-team-2502 (faf8dd08-6434-4aa9-bf01-aed24aa52984)
? Select an Azure location to use: 16. (US) East US 2 (eastus2)
? Enter a value for the 'openAiServiceLocation' infrastructure parameter: 1. (Europe) Sweden Central (swedencentral)
Subscription: ca-javascript-team-2502 (faf8dd08-6434-4aa9-bf01-aed24aa52984)
Location: East US 2

You can view detailed progress in the Azure Portal:
https://portal.azure.com/#view/HubsExtension/DeploymentDetailsBlade/~/overview/id/%2Fsubscriptions%2Ffaf8dd08-6434-4aa9-bf01-aed24aa52984%2Fproviders%2FMicrosoft.Resources%2Fdeployments%2Flllllits-1733395431

(✓) Done: Resource group: rg-lllllits (4.551s)
(✓) Done: Log Analytics workspace: log-6ap772uutawuk (19.018s)
(✓) Done: Storage account: st6ap772uutawuk (25.209s)
(✓) Done: Azure OpenAI: cog-6ap772uutawuk (28.449s)
(✓) Done: Azure AI Services Model Deployment: cog-6ap772uutawuk/gpt-4o-mini (1.085s)
(✓) Done: Azure AI Services Model Deployment: cog-6ap772uutawuk/text-embedding-ada-002 (2.443s)
(✓) Done: Container Registry: lllllitsacr6ap772uutawuk (25.519s)
(✓) Done: Container Apps Environment: lllllits-aca-env (1m38.544s)
(✓) Done: Search service: gptkb-6ap772uutawuk (4m54.521s)
(✓) Done: Container App: capps-backend-6ap772uutawuk (23.885s)
Loading azd .env file from the current environment
Cleaning up cache directories
Cache directory cleaned: .cache
Running "pnpm generate"

[email protected] generate /Users/wassimchegham/oss/@Azure-Samples/llama-index-vector-search-javascript
cross-env AZURE_CLIENT_ID= tsx app/api/chat/engine/generate.ts

Using default Azure credential chain for authentication
{
openAiConfig: {
azure: {
azureADTokenProvider: [AsyncFunction: getRefreshedToken],
deployment: 'gpt-4o-mini'
}
}
}
Initializing Azure AI Search Vector Store
Generating storage context...
No valid data found at path: .cache/doc_store.json starting new store.
No valid data found at path: .cache/index_store.json starting new store.
Using node parser on documents...
Finished parsing documents.
getting embedding progress: 9 / 38
getting embedding progress: 19 / 38
getting embedding progress: 29 / 38
getting embedding progress: 37 / 38
Index llamaindex-vector-search does not exist in Azure AI Search, creating index
Configuring llamaindex-vector-search fields for Azure AI Search
Configuring llamaindex-vector-search metadata fields
Configuring llamaindex-vector-search vector search
Configuring llamaindex-vector-search vector search with undefined compression
Configuring llamaindex-vector-search semantic search
Creating llamaindex-vector-search search index with configuration:
{
index: {
name: 'llamaindex-vector-search',
fields: [ [Object], [Object], [Object], [Object], [Object] ],
vectorSearch: { algorithms: [Array], compressions: [], profiles: [Array] },
semanticSearch: { configurations: [Array] }
}
}
Processing embedding: a30c3f3b-6b14-49d8-96d0-dbef1718c575
Mapping indexed document: a30c3f3b-6b14-49d8-96d0-dbef1718c575
Processing embedding: d155340f-0b6e-43ac-ab68-399193364be5
Mapping indexed document: d155340f-0b6e-43ac-ab68-399193364be5
Processing embedding: 1c60de97-70ce-4de5-8c1b-6d3a8bb9c050
Mapping indexed document: 1c60de97-70ce-4de5-8c1b-6d3a8bb9c050
Processing embedding: 0b3982fc-ccf6-4542-9233-651de9f7a528
Mapping indexed document: 0b3982fc-ccf6-4542-9233-651de9f7a528
Processing embedding: e58f8d23-7a27-4d25-8885-f576dfcbfb2c
Mapping indexed document: e58f8d23-7a27-4d25-8885-f576dfcbfb2c
Processing embedding: d29df691-a3ac-4647-a405-090c03137e30
Mapping indexed document: d29df691-a3ac-4647-a405-090c03137e30
Processing embedding: 8280ff24-7fe9-46d4-bf27-f7aeaca4420f
Mapping indexed document: 8280ff24-7fe9-46d4-bf27-f7aeaca4420f
Processing embedding: e7d88cda-7a48-4fad-9fc6-fb5b0085e6d8
Mapping indexed document: e7d88cda-7a48-4fad-9fc6-fb5b0085e6d8
Processing embedding: b74de197-f462-4103-98a8-b8cf3dc57b14
Mapping indexed document: b74de197-f462-4103-98a8-b8cf3dc57b14
Processing embedding: d6c2a5a8-e796-4be7-bbd9-28252e670b04
Mapping indexed document: d6c2a5a8-e796-4be7-bbd9-28252e670b04
Processing embedding: 11bb1c4f-585f-498f-b6af-f4bdc364708b
Mapping indexed document: 11bb1c4f-585f-498f-b6af-f4bdc364708b
Processing embedding: 1dac8b3d-15dd-4c32-9e14-3582c22338b4
Mapping indexed document: 1dac8b3d-15dd-4c32-9e14-3582c22338b4
Processing embedding: 01c517b5-4c67-4df9-8f6e-05168e7252f1
Mapping indexed document: 01c517b5-4c67-4df9-8f6e-05168e7252f1
Processing embedding: 8d83654c-076a-41d3-9896-f535b38fa235
Mapping indexed document: 8d83654c-076a-41d3-9896-f535b38fa235
Processing embedding: c0b3abeb-d01b-4534-888b-b1f4f974b86c
Mapping indexed document: c0b3abeb-d01b-4534-888b-b1f4f974b86c
Processing embedding: 79df998f-fbb8-4357-a40e-85169cb18517
Mapping indexed document: 79df998f-fbb8-4357-a40e-85169cb18517
Processing embedding: c3b671e6-32cb-4340-826e-a1f7529360ac
Mapping indexed document: c3b671e6-32cb-4340-826e-a1f7529360ac
Processing embedding: 13300b82-7e27-4e45-8cee-f0a1c2c41b24
Mapping indexed document: 13300b82-7e27-4e45-8cee-f0a1c2c41b24
Processing embedding: 14d58feb-1e19-4c85-ae2d-520b064aba05
Mapping indexed document: 14d58feb-1e19-4c85-ae2d-520b064aba05
Processing embedding: 12eb040f-f5ec-412a-b9b6-d40ea0190a7b
Mapping indexed document: 12eb040f-f5ec-412a-b9b6-d40ea0190a7b
Processing embedding: 037b4450-6352-430c-adb2-32e60584fcf3
Mapping indexed document: 037b4450-6352-430c-adb2-32e60584fcf3
Processing embedding: c4e4da6a-68e4-4acf-a41f-b74d258bc187
Mapping indexed document: c4e4da6a-68e4-4acf-a41f-b74d258bc187
Processing embedding: e33dec07-e110-4130-9da2-a08cf32d7d4f
Mapping indexed document: e33dec07-e110-4130-9da2-a08cf32d7d4f
Processing embedding: c881eee3-1125-4f03-9246-8f591a9adf45
Mapping indexed document: c881eee3-1125-4f03-9246-8f591a9adf45
Processing embedding: 7fd3514c-5b2a-44d9-96f6-c36e28a97a3b
Mapping indexed document: 7fd3514c-5b2a-44d9-96f6-c36e28a97a3b
Processing embedding: 57c6c576-6f55-42a0-9fc1-71e7e4d70683
Mapping indexed document: 57c6c576-6f55-42a0-9fc1-71e7e4d70683
Processing embedding: fb83bde4-6087-4c1d-ae0e-e5459569e0d2
Mapping indexed document: fb83bde4-6087-4c1d-ae0e-e5459569e0d2
Processing embedding: 0d35bfdf-0101-4517-8f2d-5376370b2d80
Mapping indexed document: 0d35bfdf-0101-4517-8f2d-5376370b2d80
Processing embedding: 070a0c25-e35d-4715-8884-9020dee99da9
Mapping indexed document: 070a0c25-e35d-4715-8884-9020dee99da9
Processing embedding: 56398d0d-93a4-4061-9c90-85c1bf0c7b69
Mapping indexed document: 56398d0d-93a4-4061-9c90-85c1bf0c7b69
Processing embedding: 499e2b24-c5e9-4bc9-93f2-bf484a9c4016
Mapping indexed document: 499e2b24-c5e9-4bc9-93f2-bf484a9c4016
Processing embedding: 8e0e7aa1-c870-4cc1-865f-a5bcefa2b459
Mapping indexed document: 8e0e7aa1-c870-4cc1-865f-a5bcefa2b459
Processing embedding: 472c0d20-d8ad-4f93-8e6f-398e6f8e0599
Mapping indexed document: 472c0d20-d8ad-4f93-8e6f-398e6f8e0599
Processing embedding: 18062bd5-a59c-48ba-b2d1-bd149d17e5ce
Mapping indexed document: 18062bd5-a59c-48ba-b2d1-bd149d17e5ce
Processing embedding: fe0dfd9c-8996-43d8-9565-b98bb537b802
Mapping indexed document: fe0dfd9c-8996-43d8-9565-b98bb537b802
Processing embedding: db77efe0-5303-4729-b9f5-cb11691daf72
Mapping indexed document: db77efe0-5303-4729-b9f5-cb11691daf72
Processing embedding: c0156ad4-2ad0-4741-932f-a133b7b36a9c
Mapping indexed document: c0156ad4-2ad0-4741-932f-a133b7b36a9c
Processing embedding: b0fb09f8-62f1-42a8-bfcf-257f46f0b7b7
Mapping indexed document: b0fb09f8-62f1-42a8-bfcf-257f46f0b7b7
Uploading remaining batch of size 38, current progress 38 of 38, accumulated size 0.91 MB
Storage context successfully generated in 21.213s.
Finished generating storage.
Script completed successfully

SUCCESS: Your application was provisioned in Azure in 6 minutes 27 seconds.
You can view the resources created under the resource group rg-lllllits in Azure Portal:
https://portal.azure.com/#@/resource/subscriptions/faf8dd08-6434-4aa9-bf01-aed24aa52984/resourceGroups/rg-lllllits/overview

az deploy logs

azd deploy

Deploying services (azd deploy)

(✓) Done: Deploying service llamaindex

SUCCESS: Your application was deployed to Azure in 5 minutes 58 seconds.
You can view the resources created under the resource group rg-lllllits in Azure Portal:
https://portal.azure.com/#@/resource/subscriptions/faf8dd08-6434-4aa9-bf01-aed24aa52984/resourceGroups/rg-lllllits/overview

image

@v-xuto
Copy link
Member

v-xuto commented Dec 9, 2024

@manekinekko There is still question with this issue. For more details, please review comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants