Merge pull request #277 from zboyles/patch-1

Update main.py
This commit is contained in:
James Briggs
2023-10-09 15:16:30 +02:00
committed by GitHub

View File

@@ -45,6 +45,9 @@ agent = initialize_agent(
class AsyncCallbackHandler(AsyncIteratorCallbackHandler):
content: str = ""
final_answer: bool = False
def __init__(self) -> None:
super().__init__()
async def on_llm_new_token(self, token: str, **kwargs: Any) -> None:
self.content += token
@@ -101,4 +104,4 @@ if __name__ == "__main__":
host="localhost",
port=8000,
reload=True
)
)