Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
7294f7d
Add ElasticsearchAiSearchFilterExpressionConverter
JM-Lab Jan 9, 2024
c069db8
Add support for Elasticsearch vector store
JM-Lab Jan 9, 2024
8ff8b87
Add support for various vector functions provided by Elasticsearch
JM-Lab Jan 14, 2024
5d41978
Add support for Elasticsearch 8 vector store using the elasticsearch-…
JM-Lab Mar 3, 2024
011dfcb
Merge branch 'spring-projects:main' into elasticsearch-vector-store
JM-Lab Mar 3, 2024
8701ccc
Improve VertexAiGeminiAutoConfiguration to allow function calling por…
tzolov Mar 4, 2024
db383f8
Update README.md
markpollack Mar 4, 2024
7d04167
Adding support for OpenAI Audio transcriptions
michaellavelle Feb 6, 2024
8ae506f
Improve the OpenAi Audio code structure
tzolov Mar 6, 2024
c0c9dd2
Upgrade Azure OpenAI from 1.0.0-beta.6 to 1.0.0-beta.7
tzolov Mar 6, 2024
7cc2eab
Change flatten pom config
markpollack Mar 1, 2024
7396597
Update to add latest gpt-3.5 turbo model number
youngmoneee Mar 5, 2024
3938cc8
Remove setters from options interface
youngmoneee Mar 6, 2024
f6c57f6
rename directory spring-ai-stabilityai to stability-ai
Mar 3, 2024
bcb559a
add license header plugin and update all java files
markpollack Mar 6, 2024
8ed2af4
Add Ollama enum with supported models and their ids
sblashuk Mar 1, 2024
78f73d1
Exclude .antlr and aot.factories from license headers check
tzolov Mar 7, 2024
1e3eaec
Refactor and centralize Retry logic:
tzolov Mar 6, 2024
1d6d11c
Resolve OpenAiApi initialization bug
tzolov Mar 7, 2024
e535c0e
Adjust the retry properties names and documentation
tzolov Mar 8, 2024
ba94039
Use platform independent line separators
tzolov Mar 8, 2024
4fa2c6c
Move the maven license plugin into a 'license' profile
tzolov Mar 8, 2024
659f007
Update auto-configure classes to return the most specific class types
tzolov Mar 8, 2024
af957b9
Add ETL pipeline diagrams
tzolov Mar 8, 2024
1ea8515
Fix spring-ai-retry BOM version
tzolov Mar 8, 2024
fef7303
Replace %n by System.lineSeparator()
tzolov Mar 8, 2024
8a0ad1d
Disable outdated samples
tzolov Mar 8, 2024
8a336fb
Update google could bom from 26.33.0 to 26.34.0
tzolov Mar 8, 2024
680150e
Use MessageType.FUNCTION for FunctionMessage
yarisvt Mar 8, 2024
7f60e03
Fix Bedrock Anthropic line separator handling on Windows
tzolov Mar 8, 2024
8784a59
Add logging of page processing progress in PagePdfDocumentReader
markpollack Mar 7, 2024
7b89341
Add shell.log to gitignore
markpollack Mar 8, 2024
634e6d0
Add Azure Workshop sample app to getting started doc
markpollack Mar 8, 2024
f8f38d6
Add MistralAI links to getting started doc
ricken07 Mar 9, 2024
0fdc6aa
Add streaming Function Calling support of OpenAI and Mistral AI
tzolov Mar 10, 2024
c5d9ae3
Improve Milvus documentation
tzolov Mar 11, 2024
7f1570d
Update javadoc for message package and docs for Gemini Multimodal sup…
markpollack Mar 11, 2024
4209d5a
Make consistent sync/stream AssistantMessage properties for OpenAI an…
tzolov Mar 12, 2024
777b79e
Fix RedisVectorStore not closing Jedis pipelines
Bragolgirith Mar 10, 2024
1e98f82
Change Azure embedding and chat options 'model' property to 'deployme…
markpollack Mar 11, 2024
ed5eef4
fix failing test due to property name change of model->deployment-nam…
markpollack Mar 12, 2024
4fd15b1
Add documentation for OpenAI Transcription
markpollack Mar 12, 2024
7bfe312
Convinence StreamingChatClient stream default
tzolov Mar 12, 2024
783d81b
add quotes around command in github action to upload javadocs
markpollack Mar 12, 2024
490f3cd
Milestone Release 0.8.1
markpollack Mar 12, 2024
4c617e1
Prepare next development iteration
markpollack Mar 12, 2024
9e98962
Add additional ctor for OpenAiEmbeddingClient
markpollack Mar 14, 2024
255e542
CI/CD configuration fixes
tzolov Mar 15, 2024
7d44f14
Fix typo in model name, fixed #442
abel533 Mar 14, 2024
73f9cb8
Fixed syntax in reference
Mar 12, 2024
be7e291
Fixed typo in Bedrock Titan chat option exception
pradipkhomane Mar 12, 2024
ba3e94e
Fixed typo in 'reference'
bottlerocketjonny Mar 12, 2024
152420f
Fix Typos and Grammatical Errors
mackey0225 Mar 15, 2024
7c6bbef
Allow more customization for Neo4j store (id and constraint).
meistermeier Mar 14, 2024
6638efe
fix code formatting
tzolov Mar 15, 2024
0e8b696
modified ImageMessage.java line 45: mage > Image
Mar 11, 2024
a8142b7
fixing GH document upload action
tzolov Mar 15, 2024
4e3bba7
Fix GH documenttation-upload.yml
tzolov Mar 15, 2024
cf463c8
Improve the Deploy docs steps of Docs uplaod GH action
tzolov Mar 15, 2024
c453529
Final GH doc action fixes
tzolov Mar 15, 2024
9330187
Improve auto-confg condigiton on class to prevent undesired activation
tzolov Mar 15, 2024
49a1cc6
Update Mistral AI function calling docs and layout
tzolov Mar 16, 2024
9c19dc1
Improve Antora documentation layout
tzolov Mar 16, 2024
5f0123c
Add MongoDB Atlas Vector store
Kirbstomper Nov 4, 2023
db43fe3
Add PostgresMlAutoConfiguration to AutoConfiguration.imports
izeye Mar 16, 2024
c036931
Implemented Bedrock Jurassic 2 ChatClient
hemeda3 Mar 3, 2024
c5f3502
Remove withReuse in MongoDBAtlasContainer
eddumelendez Mar 16, 2024
c2b3659
Add ElasticsearchAiSearchFilterExpressionConverter
JM-Lab Jan 9, 2024
04b25ff
Add support for Elasticsearch vector store
JM-Lab Jan 9, 2024
bdc413c
Add support for various vector functions provided by Elasticsearch
JM-Lab Jan 14, 2024
d0a185b
Add support for Elasticsearch 8 vector store using the elasticsearch-…
JM-Lab Mar 3, 2024
ba1728e
Merge branch 'elasticsearch-vector-store' of https://github.com/JM-La…
JM-Lab Mar 17, 2024
b38552c
Rebase, fix compilation and style errors add missing dependecies in p…
tzolov Mar 15, 2024
a28f245
Fix ElasticsearchVectorStoreIT FilterExpression with Date type requir…
JM-Lab Mar 17, 2024
5cb6d92
Rename Elasticsearch8VectorStoreIT to ElasticsearchVectorStoreIT
JM-Lab Mar 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Generate Java docs
run: mvn javadoc:aggregate

