https://github.com/levigo/blog-langchain4j
Repo with examples for the blog
https://github.com/levigo/blog-langchain4j
Last synced: over 1 year ago
JSON representation
Repo with examples for the blog
- Host: GitHub
- URL: https://github.com/levigo/blog-langchain4j
- Owner: levigo
- Created: 2024-08-21T13:16:14.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-13T10:24:32.000Z (almost 2 years ago)
- Last Synced: 2025-03-04T13:46:12.998Z (over 1 year ago)
- Language: Java
- Size: 5.28 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# blog-langchain4j
Some code snippets for my blogs ([see here](https://www.levigo.de/2024/09/12/langchain4j-llms-fuer-java/)). If you are interested in [langchain4j](https://github.com/langchain4j/langchain4j), I would recommend to take a look at [langchain4j examples](https://github.com/langchain4j/langchain4j-examples)
This project contains some spring boot junit tests for the langchain4j framework. Models for test can be configured via ``application.yaml``, those will be auto-pulled in the configured ollama instance by default if needed.
Main beef is in the test classes themselves. So check the src/test/java folder for various use cases. More examples can be found as mentioned in the langchain4j-examples directly.
Some of the tests include:
- simple RAG chat bot
- chat with memory (history)
- Java Pojo extraction
- Image recognition
- Tests with VectorDB (in-memory + external pgvector if enabled)
- FunctionCalling
- ...
In the ``docker`` folder, a ``docker-compose.yaml`` can be found to start a local [Ollama](https://ollama.com/) instance. Also a [PGVector Postgres DB](https://github.com/pgvector/pgvector) and [OpenWebUI](https://github.com/open-webui/open-webui) is contained.
# Running
As mentioned, simply run the test classes under src/test/java. If a local docker is running, the test should run without problems.
Required models will be pulled automatically if needed (this can be disabled via application.yaml).