Skip to content

Commit 41369df

Browse files
committed
🎨 Reformat apicall and chatbot notebooks with black
1 parent 515b1cb commit 41369df

File tree

2 files changed

+21
-27
lines changed

2 files changed

+21
-27
lines changed

docs/vuegen_apicall_case_study.ipynb

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,11 @@
155155
"source": [
156156
"def save_yaml_config(config, path):\n",
157157
" def multiline_str_handler(dumper, data):\n",
158-
" if '\\n' in data:\n",
159-
" return dumper.represent_scalar('tag:yaml.org,2002:str', data.strip() + '\\n', style='|')\n",
160-
" return dumper.represent_scalar('tag:yaml.org,2002:str', data)\n",
158+
" if \"\\n\" in data:\n",
159+
" return dumper.represent_scalar(\n",
160+
" \"tag:yaml.org,2002:str\", data.strip() + \"\\n\", style=\"|\"\n",
161+
" )\n",
162+
" return dumper.represent_scalar(\"tag:yaml.org,2002:str\", data)\n",
161163
"\n",
162164
" yaml.add_representer(str, multiline_str_handler)\n",
163165
"\n",
@@ -195,14 +197,9 @@
195197
" \"sections\": [\n",
196198
" {\n",
197199
" \"title\": \"API Examples\",\n",
198-
" \"subsections\": [\n",
199-
" {\n",
200-
" \"title\": \"Basic HTTP Methods\",\n",
201-
" \"components\": []\n",
202-
" }\n",
203-
" ]\n",
200+
" \"subsections\": [{\"title\": \"Basic HTTP Methods\", \"components\": []}],\n",
204201
" }\n",
205-
" ]\n",
202+
" ],\n",
206203
"}"
207204
]
208205
},
@@ -235,7 +232,7 @@
235232
" \"title\": \"GET request\",\n",
236233
" \"component_type\": \"apicall\",\n",
237234
" \"api_url\": \"https://jsonplaceholder.typicode.com/todos/1\",\n",
238-
" \"method\": \"GET\"\n",
235+
" \"method\": \"GET\",\n",
239236
"}\n",
240237
"\n",
241238
"config[\"sections\"][0][\"subsections\"][0][\"components\"].append(get_component)\n",
@@ -272,11 +269,11 @@
272269
" \"component_type\": \"apicall\",\n",
273270
" \"api_url\": \"https://jsonplaceholder.typicode.com/todos\",\n",
274271
" \"method\": \"POST\",\n",
275-
" \"request_body\": '''{\n",
272+
" \"request_body\": \"\"\"{\n",
276273
" \"userId\": 1,\n",
277274
" \"title\": \"Go running\",\n",
278275
" \"completed\": false\n",
279-
"}'''\n",
276+
"}\"\"\",\n",
280277
"}\n",
281278
"\n",
282279
"config[\"sections\"][0][\"subsections\"][0][\"components\"].append(post_component)\n",
@@ -319,7 +316,7 @@
319316
" \"title\": \"Play the guitar\",\n",
320317
" \"completed\": true\n",
321318
"}\n",
322-
"\"\"\"\n",
319+
"\"\"\",\n",
323320
"}\n",
324321
"\n",
325322
"config[\"sections\"][0][\"subsections\"][0][\"components\"].append(put_component)\n",
@@ -361,7 +358,7 @@
361358
"{\n",
362359
" \"title\": \"Go for a hike\"\n",
363360
"}\n",
364-
"\"\"\"\n",
361+
"\"\"\",\n",
365362
"}\n",
366363
"\n",
367364
"config[\"sections\"][0][\"subsections\"][0][\"components\"].append(patch_component)\n",
@@ -397,7 +394,7 @@
397394
" \"title\": \"DELETE request\",\n",
398395
" \"component_type\": \"apicall\",\n",
399396
" \"api_url\": \"https://jsonplaceholder.typicode.com/todos/10\",\n",
400-
" \"method\": \"DELETE\"\n",
397+
" \"method\": \"DELETE\",\n",
401398
"}\n",
402399
"\n",
403400
"config[\"sections\"][0][\"subsections\"][0][\"components\"].append(delete_component)\n",
@@ -419,7 +416,7 @@
419416
"metadata": {},
420417
"outputs": [],
421418
"source": [
422-
"# Save the report config file \n",
419+
"# Save the report config file\n",
423420
"config_path = \"apicall_config.yaml\"\n",
424421
"save_yaml_config(config, config_path)"
425422
]
@@ -514,7 +511,7 @@
514511
],
515512
"source": [
516513
"# run_streamlit = False\n",
517-
"run_streamlit = True # uncomment line to run the streamlit report\n",
514+
"run_streamlit = True # uncomment line to run the streamlit report\n",
518515
"# Launch the Streamlit report depneding on the platform\n",
519516
"if not IN_COLAB and run_streamlit:\n",
520517
" !streamlit run streamlit_report/sections/report_manager.py\n",

docs/vuegen_chatbot_case_study.ipynb

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,10 @@
216216
" {\n",
217217
" \"title\": \"Chatbot Example\",\n",
218218
" \"subsections\": [\n",
219-
" {\n",
220-
" \"title\": \"Ollama-style streaming chatbot\",\n",
221-
" \"components\": []\n",
222-
" }\n",
223-
" ]\n",
219+
" {\"title\": \"Ollama-style streaming chatbot\", \"components\": []}\n",
220+
" ],\n",
224221
" }\n",
225-
" ]\n",
222+
" ],\n",
226223
"}"
227224
]
228225
},
@@ -245,7 +242,7 @@
245242
" \"title\": \"ChatBot Component\",\n",
246243
" \"component_type\": \"chatbot\",\n",
247244
" \"api_url\": \"http://localhost:11434/api/chat\",\n",
248-
" \"model\": \"llama3.2\"\n",
245+
" \"model\": \"llama3.2\",\n",
249246
"}\n",
250247
"\n",
251248
"config[\"sections\"][0][\"subsections\"][0][\"components\"].append(chatbot_component)\n",
@@ -267,7 +264,7 @@
267264
"metadata": {},
268265
"outputs": [],
269266
"source": [
270-
"# Save the report config file \n",
267+
"# Save the report config file\n",
271268
"config_path = \"chatbot_config.yaml\"\n",
272269
"save_yaml_config(config, config_path)"
273270
]
@@ -362,7 +359,7 @@
362359
],
363360
"source": [
364361
"# run_streamlit = False\n",
365-
"run_streamlit = True # uncomment line to run the streamlit report\n",
362+
"run_streamlit = True # uncomment line to run the streamlit report\n",
366363
"# Launch the Streamlit report depneding on the platform\n",
367364
"if not IN_COLAB and run_streamlit:\n",
368365
" !streamlit run streamlit_report/sections/report_manager.py\n",

0 commit comments

Comments
 (0)