- name: Generate Reference docs
- name: Generate assembly
working-directory: spring-ai-docs
run: mvn assembly:single

Expand All @@ -60,5 +60,5 @@ jobs:
working-directory: spring-ai-docs/target
run: |
unzip spring-ai-$PROJECT_VERSION-docs.zip
ssh -i $HOME/.ssh/key $DOCS_USERNAME@$DOCS_HOST cd $DOCS_PATH && mkdir -p $PROJECT_VERSION/api
ssh -i $HOME/.ssh/key $DOCS_USERNAME@$DOCS_HOST "cd $DOCS_PATH && mkdir -p $PROJECT_VERSION/api"
scp -i $HOME/.ssh/key -r api $DOCS_USERNAME@$DOCS_HOST:$DOCS_PATH/$PROJECT_VERSION/api
11 changes: 5 additions & 6 deletions .github/workflows/documentation-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:
- name: Generate Java docs
run: mvn javadoc:aggregate

- name: Generate Reference docs
- name: Generate assembly
working-directory: spring-ai-docs
run: mvn site
run: mvn assembly:single

- name: Setup SSH key
env:
Expand All @@ -50,7 +50,6 @@ jobs:
working-directory: spring-ai-docs/target
run: |
unzip spring-ai-$RELEASE_VERSION-docs.zip
ssh -i $HOME/.ssh/key $DOCS_USERNAME@$DOCS_HOST cd $DOCS_PATH && mkdir $RELEASE_VERSION
scp -i $HOME/.ssh/key -r api reference $DOCS_USERNAME@$DOCS_HOST:$DOCS_PATH/$RELEASE_VERSION
ssh -i $HOME/.ssh/key $DOCS_USERNAME@$DOCS_HOST rm current && ln -s $RELEASE_VERSION current

