Zack Saadioui
8/26/2024
1
2
3
bash
git clone https://github.com/run-llama/llama_index.git
cd llama_index
1
pom.xml
1
2
3
4
5
6
7
8
9
xml
<dependencies>
<dependency>
<groupId>ai.llama</groupId>
<artifactId>llama-index-java</artifactId>
<version>1.0.0</version>
</dependency>
<!-- Add other dependencies as needed -->
</dependencies>
1
build.gradle
1
2
3
4
groovy
dependencies {
implementation 'ai.llama:llama-index-java:1.0.0'
}
1
2
bash
mvn clean install
1
2
bash
gradle build
1
SimpleDirectoryReader
1
VectorStoreIndex
1
2
java
VectorStoreIndex index = VectorStoreIndex.fromDocuments(documents);
1
2
3
4
java
QueryEngine queryEngine = index.asQueryEngine();
String queryResponse = queryEngine.query("What is the data pertaining to X?");
System.out.println(queryResponse);
Copyright © Arsturn 2024