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: Java/CosmosDB-MongoDB-vCore-Langchain/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ This sample provides a demo showcasing the usage of the RAG pattern for integrat
4
4
5
5
### Prerequisites
6
6
7
-
- Azure Cosmos DB Monogo Account
7
+
- Azure Cosmos DB Mongo Account
8
8
- Connection string
9
9
- Azure Open AI Service
10
10
- Deploy text-davinci-003 model for Embeding
@@ -35,5 +35,5 @@ mvn exec:java
35
35
```
36
36
37
37
## Getting Started
38
-
When you run the application for the first time, it will read and vectorize docs in the `PDF_docs` folder, and insert them into Cosmos DB MongoDB vCore vector store. To begin, just ask a question in command line.
38
+
When you run the application for the first time, it will read and vectorize docs in the `PDF_docs` folder (you can add your own pdf or txt docs here), and insert them into Cosmos DB MongoDB vCore vector store. To begin, just ask a question in command line.
# Use Azure Cosmos DB NoSQL API with Langchain in Java.
2
+
3
+
This sample provides a demo showcasing the usage of the RAG pattern for integrating Azure Open AI services with custom data in Azure Cosmos NoSQL API with [vector search using DiskANN index](https://learn.microsoft.com/azure/cosmos-db/nosql/vector-search) and [langchain framework for java](https://github.com/langchain4j/langchain4j).
4
+
5
+
### Prerequisites
6
+
7
+
- Azure Cosmos DB NoSQL API Account
8
+
- Azure Cosmos DB NoSQL API endpoint
9
+
- Azure Cosmos DB NoSQL API key
10
+
- Azure Open AI Service
11
+
- Deploy text-davinci-003 model for Embeding
12
+
- Deploy gpt-35-turbo model for Chat Completion
13
+
14
+
15
+
### Installation
16
+
```bash
17
+
mvn clean install
18
+
```
19
+
20
+
### Run
21
+
22
+
Before running the application, you need to set environment variables. Either export them in command line or set system variables:
23
+
24
+
```bash
25
+
export COSMOSDB_ENDPOINT="Azure Cosmos DB NoSQL API endpoint"
26
+
export COSMOSDB_KEY="Azure Cosmos DB NoSQL API key"
27
+
export AZURE_OPENAI_ENDPOINT="endpoint for your Azure OpenAI account"
28
+
export AZURE_OPENAI_APIKEY="key for your Azure OpenAI account"
29
+
export AZURE_OPENAI_CHATDEPLOYMENTID="deployment id for your Azure OpenAI chat embeddings"
30
+
export AZURE_OPENAI_EMBEDDINGDEPLOYMENTID="deployment is for your Azure OpenAI chat completions"
31
+
```
32
+
33
+
Then run the app:
34
+
35
+
```bash
36
+
mvn exec:java
37
+
```
38
+
39
+
## Getting Started
40
+
When you run the application for the first time, it will read and vectorize docs in the `PDF_docs` folder (you can add your own pdf or txt docs here), and insert them into Cosmos DB NoSQL API vector store. To begin, just ask a question in command line. By default, your private data will be used to form a response regardless of it's accuracy (experiment with changing the prompt to change the chat completion behaviour).
0 commit comments