ssh -i $HOME/.ssh/key $DOCS_USERNAME@$DOCS_HOST "cd $DOCS_PATH && mkdir -p $RELEASE_VERSION/api"
scp -i $HOME/.ssh/key -r api $DOCS_USERNAME@$DOCS_HOST:$DOCS_PATH/$RELEASE_VERSION

4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ node_modules
package-lock.json
package.json
.vscode
.antlr
.antlr

shell.log
33 changes: 17 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The Spring AI project provides a Spring-friendly API and abstractions for develo

Let's make your `@Beans` intelligent!

For further information go to our [Spring AI refernce documentation](https://docs.spring.io/spring-ai/reference/).
For further information go to our [Spring AI reference documentation](https://docs.spring.io/spring-ai/reference/).

## Project Links

Expand All @@ -17,7 +17,7 @@ For further information go to our [Spring AI refernce documentation](https://doc

## Educational Resources

- Follow the [Workshop](#workshop)
- Follow the [Workshop material for Azure OpenAI](https://github.com/Azure-Samples/spring-ai-azure-workshop)
- The workshop contains step-by-step examples from 'hello world' to 'retrieval augmented generation'

Some selected videos. Search YouTube! for more.
Expand All @@ -29,19 +29,6 @@ Some selected videos. Search YouTube! for more.
* Introducing Spring AI - Add Generative AI to your Spring Applications
<br>[![Watch the video](https://img.youtube.com/vi/1g_wuincUdU/default.jpg)](https://www.youtube.com/watch?v=1g_wuincUdU)


## Workshop

* You can try out the features of Spring AI by following the [workshop material for Azure OpenAI](https://github.com/Azure-Samples/spring-ai-azure-workshop)
* To use the workshop material with OpenAI (not Azure's offering) you will need to *replace* the Azure Open AI Boot Starter in the `pom.xml` with the Open AI Boot Starter.
```xml
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
<version>0.7.1-SNAPSHOT</version>
</dependency>
```

## Getting Started

Please refer to the [Getting Started Guide](https://docs.spring.io/spring-ai/reference/getting-started.html) for instruction on adding your dependencies.
Expand Down Expand Up @@ -96,7 +83,7 @@ You can find more details in the [Reference Documentation](https://docs.spring.i

Spring AI supports many AI models. For an overview see here. Specific models currently supported are
* OpenAI
*
*


**Prompts:** Central to AI model interaction is the Prompt, which provides specific instructions for the AI to act upon.
Expand Down Expand Up @@ -202,3 +189,17 @@ To build the docs

The docs are then in the directory `spring-ai-docs/target/antora/site/index.html`

To reformat using the [java-format plugin](https://github.com/spring-io/spring-javaformat)
```shell
./mvnw spring-javaformat:apply
```

To update the year on license headers using the [license-maven-plugin](https://oss.carbou.me/license-maven-plugin/#goals)
```shell
./mvnw license:update-file-header -Plicense
```

To check javadocs using the [javadoc:javadoc](https://maven.apache.org/plugins/maven-javadoc-plugin/)
```shell
./mvnw javadoc:javadoc -Pjavadoc
```
2 changes: 1 addition & 1 deletion document-readers/pdf-reader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai</artifactId>
<version>0.8.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>spring-ai-pdf-document-reader</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
/*
* Copyright 2023-2023 the original author or authors.
* Copyright 2023 - 2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.springframework.ai.reader.pdf;

import java.awt.Rectangle;
Expand All @@ -26,6 +25,8 @@
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDPage;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.ai.document.Document;
import org.springframework.ai.document.DocumentReader;
import org.springframework.ai.reader.pdf.config.PdfDocumentReaderConfig;
Expand All @@ -45,6 +46,8 @@
*/
public class PagePdfDocumentReader implements DocumentReader {

private final Logger logger = LoggerFactory.getLogger(getClass());

private static final String PDF_PAGE_REGION = "pdfPageRegion";

public static final String METADATA_START_PAGE_NUMBER = "page_number";
Expand Down Expand Up @@ -100,7 +103,17 @@ public List<Document> get() {

List<String> pageTextGroupList = new ArrayList<>();

int totalPages = this.document.getDocumentCatalog().getPages().getCount();
int logFrequency = totalPages > 10 ? totalPages / 10 : 1; // if less than 10
// pages, print
// each iteration
int counter = 0;

for (PDPage page : this.document.getDocumentCatalog().getPages()) {
if (counter % logFrequency == 0 && counter / logFrequency < 10) {
logger.info("Processing PDF page: {}", (counter + 1));
}
counter++;

pagesPerDocument++;

Expand Down Expand Up @@ -140,7 +153,7 @@ public List<Document> get() {
readDocuments.add(toDocument(pageTextGroupList.stream().collect(Collectors.joining()), startPageNumber,
pageNumber));
}

logger.info("Processing {} pages", totalPages);
return readDocuments;

}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
/*
* Copyright 2023-2023 the original author or authors.
* Copyright 2023 - 2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.springframework.ai.reader.pdf;

import java.awt.Rectangle;
Expand All @@ -24,6 +23,8 @@
import org.apache.pdfbox.pdfparser.PDFParser;
import org.apache.pdfbox.pdmodel.PDDocument;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.ai.document.Document;
import org.springframework.ai.document.DocumentReader;
import org.springframework.ai.reader.pdf.config.ParagraphManager;
Expand All @@ -47,6 +48,8 @@
*/
public class ParagraphPdfDocumentReader implements DocumentReader {

private final Logger logger = LoggerFactory.getLogger(getClass());

// Constants for metadata keys
private static final String METADATA_START_PAGE = "page_number";

Expand Down Expand Up @@ -129,6 +132,7 @@ public List<Document> get() {
List<Document> documents = new ArrayList<>(paragraphs.size());

if (!CollectionUtils.isEmpty(paragraphs)) {
logger.info("Start processing paragraphs from PDF");
Iterator<Paragraph> itr = paragraphs.iterator();

var current = itr.next();
Expand All @@ -147,7 +151,7 @@ public List<Document> get() {
}
}
}

logger.info("End processing paragraphs from PDF");
return documents;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2023 - 2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.ai.reader.pdf.aot;

import org.springframework.aot.hint.RuntimeHints;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
/*
* Copyright 2023-2023 the original author or authors.
* Copyright 2023 - 2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.springframework.ai.reader.pdf.config;

import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2023 - 2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.ai.reader.pdf.config;

import org.springframework.ai.reader.ExtractedTextFormatter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2023 - 2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
/*
* Copyright 2023-2023 the original author or authors.
* Copyright 2023 - 2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.springframework.ai.reader.pdf.layout;

import java.awt.geom.Rectangle2D;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
/*
* Copyright 2023-2024 the original author or authors.
* Copyright 2023 - 2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.springframework.ai.reader.pdf;

import java.util.List;
Expand Down Expand Up @@ -51,7 +50,7 @@ public void classpathRead() {

assertThat(docs).hasSize(4);

String allText = docs.stream().map(d -> d.getContent()).collect(Collectors.joining("\n"));
String allText = docs.stream().map(d -> d.getContent()).collect(Collectors.joining(System.lineSeparator()));

assertThat(allText).doesNotContain(
List.of("Page 1 of 4", "Page 2 of 4", "Page 3 of 4", "Page 4 of 4", "PDF Bookmark Sample"));
Expand Down
Loading