Update main.py

Fix issue with `AgentExecutor` not shutting down and/or starting.
This commit is contained in:
Zac
2023-10-02 09:16:35 -04:00
committed by GitHub
parent 519cea259b
commit 67e83572df

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
)
)