Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcushellberg/spring-ai-examples
https://github.com/marcushellberg/spring-ai-examples
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/marcushellberg/spring-ai-examples
- Owner: marcushellberg
- License: mit
- Created: 2024-10-27T08:34:14.000Z (19 days ago)
- Default Branch: main
- Last Pushed: 2024-11-02T07:20:53.000Z (13 days ago)
- Last Synced: 2024-11-02T08:17:04.559Z (13 days ago)
- Language: Java
- Size: 205 KB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Practical AI examples using Spring AI
## Included examples
- Document summarization and analysis
- Sentiment analysis
- Text drafting
- Image data extraction
- Advanced RAG techniques
- Multi-source retrieval
- Re-ranking
- Question rewriting## Requirements
The application expects you to have the following two API keys as environment variables:
- `OPENAI_API_KEY`: OpenAI API key
- `COHERE_API_KEY`: Cohere API key for document re-ranking. See `RagChat.java` comments for more information.## Running the examples
Run `Application.java` in your IDE or use the following command:
```bash
mvn spring-boot:run
```## Using local models
You can use local models with Ollama by updating the spring-ai dependency in the `pom.xml` file, and defining which models to use in the `application.properties` file.