Skip to content

Commit 4bf78dc

Browse files
s-sajid-aliclaude
andcommitted
Add cURL API interaction slide with mermaid flowchart
- Added new slide showing how to interact with LLM APIs using cURL - Includes mermaid sequence diagram showing API request flow - Features interactive v-switch between cURL example and response structure - Positioned after "Hands on" slide to bridge theory and practice Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
1 parent 7b380ba commit 4bf78dc

File tree

1 file changed

+84
-1
lines changed

1 file changed

+84
-1
lines changed

presentation/slides.md

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ LLMs generate output one token at a time[^ref1]
199199
---
200200
layout: side-title
201201
side: l
202-
color: violet
202+
color: violet-light
203203
titlewidth: is-4
204204
align: rm-lm
205205
---
@@ -215,6 +215,89 @@ align: rm-lm
215215
Head over to app.portkey.ai and choose the "Login with SSO" option with your [email protected] email address.
216216

217217

218+
---
219+
layout: top-title-two-cols
220+
columns: is-3-9
221+
color: violet-light
222+
---
223+
224+
:: title ::
225+
226+
# Interacting with LLM APIs using cURL
227+
228+
:: left ::
229+
230+
## API Request Flow
231+
232+
```mermaid {theme: 'dark', scale: 0.5}
233+
sequenceDiagram
234+
participant C as Client (cURL)
235+
participant API as LLM API Server
236+
participant M as Model
237+
238+
C->>API: POST /v1/chat/completions
239+
Note over C,API: Headers: Authorization, Content-Type
240+
Note over C,API: Body: messages, model, parameters
241+
242+
API->>API: Validate request
243+
API->>M: Process prompt
244+
M->>M: Generate response
245+
M->>API: Return completion
246+
API->>C: JSON response
247+
248+
Note over C: Response contains:<br/>- choices[]<br/>- usage stats<br/>- metadata
249+
```
250+
251+
:: right ::
252+
253+
<v-switch>
254+
255+
<template #1>
256+
257+
Example cURL Command
258+
259+
```bash {!children:text-xs}
260+
curl -X POST "https://api.openai.com/v1/chat/completions" \
261+
-H "Authorization: Bearer $OPENAI_API_KEY" \
262+
-H "Content-Type: application/json" \
263+
-d '{
264+
"model": "gpt-4",
265+
"messages": [
266+
{
267+
"role": "user",
268+
"content": "Explain quantum computing in simple terms"
269+
}
270+
],
271+
"max_tokens": 150,
272+
"temperature": 0.7
273+
}'
274+
```
275+
</template>
276+
277+
278+
<template #2>
279+
280+
Response Structure
281+
282+
```json {!children:text-xs}
283+
{
284+
"choices": [{
285+
"message": {
286+
"role": "assistant",
287+
"content": "Quantum computing uses quantum mechanics..."
288+
}
289+
}],
290+
"usage": {
291+
"prompt_tokens": 12,
292+
"completion_tokens": 150
293+
}
294+
}
295+
```
296+
</template>
297+
298+
</v-switch>
299+
300+
218301
---
219302
layout: side-title
220303
side: r

0 commit comments

Comments
 (0)