Skip to content

Commit

Permalink
feat(scratch_notebooks): add notebook to demonstrate URL markdown issue
Browse files Browse the repository at this point in the history
- Added a new Jupyter notebook `url-markdown-issue.ipynb` in the `scratch_notebooks` directory. This notebook includes a demonstration of handling URLs within markdown strings using the Panel library.

refactor(scratch_notebooks): remove obsolete cache prototype notebook

- Removed the `cache.ipynb` notebook from the `scratch_notebooks` directory as it was deemed obsolete and no longer necessary for the project's current scope.
  • Loading branch information
ericmjl committed Mar 18, 2024
1 parent 6d88525 commit 846d2b2
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 262 deletions.
262 changes: 0 additions & 262 deletions scratch_notebooks/cache.ipynb

This file was deleted.

58 changes: 58 additions & 0 deletions scratch_notebooks/url-markdown-issue.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%load_ext autoreload\n",
"%autoreload 2"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import panel as pn\n",
"\n",
"\n",
"string = \"hey, this is a [URL](https://www.google.com). Can you see it?\"\n",
"\n",
"\n",
"async def generate_text(msg, user, instance):\n",
" m = \"\"\n",
" for s in string:\n",
" m += s\n",
" yield m\n",
"\n",
"\n",
"chat = pn.chat.ChatInterface(callback=generate_text, callback_exception=\"verbose\")\n",
"chat.servable()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "llamabot",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
}
},
"nbformat": 4,
"nbformat_minor": 2
}

0 comments on commit 846d2b2

Please sign in to comment.