Skip to content
Merged
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
19 changes: 19 additions & 0 deletions examples/spring-ai-example/.mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 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
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
20 changes: 20 additions & 0 deletions examples/spring-ai-example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Spring AI sample application

## Prerequisites

- Java 21+
- An Openlayer API key
- An OpenAI API key

## How to run

1. Set the environment variables.
```
export SPRING_AI_OPENAI_APIKEY="sk-proj-xxx"
export OTEL_EXPORTER_OTLP_ENDPOINT="https://api.openlayer.ai/v1/otel"
export OTEL_EXPORTER_OTLP_HEADERS=""Authorization=Bearer YOUR_OPENLAYER_API_KEY, x-bt-parent=pipeline_id:YOUR_OPENLAYER_PIPELINE_ID""
```
2. Run the application with `./mvnw clean install spring-boot:run`.
3. Call the chat endpoint with `curl localhost:8080/v1/chat`.

The trace will automatically be sent to Openlayer.
259 changes: 259 additions & 0 deletions examples/spring-ai-example/mvnw

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

Loading
Loading