You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-1
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,8 @@ It is intended that the plugins and skills provided in this repository, are adap
7
7
## Components
8
8
9
9
-`./text2sql` contains an Multi-Shot implementation for Text2SQL generation and querying which can be used to answer questions backed by a database as a knowledge base.
10
-
-`./ai_search_with_adi` contains code for linking Azure Document Intelligence with AI Search to process complex documents with charts and images, and uses multi-modal models (gpt4o) to interpret and understand these.
10
+
-`./ai_search_with_adi_function_app` contains code for linking Azure Document Intelligence with AI Search to process complex documents with charts and images, and uses multi-modal models (gpt4o) to interpret and understand these.
11
+
-`./deploy_ai_search` provides an easy Python based utility for deploying an index, indexer and corresponding skillset for AI Search.
11
12
12
13
The above components have been successfully used on production RAG projects to increase the quality of responses. The code provided in this repo is a sample of the implementation and should be adjusted before being used in production.
Copy file name to clipboardExpand all lines: adi_function_app/README.md
+21-11
Original file line number
Diff line number
Diff line change
@@ -38,35 +38,46 @@ The properties returned from the ADI Custom Skill are then used to perform the f
38
38
39
39
## Provided Notebooks \& Utilities
40
40
41
-
-`./ai_search.py`, `./deployment.py` provide an easy Python based utility for deploying an index, indexer and corresponding skillset for AI Search.
42
-
-`./function_apps/indexer` provides a pre-built Python function app that communicates with Azure Document Intelligence, Azure OpenAI etc to perform the Markdown conversion, extraction of figures, figure understanding and corresponding cleaning of Markdown.
41
+
-`./ai_search_with_adi_function_app` provides a pre-built Python function app that communicates with Azure Document Intelligence, Azure OpenAI etc to perform the Markdown conversion, extraction of figures, figure understanding and corresponding cleaning of Markdown.
43
42
-`./rag_with_ai_search.ipynb` provides example of how to utilise the AI Search plugin to query the index.
44
43
44
+
## Deploying AI Search Setup
45
+
46
+
To deploy the pre-built index and associated indexer / skillset setup, see instructions in `./ai_search/README.md`.
47
+
45
48
## ADI Custom Skill
46
49
47
-
Deploy the associated function app and required resources. You can then experiment with the custom skill by sending an HTTP request in the AI Search JSON format to the `/adi_2_ai_search` HTTP endpoint.
50
+
Deploy the associated function app and required resources. You can then experiment with the custom skill by sending an HTTP request in the AI Search JSON format to the `/adi_2_deploy_ai_search` HTTP endpoint.
48
51
49
52
To use with an index, either use the utility to configure a indexer in the provided form, or integrate the skill with your skillset pipeline.
50
53
51
-
### function_app.py
54
+
### Deployment Steps
55
+
56
+
1. Update `.env` file with the associated values. Not all values are required dependent on whether you are using System / User Assigned Identities or a Key based authentication. Use this template to update the environment variables in the function app.
57
+
2. Make sure the infra and required identities are setup. This setup requires Azure Document Intelligence and GPT4o.
58
+
3.[Deploy your function app](https://learn.microsoft.com/en-us/azure/azure-functions/functions-deployment-technologies?tabs=windows) and test with a HTTP request.
52
59
53
-
`./function_apps/indexer/function_app.py` contains the HTTP entrypoints for the ADI skill and the other provided utility skills.
60
+
### Code Files
54
61
55
-
###adi_2_aisearch
62
+
#### function_app.py
56
63
57
-
`./function_apps/indexer/adi_2_aisearch.py` contains the methods for content extraction with ADI. The key methods are:
64
+
`./indexer/ai_search_with_adi_function_app.py` contains the HTTP entrypoints for the ADI skill and the other provided utility skills.
58
65
59
-
#### analyse_document
66
+
#### adi_2_aisearch
67
+
68
+
`./indexer/adi_2_aisearch.py` contains the methods for content extraction with ADI. The key methods are:
69
+
70
+
##### analyse_document
60
71
61
72
This method takes the passed file, uploads it to ADI and retrieves the Markdown format.
62
73
63
-
#### process_figures_from_extracted_content
74
+
#####process_figures_from_extracted_content
64
75
65
76
This method takes the detected figures, and crops them out of the page to save them as images. It uses the `understand_image_with_vlm` to communicate with Azure OpenAI to understand the meaning of the extracted figure.
66
77
67
78
`update_figure_description` is used to update the original Markdown content with the description and meaning of the figure.
68
79
69
-
#### clean_adi_markdown
80
+
#####clean_adi_markdown
70
81
71
82
This method performs the final cleaning of the Markdown contents. In this method, the section headings and page numbers are extracted for the content to be returned to the indexer.
72
83
@@ -181,7 +192,6 @@ If `chunk_by_page` header is `False`:
181
192
182
193
**Page wise analysis in ADI is recommended to avoid splitting tables / figures across multiple chunks, when the chunking is performed.**
183
194
184
-
185
195
## Production Considerations
186
196
187
197
Below are some of the considerations that should be made before using this custom skill in production:
0 commit comments