BIG NEWS π₯³π
Building Chatbots apps just got wayyy easier: announcing the new π²ππππΈππππππππ class π
The *fastest* way to build to build a Chatbot UI in Python -- including streaming, undo/retry, API, all out of the box!
Let's take a look at a few examples...
The π²ππππΈππππππππ only has 1 required parameter: a function that takes in:
- an input message (string)
- a history (list of list of strings)
and returns:
- a response (string)
Here's a toy example: (for the example above!)
The π²ππππΈππππππππ class works beautifully with @langchain classes
Here's a complete example querying GPT3.5 in 19 lines of code
To add streaming, just use a generator (π’ππππ) instead of a regular function (ππππππ)
Of course, you can customize it a lot more by adding examples, title/description, buttons (but you can get a fully-functioning chatbot without any of these!)
You also get a dedicated, easy-to-use API endpoint:
/ππππ
Out in the latest version of gradio:
πππ πππππππ --πππππππ ππππππ
Read more here: gradio.app/guides/creatinβ¦
Share this Scrolly Tale with your friends.
A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.