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
The pipeline supports **Azure AI Search** integration for **Retrieval-Augmented Generation (RAG)**. When configured, the pipeline automatically includes a `data_sources` field in requests to Azure AI, enabling document-based AI responses that can cite and reference your indexed content.
58
70
59
-
# Azure Search API key (if using api_key authentication)
60
-
AZURE_SEARCH_KEY="your-search-api-key"
71
+
> [!IMPORTANT]
72
+
> **Azure AI Search integration only works with Azure OpenAI endpoints** in this specific format:
- 📚 [Azure AI Search with Azure OpenAI - Official Guide](https://learn.microsoft.com/en-us/azure/ai-foundry/openai/use-your-data-quickstart?tabs=api-key%2Ctypescript-keyless%2Cpython-new&pivots=rest-api)
80
+
- 🔧 [Data Sources API Reference](https://learn.microsoft.com/en-us/azure/ai-foundry/openai/references/on-your-data?tabs=rest#data-source)
"role_information": "You are an AI assistant that helps with questions based on the provided documents."
138
+
}
139
+
}
140
+
]
88
141
```
89
142
90
-
### Azure Search / RAG Integration
143
+
#### 🚀 Quick Setup Steps
144
+
145
+
1.**Create Azure Search Service** - Set up an Azure Search service in the Azure portal
146
+
2.**Create and populate index** - Upload your documents to a search index
147
+
3.**Get API key** - Copy the API key from your Azure Search service
148
+
4.**Configure pipeline** - Add the `AZURE_AI_DATA_SOURCES` environment variable
149
+
5.**Use Azure OpenAI endpoint** - Ensure you're using the correct Azure OpenAI URL format
150
+
151
+
#### ⚠️ Common Issues
152
+
153
+
-**Wrong endpoint format**: Make sure you're using Azure OpenAI URLs, not regular Azure AI endpoints
154
+
-**Invalid JSON**: Copy the JSON template exactly and only change the placeholder values
155
+
-**Missing API key**: Ensure your Azure Search API key has proper permissions
156
+
-**Index not found**: Verify your index name matches exactly (case-sensitive)
157
+
158
+
#### Enhanced Citation Display
159
+
160
+
The pipeline automatically enhances Azure AI Search responses to make citations and source documents more accessible and readable. When Azure AI Search is configured, the pipeline transforms the raw citation data into a user-friendly format.
161
+
162
+
**Original Azure AI Response:**
163
+
164
+
```json
165
+
{
166
+
"choices": [
167
+
{
168
+
"message": {
169
+
"content": "**Docker container actions** are a type of GitHub Actions [doc1]...",
170
+
"context": {
171
+
"citations": [
172
+
{
173
+
"content": "environment variable. The token can be used to authenticate...",
174
+
"title": "README.md",
175
+
"chunk_id": "0"
176
+
}
177
+
]
178
+
}
179
+
}
180
+
}
181
+
]
182
+
}
183
+
```
91
184
92
-
The pipeline now supports **Azure Search** integration for **Retrieval-Augmented Generation (RAG)**. When configured, the pipeline will automatically include a `data_sources` field in requests to Azure AI, enabling document-based AI responses.
185
+
**Enhanced Response with Collapsible Citations:**
93
186
94
-
#### Configuration
187
+
```html
188
+
**Docker container actions** are a type of GitHub Actions [doc1]...
95
189
96
-
Configure Azure Search by setting the following environment variables:
190
+
<details>
191
+
<summary>📚 Sources and References</summary>
97
192
98
-
-**AZURE_SEARCH_ENDPOINT**: Your Azure Search service endpoint
99
-
-**AZURE_SEARCH_INDEX_NAME**: Name of the search index containing your documents
100
-
-**AZURE_SEARCH_AUTHENTICATION_TYPE**: Authentication method (`system_assigned_managed_identity` or `api_key`)
101
-
-**AZURE_SEARCH_KEY**: API key (if using `api_key` authentication)
193
+
<details>
194
+
<summary>[doc1] - README.md</summary>
195
+
196
+
📁 **File:** `README.md`
197
+
📄 **Chunk ID:** 0
198
+
**Content:**
199
+
> environment variable. The token can be used to authenticate the workflow when accessing GitHub resources...
200
+
201
+
</details>
202
+
203
+
<details>
204
+
<summary>[doc2] - Documentation.md</summary>
205
+
206
+
📁 **File:** `Documentation.md`
207
+
📄 **Chunk ID:** 1
208
+
**Content:**
209
+
> Docker container actions contain all their dependencies in the container and are therefore very consistent...
210
+
211
+
</details>
212
+
213
+
</details>
214
+
```
102
215
103
-
#### Optional Settings
216
+
**Enhanced Citation Features:**
104
217
105
-
-**AZURE_SEARCH_PROJECT_RESOURCE_ID**: Project resource ID
106
-
-**AZURE_SEARCH_SEMANTIC_CONFIGURATION**: Semantic configuration name
107
-
-**AZURE_SEARCH_EMBEDDING_ENDPOINT**: Embedding service endpoint
108
-
-**AZURE_SEARCH_EMBEDDING_KEY**: Embedding service API key
109
-
-**AZURE_SEARCH_QUERY_TYPE**: Query type (`vectorSimpleHybrid`, `vector`, `semantic`)
110
-
-**AZURE_SEARCH_IN_SCOPE**: Limit to indexed documents only
111
-
-**AZURE_SEARCH_ROLE_INFORMATION**: Role information for responses
-**AZURE_SEARCH_TOP_N_DOCUMENTS**: Number of documents to retrieve
218
+
-**Collapsible interface** with expandable sections for clean presentation
219
+
-**Two-level organization** - main sources section and individual document details
220
+
-**Complete content display** - full document content, not just previews
221
+
-**Document references** with clear [doc1], [doc2] labels for easy cross-referencing
222
+
-**Source metadata** including file paths, URLs, and chunk IDs for precise tracking
223
+
-**Streaming support** with citations properly formatted for both streaming and non-streaming responses
224
+
-**Space efficient** - collapsed by default to avoid overwhelming the main response
114
225
115
226
> [!TIP]
116
227
> To use **Azure OpenAI** and other **Azure AI** models **simultaneously**, you can use the following URL: `https://<your project>.services.ai.azure.com/models/chat/completions?api-version=2024-05-01-preview`
0 commit comments