-
Notifications
You must be signed in to change notification settings - Fork 97
Expand file tree
/
Copy pathworkshop.http
More file actions
274 lines (187 loc) · 8.52 KB
/
workshop.http
File metadata and controls
274 lines (187 loc) · 8.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
### Spring AI Workshop - HTTP Request Examples
# ============================================================================
# 1. BASIC CHAT EXAMPLES
# ============================================================================
### Simple Chat - Java Fact
# SimpleChatController - Returns an interesting fact about Java
GET http://localhost:8080/java
###
### Basic Chat - Default Dad Joke
# ChatController - Basic chat with default dad joke about dogs
GET http://localhost:8080/?message=Tell me a dad joke about Dogs
###
### Basic Chat - Custom Message
# ChatController - Basic chat with custom message
GET http://localhost:8080/?message=What is the capital of France?
###
### Chat - Jokes by Topic
# ChatController - Generate a joke about a specific topic
GET http://localhost:8080/jokes-by-topic?topic=programming
###
### Chat - Jokes by Topic (Cats)
# ChatController - Generate a joke about cats
GET http://localhost:8080/jokes-by-topic?topic=cats
###
### Chat - With Full Response Object
# ChatController - Returns full ChatResponse object with metadata
GET http://localhost:8080/jokes-with-response?message=Tell me a dad joke about computers
###
# ============================================================================
# 2. ASYNC & STREAMING EXAMPLES
# ============================================================================
### Async Streaming Chat
# AsyncChatController - Streams response about Charleston SC attractions
GET http://localhost:8080/stream
Accept: text/event-stream
###
# ============================================================================
# 3. PROMPT ENGINEERING & SYSTEM INSTRUCTIONS
# ============================================================================
### Article Generator - Default Topic
# ArticleController - Generate 500-word blog post about JDK Virtual Threads
GET http://localhost:8080/posts/new
###
### Article Generator - Custom Topic
# ArticleController - Generate 500-word blog post about Spring AI
GET http://localhost:8080/posts/new?topic=Spring AI Framework
###
### Article Generator - Java Topic
# ArticleController - Generate blog post about modern Java features
GET http://localhost:8080/posts/new?topic=Java Records and Pattern Matching
###
# ============================================================================
# 4. OUTPUT STRUCTURES & STRUCTURED RESPONSES
# ============================================================================
### Vacation Plan - Unstructured
# VacationPlan - Returns unstructured text vacation plan for Montreal
GET http://localhost:8080/vacation/unstructured
###
### Vacation Plan - Structured (Default)
# VacationPlan - Returns structured JSON itinerary for Cleveland, OH
GET http://localhost:8080/vacation/structured
###
### Vacation Plan - Structured (Paris)
# VacationPlan - Returns structured JSON itinerary for Paris
GET http://localhost:8080/vacation/structured?destination=Paris, France
###
### Vacation Plan - Structured (Tokyo)
# VacationPlan - Returns structured JSON itinerary for Tokyo
GET http://localhost:8080/vacation/structured?destination=Tokyo, Japan
###
# ============================================================================
# 5. MEMORY & STATEFUL CONVERSATIONS
# ============================================================================
### Stateful Chat - First Message
# StatefulController - Start conversation with name introduction
GET http://localhost:8080/memory?message=My name is John and I like programming
###
### Stateful Chat - Follow-up
# StatefulController - Follow-up question (remembers context from previous message)
GET http://localhost:8080/memory?message=What is my name?
###
### Stateful Chat - Another Follow-up
# StatefulController - Another follow-up (tests memory persistence)
GET http://localhost:8080/memory?message=What did I say I like?
###
# ============================================================================
# 6. TOOLS & FUNCTION CALLING
# ============================================================================
### DateTime Tools - Tomorrow's Date
# DatTimeChatController - Asks "What day is tomorrow?" using datetime tools
GET http://localhost:8080/tools
###
### Weather Alerts - California
# WeatherController - Get weather alerts for California
GET http://localhost:8080/weather/alerts?message=What are the weather alerts for California?
###
### Weather Alerts - New York
# WeatherController - Get weather alerts for New York state
GET http://localhost:8080/weather/alerts?message=Are there any weather alerts in NY?
###
### Weather Alerts - Specific Location
# WeatherController - Get weather forecast for specific location
GET http://localhost:8080/weather/alerts?message=What's the weather forecast for Cleveland?
###
### Task Management - Create Task
# TaskManagementController - Create a new task
GET http://localhost:8080/tasks?message=Create a task titled "Write documentation" assigned to Alice
###
### Task Management - Update Status
# TaskManagementController - Update task status
GET http://localhost:8080/tasks?message=Update task 1 status to IN_PROGRESS
###
### Task Management - Reassign Task
# TaskManagementController - Reassign task to different person
GET http://localhost:8080/tasks?message=Assign task 1 to Bob
###
### Task Management - Complete Task
# TaskManagementController - Mark task as completed
GET http://localhost:8080/tasks?message=Mark task 1 as completed
###
# ============================================================================
# 7. SAFEGUARDS & GUARDRAILS
# ============================================================================
### Input Validation Guard - Default (Banking)
# InputValidationGuardController - Valid banking question
GET http://localhost:8080/input-validation?message=What is the capital of the state of California?
###
### Input Validation Guard - Valid Banking Question
# InputValidationGuardController - Question within scope (banking)
GET http://localhost:8080/input-validation?message=How do I open a savings account?
###
### Input Validation Guard - Out of Scope
# InputValidationGuardController - Question outside banking scope (should refuse)
GET http://localhost:8080/input-validation?message=What is the weather today?
###
### Fact Checking Guard
# FactCheckingGuardController - Demonstrates guardrails against hallucination
GET http://localhost:8080/fact-checking
###
# ============================================================================
# 8. ADVISORS & CROSS-CUTTING CONCERNS
# ============================================================================
### Logging Advisor Example
# LoggingController - Demonstrates custom advisor for logging
GET http://localhost:8080/advisor
###
# ============================================================================
# 9. MODEL CONFIGURATION & OPTIONS
# ============================================================================
### Chat Options Configuration
# OptionsController - Demonstrates custom model options (temperature, max tokens)
GET http://localhost:8080/options
###
# ============================================================================
# 10. RAG (RETRIEVAL-AUGMENTED GENERATION)
# ============================================================================
### RAG - Query Models (Default)
# ModelsController - Query vectorstore for OpenAI models with context windows
GET http://localhost:8080/rag/models
###
### RAG - Query Models (Custom)
# ModelsController - Custom query about AI models
GET http://localhost:8080/rag/models?message=Which models have the largest context window?
###
### RAG - Query Models (Anthropic)
# ModelsController - Query about specific company's models
GET http://localhost:8080/rag/models?message=Tell me about Anthropic's models
###
### RAG - Query Models (Comparison)
# ModelsController - Compare different models
GET http://localhost:8080/rag/models?message=Compare the context windows of GPT-4 and Claude models
###
# ============================================================================
# 11. MULTIMODAL - AUDIO GENERATION (TEXT-TO-SPEECH)
# ============================================================================
### Audio Generation - Default Text
# AudioGeneration - Generate speech audio from default text
GET http://localhost:8080/speak
###
### Audio Generation - Custom Text
# AudioGeneration - Generate speech audio from custom text
GET http://localhost:8080/speak?text=Hello from Spring AI! Text to speech is amazing.
###
### Audio Generation - Java Message
# AudioGeneration - Generate speech about Java development
GET http://localhost:8080/speak?text=Spring Framework makes building enterprise Java applications easy and enjoyable.
###