spring-ai-examples

spring-ai-examples

Examples of using Spring AI.

Stars: 100

Visit
 screenshot

This repository contains various examples of using Spring AI. Users can clone the entire project or use SpringCLI to select individual projects and create them locally. It includes a project-catalog.yml for adding as a project catalog to Spring CLI. Users can create projects locally using 'spring boot new' or mix a project's functionality into an existing project using 'spring boot add'. Be cautious about building against newer versions of Spring Boot than your project, as it may lead to build or test errors.

README:

Spring AI Examples

This repository is where I'll commit various examples of using Spring AI.

You can clone this project in its entirety and work with it like that. Or better, use the SpringCLI to select individual projects and create them locally.

This repository includes a project-catalog.yml, so you can add it as a project catalog to Spring CLI like this:

% spring project-catalog add spring-ai-examples https://github.com/habuma/spring-ai-examples

Then you will be able to see these projects when using spring project list and be able to create projects locally using spring boot new. For example, to create a new local copy of the "prompts-and-output-parsers" example, do this:

% spring boot new my-project output-parsers com.example.ai

This will create the project in a directory named "my-project" and will refactor the package names to be com.example.ai.

You can also mix a project's functionality into an existing project by using spring boot add. For example, let's say you already have a Spring Boot project and want to add the functionality of the "prompts-and-output-parsers" project to it. Here's how you would do that:

% spring boot add output-parsers

Be aware, however, that the Spring AI examples may build against newer versions of Spring Boot than your project. If so, your project's original Boot version will remain unchanged and you may get build or test errors. You'll need to update your Boot version to the version of the example project to fix the build.

Also note that the project catalog includes one example that is maintained in separate Git repositories:

Because they're in the project catalog, you can use the Spring CLI to create those projects as well.

Want more?

If you like this repository of example, then you're going to love Spring AI in Action, now available in Manning's Early Access Program (MEAP). It covers all aspects of working with Spring AI with a fun example that runs throughout most of the book.

Spring AI in Action

For Tasks:

Click tags to check more tools for each tasks

For Jobs:

Alternative AI tools for spring-ai-examples

Similar Open Source Tools

For similar tasks

For similar jobs