Skip to content

Commit d8b2b18

Browse files
committed
updated readme with custom data ingestion process
1 parent 40cfb43 commit d8b2b18

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,17 @@ To properly configure automated build and deploy for both backend and frontend c
122122

123123
![pipeline success](./docs/github-actions-pipeline-success.png)
124124

125+
## Custom Data Ingestion and Indexing
126+
The repo includes sample pdf documents in the data folder. They are ingested in blob container and indexed in azure cognitive search during infra provisioning by azure developer cli post provision hooks (see line 23 in [azure.yaml](azure.yaml))
127+
128+
If you want to chat with your custom documents you can:
129+
1. Add your pdf documents in the [data folder](./data/).
130+
2. Open a terminal and cd to repo root folder. Example `cd path/to/your/custom/dir/azure-search-openai-demo-java`
131+
3. Run `./scripts/prepdocs.ps1` if you are on windows or `./scripts/prepdocs.sh` on linux
132+
4. Wait the script to complete. This is not a 'delta' process, it's not updating **only** the new files you've added. Instead on each run all documents in data folder will be ingested.Feel free to add new files you want to ingest and delete/move the old documents from the data folder. Once you've run the script and it completes successfully, cognitive search index have been updated and stored (until you want to manually delete it from your azure cognitive search instance)
133+
5. if ingestion and indexing is completed successfully you should see a message like this
134+
![prepdocs success](./docs/prepdocs-success.png)
135+
125136
## Resources
126137

127138
* [Revolutionize your Enterprise Data with ChatGPT: Next-gen Apps w/ Azure OpenAI and Cognitive Search](https://aka.ms/entgptsearchblog)

app/backend/src/main/java/com/microsoft/openai/samples/rag/config/CognitiveSearchConfiguration.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class CognitiveSearchConfiguration {
2424
TokenCredential tokenCredential;
2525

2626
@Bean
27-
@ConditionalOnProperty(name = "openai.tracing.enabled", havingValue = "true")
27+
@ConditionalOnProperty(name = "cognitive.tracing.enabled", havingValue = "true")
2828
public SearchClient searchTracingEnabledClient() {
2929
String endpoint = "https://%s.search.windows.net".formatted(searchServiceName);
3030

@@ -43,7 +43,7 @@ public SearchClient searchTracingEnabledClient() {
4343

4444

4545
@Bean
46-
@ConditionalOnProperty(name = "openai.tracing.enabled", havingValue = "false")
46+
@ConditionalOnProperty(name = "cognitive.tracing.enabled", havingValue = "false")
4747
public SearchClient searchDefaultClient() {
4848
String endpoint = "https://%s.search.windows.net".formatted(searchServiceName);
4949
return new SearchClientBuilder()

docs/prepdocs-success.png

23.6 KB
Loading

0 commit comments

Comments
 (0)