Add getting-started module: ChatClient fluent API, system/user prompts, streaming, and provider switching via spring.ai.model.chat
This commit is contained in:
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
# Regenerates every reproducible file under output/. Run from the module root
|
||||
# (spring-ai/getting-started). Needs Maven with the dependencies already resolved once online.
|
||||
#
|
||||
# output/05-*.txt is NOT regenerated here -- it needs a live network path to api.openai.com and a
|
||||
# running instance of the app started separately. See its own header for the exact commands.
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
mvn -q -o test
|
||||
echo
|
||||
echo "Regenerated output/01-plain-call.txt, 02-system-template.txt, 03-streaming.txt, 04-provider-switch.txt"
|
||||
echo "output/05-real-network-round-trip.txt was captured manually -- see its header."
|
||||
Executable
+19
@@ -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
|
||||
Reference in New Issue
Block a user