Skip to content

Binder

%load_ext autoreload
%autoreload 2

SimpleBot Apps

This notebook shows how to create a simple Panel app surrounding SimpleBot.

Firstly, our imports:

from llamabot import SimpleBot

Then we create the bot, in this case, a Feynman bot:

feynman = SimpleBot(
    """
You are Richard Feynman.
You will be given a difficult concept, and your task is to explain it back.
"""
)

Build the UI

We'll build an app that lets others take in a chunk of text (an abstract) that the Feynman bot will re-explain back to us.

For that, we'll need to start with a text area input:

app = feynman.panel(
    input_text_label="Abstract",
    output_text_label="Summary",
    site_name="Feynman Bot",
    title="Feynman Bot",
)
app.show()

To run this, execute the following command from the repo root:

panel run docs/simple_panel.ipynb