holoviz-topics / panel-chat-examples

Examples of Chat Bots using Panels chat features: Traditional, LLMs, AI Agents, LangChain, OpenAI etc
https://holoviz-topics.github.io/panel-chat-examples/
MIT License
107 stars 34 forks source link

Make examples async #39

Closed MarcSkovMadsen closed 1 year ago

MarcSkovMadsen commented 1 year ago

Its best practice to use async functions and methods for chat interfaces. This would also help us when we deploy them.

I can see some examples use sync sleep or openai methods. One example is echo_stream.py. We should convert them to async examples.

ahuang11 commented 1 year ago

I'm hesitant about converting all the examples to asynchronous code since it's not required to use ChatInterface, and some individuals, myself included a few years back, may not be familiar with async programming and might lose interest or become perplexed when encountering async code.

I'd be happy to add echo_stream_async.py as an example though.

MarcSkovMadsen commented 1 year ago

Ok. Thats is a good idea.