feat: add streaming support for OpenSource App (#217)

This commit is contained in:
aaishikdutta
2023-07-11 01:38:22 +05:30
committed by GitHub
parent 65414af098
commit ae87dc4a6d
2 changed files with 3 additions and 2 deletions

View File

@@ -224,7 +224,7 @@ print(naval_chat_bot.chat("what did the author say about happiness?"))
### Stream Response
- You can add config to your query method to stream responses like ChatGPT does. You would require a downstream handler to render the chunk in your desirable format. Currently only supports OpenAI model.
- You can add config to your query method to stream responses like ChatGPT does. You would require a downstream handler to render the chunk in your desirable format. Supports both OpenAI model and OpenSourceApp.
- To use this, instantiate a `QueryConfig` or `ChatConfig` object with `stream=True`. Then pass it to the `.chat()` or `.query()` method. The following example iterates through the chunks and prints them as they appear.