Skip to content

Commit 39e3a21

Browse files
springai update (#171)
* pom.xml for spring ai 1.0 update * store additional chunks
1 parent c07f1be commit 39e3a21

File tree

3 files changed

+150
-108
lines changed

3 files changed

+150
-108
lines changed

src/client/spring_ai/README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,12 @@ Start with:
5555
This project contains a web service that will accept HTTP GET requests at
5656

5757
* `http://localhost:9090/v1/chat/completions`: to use RAG via OpenAI REST API
58-
5958
* `http://localhost:9090/v1/service/llm` : to chat straight with the LLM used
6059
* `http://localhost:9090/v1/service/search/`: to search for document similar to the message provided
60+
* `http://localhost:9090/v1/service/store-chunks/`: to embedd and store a list of text chunks in the vectorstore
6161

6262

63+
### Completions
6364
RAG call example with `openai` build profile with no-stream:
6465

6566
```
@@ -110,10 +111,33 @@ response not grounded:
110111
}
111112
```
112113

113-
## Oracle Backend for Microservices and AI
114+
### Add chunks
115+
Store additional text chunks in the vector store:
114116

117+
```
118+
curl -X POST http://localhost:9090/v1/service/store-chunks \
119+
-H "Content-Type: application/json" \
120+
-d '["First chunk of text.", "Second chunk.", "Another example."]'
121+
```
115122

123+
response:
116124

125+
```
126+
[
127+
[
128+
-0.014500250108540058,
129+
-0.03604526072740555,
130+
0.035963304340839386,
131+
0.010181647725403309,
132+
-0.01610776223242283,
133+
-0.021091962233185768,
134+
0.03924199938774109,
135+
..
136+
]
137+
]
138+
```
139+
140+
## Oracle Backend for Microservices and AI
117141
* Add in `application-obaas.yml` the **OPENAI_API_KEY**, if the deployement is based on the OpenAI LLM services:
118142
```
119143
openai:

src/client/spring_ai/pom.xml

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,32 @@
66
<parent>
77
<groupId>org.springframework.boot</groupId>
88
<artifactId>spring-boot-starter-parent</artifactId>
9-
<version>3.3.0</version>
9+
<version>3.4.5</version>
1010
<relativePath /> <!-- lookup parent from repository -->
1111
</parent>
1212
<groupId>com.example</groupId>
1313
<artifactId>myspringai</artifactId>
14-
<version>1.0.0-M6</version>
14+
<version>1.0.0</version>
1515
<name>myspringai</name>
16-
<description>Simple AI Application using OpenAPI Service</description>
16+
<description>Simple AI Application using OpenAPI or Ollama Service</description>
1717
<properties>
1818
<java.version>17</java.version>
19-
<spring-ai.version>1.0.0-M6</spring-ai.version>
19+
<spring-ai.version>1.0.0</spring-ai.version>
2020
</properties>
2121
<dependencyManagement>
2222
<dependencies>
2323
<dependency>
2424
<groupId>org.springframework.ai</groupId>
2525
<artifactId>spring-ai-bom</artifactId>
26-
<version>1.0.0-M6</version>
26+
<version>1.0.0</version>
2727
<type>pom</type>
2828
<scope>import</scope>
2929
</dependency>
3030
</dependencies>
3131
</dependencyManagement>
3232

3333
<dependencies>
34-
<!-- OPTIONALS: choose one permanently if you want delete the profiles ollama/openai
35-
<dependency>
36-
<groupId>org.springframework.ai</groupId>
37-
<artifactId>spring-ai-ollama-spring-boot-starter</artifactId>
38-
</dependency>
39-
40-
<dependency>
41-
<groupId>org.springframework.ai</groupId>
42-
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
43-
</dependency>
44-
-->
45-
34+
4635
<dependency>
4736
<groupId>org.springframework.boot</groupId>
4837
<artifactId>spring-boot-starter-web</artifactId>
@@ -74,14 +63,12 @@
7463
<!-- ORACLE DB-->
7564
<dependency>
7665
<groupId>org.springframework.ai</groupId>
77-
<artifactId>spring-ai-oracle-store-spring-boot-starter</artifactId>
78-
<version>1.0.0-M6</version>
66+
<artifactId>spring-ai-advisors-vector-store</artifactId>
7967
</dependency>
80-
<!--<dependency>
68+
<dependency>
8169
<groupId>org.springframework.ai</groupId>
82-
<artifactId>spring-ai-oracle-store</artifactId>
83-
<version>1.0.0-SNAPSHOT</version>
84-
</dependency>-->
70+
<artifactId>spring-ai-starter-vector-store-oracle</artifactId>
71+
</dependency>
8572
<dependency>
8673
<groupId>com.oracle.database.jdbc</groupId>
8774
<artifactId>ojdbc11</artifactId>
@@ -112,7 +99,7 @@
11299
<dependencies>
113100
<dependency>
114101
<groupId>org.springframework.ai</groupId>
115-
<artifactId>spring-ai-ollama-spring-boot-starter</artifactId>
102+
<artifactId>spring-ai-starter-model-ollama</artifactId>
116103
</dependency>
117104
</dependencies>
118105
</profile>
@@ -126,7 +113,7 @@
126113
<dependencies>
127114
<dependency>
128115
<groupId>org.springframework.ai</groupId>
129-
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
116+
<artifactId>spring-ai-starter-model-openai</artifactId>
130117
</dependency>
131118
</dependencies>
132119
</profile>

0 commit comments

Comments
 (0)