Skip to content

Commit

Permalink
add mesop
Browse files Browse the repository at this point in the history
  • Loading branch information
baniasbaabe committed Jun 16, 2024
1 parent 7107715 commit 6a390f8
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions book/cooltools/Chapter.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2159,6 +2159,54 @@
"md('<b>Yay</b> <a href=\"http://github.com\">GitHub</a>') \n",
"# Output: '**Yay** [GitHub](http://github.com)'"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Build Web Apps with `mesop`"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Google Devs published a new open-source Streamlit competitor.\n",
"\n",
"\n",
"\n",
"It's called `mesop` to build web apps in Python rapidly.\n",
"\n",
"\n",
"\n",
"It provides ready-to-use components or you can build your ones, without writing HTML/CSS/JS code."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!pip install mesop"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import mesop as me\n",
"import mesop.labs as mel\n",
"\n",
"@me.page(path=\"/chat\")\n",
"def chat():\n",
" mel.chat(transform)\n",
"\n",
"def transform(prompt: str, history: list[mel.ChatMessage]) -> str:\n",
" return \"Hello \" + prompt"
]
}
],
"metadata": {
Expand Down

0 comments on commit 6a390f8

Please sign in to comment.