Add getting-started module: ChatClient fluent API, system/user prompts, streaming, and provider switching via spring.ai.model.chat

This commit is contained in:
2026-09-23 04:20:52 +00:00
committed by Claude
parent 1d4625a1c2
commit c1fc41e0de
22 changed files with 697 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
# Starts the application, killing any previous instance first.
#
# Usage:
# OPENAI_API_KEY=sk-... ./scripts/run.sh
# CHAT_PROVIDER=ollama OLLAMA_BASE_URL=http://localhost:11434 ./scripts/run.sh
#
# Then, in another shell:
# curl 'http://localhost:8080/api/chat?message=What+is+a+ChatClient?'
# curl 'http://localhost:8080/api/chat/as?voice=pirate&message=Where+is+my+jar+cached'
# curl -N 'http://localhost:8080/api/chat/stream?message=Stream+this'
set -eu
cd "$(dirname "$0")/.."
for p in $(ps -eo pid,cmd | grep '[G]ettingStartedApplication' | awk '{print $1}'); do
kill -9 "$p"
done
mvn -q -o org.springframework.boot:spring-boot-maven-plugin:run