Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeantessier/langchain-java-example
An example of using LangChain in Java with LangChain4j
https://github.com/jeantessier/langchain-java-example
Last synced: 25 days ago
JSON representation
An example of using LangChain in Java with LangChain4j
- Host: GitHub
- URL: https://github.com/jeantessier/langchain-java-example
- Owner: jeantessier
- Created: 2024-12-13T21:33:49.000Z (26 days ago)
- Default Branch: main
- Last Pushed: 2024-12-13T21:59:01.000Z (26 days ago)
- Last Synced: 2024-12-13T22:28:05.999Z (26 days ago)
- Language: Java
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Gemini Test
Sample application that uses LangChain4J to interface with OpenAI's ChatGPT LLM.
Based on https://github.com/langchain4j/langchain4j-examples/blob/main/other-examples/src/main/java/HelloWorldExample.java
## To Compile
```bash
./gradlew assemble
```## To Run
You’ll need an API key. So just follow the instructions to obtain your OpenAI
API key.- [OpenAI ChatGPT](https://platform.openai.com/api-keys)
- [Anthropic Claude](https://console.anthropic.com/settings/keys)
- [Google Gemini](https://aistudio.google.com/app/apikey)Save it to the `app/src/main/resources/.env` file as the corresponding
`..._API_KEY` environment variable. You can use
`app/src/main/resources/.env.template` as a guide to structure your `.env`
file.To run against OpenAI's ChatGPT:
```bash
./gradlew run --args="--model openai"
```To run against Anthropic's Claude:
```bash
./gradlew run --args="--model anthropic"
```To run against Google's Gemini:
```bash
./gradlew run --args="--model google"
```## To Test
```bash
./gradlew check
```