Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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
#
# http://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.
wrapperVersion=3.3.2
wrapperVersion=3.3.4
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.15/apache-maven-3.9.15-bin.zip
24 changes: 15 additions & 9 deletions applications/quarkus-langchain4j-demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,27 @@
## Prerequisites

- Java 21+
- Langfuse stack ([Cloud](https://cloud.langfuse.com/) or [Self-Hosted](https://langfuse.com/docs/deployment/self-host))
- Langfuse API Keys
- An OpenAI Api Key

## How to run

1. Configure environment variables to connect Spring AI demo app with Langfuse.
1. Configure environment variables.

```
export QUARKUS_LANGCHAIN4J_OPENAI_API_KEY=sk-xxx-...
export QUARKUS_OTEL_EXPORTER_OTLP_ENDPOINT="https://cloud.langfuse.com/api/public/otel" # 🇪🇺 EU data region
# export QUARKUS_OTEL_EXPORTER_OTLP_ENDPOINT="https://us.cloud.langfuse.com/api/public/otel" # 🇺🇸 US data region
# export QUARKUS_OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:3000/api/public/otel" # 🏠 Local deployment (>= v3.22.0)
export QUARKUS_OTEL_EXPORTER_OTLP_HEADERS="Authorization=Basic $(echo -n "pk-lf-xxx:sk-lf-xxx" | base64)"
export OPENAI_API_KEY=sk-xxx-...
```
2. Run the sample application via `./mvnw quarkus:dev`.
3. Observe the new trace in the Langfuse web UI.
3. You should see something in the logs like this, indicating the URL/credentials of Langfuse:

```
Dev Services for Langfuse started.
Other applications in dev mode will find it automatically.
For Quarkus applications in production mode, you can connect to this instance by starting you application with -Dquarkus.langfuse.base-url=http://localhost:42971.
Log in with:
Email: quarkus@quarkus.io
Password: quarkuslangfuse
```

4. Observe the new trace in the Langfuse web UI (indicated at the URL in the above message).

![sample-trace](./screenshots/quarkus-langchain4j-demo-trace.png)
50 changes: 43 additions & 7 deletions applications/quarkus-langchain4j-demo/mvnw

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 48 additions & 8 deletions applications/quarkus-langchain4j-demo/mvnw.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading