From 4852f5153af2eb483ef7d2cc3755af4937fd324a Mon Sep 17 00:00:00 2001 From: Kris Yang <145800990+krisyang1125@users.noreply.github.com> Date: Sat, 23 Sep 2023 16:46:39 -0700 Subject: [PATCH 1/2] Update query.query to request.query Change local variable naming of QueryRequest from query to request for less confusion. --- README.md | 4 ++-- src/fastapi_poe/samples/echo.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5ca62e5..fd2f9d4 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,8 @@ from fastapi_poe import PoeBot, run from fastapi_poe.types import PartialResponse class EchoBot(PoeBot): - async def get_response(self, query): - last_message = query.query[-1].content + async def get_response(self, request): + last_message = request.query[-1].content yield PartialResponse(text=last_message) if __name__ == "__main__": diff --git a/src/fastapi_poe/samples/echo.py b/src/fastapi_poe/samples/echo.py index bc0d432..65733b5 100644 --- a/src/fastapi_poe/samples/echo.py +++ b/src/fastapi_poe/samples/echo.py @@ -14,8 +14,8 @@ class EchoBot(PoeBot): - async def get_response(self, query: QueryRequest) -> AsyncIterable[PartialResponse]: - last_message = query.query[-1].content + async def get_response(self, request: QueryRequest) -> AsyncIterable[PartialResponse]: + last_message = request.query[-1].content yield PartialResponse(text=last_message) From dbc9191d48849a7f00edf82e230c5415a40f216a Mon Sep 17 00:00:00 2001 From: Kris Yang <145800990+krisyang1125@users.noreply.github.com> Date: Sat, 23 Sep 2023 19:06:14 -0700 Subject: [PATCH 2/2] Update query.query to request.query Update local variable with black formatting --- src/fastapi_poe/samples/echo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fastapi_poe/samples/echo.py b/src/fastapi_poe/samples/echo.py index 65733b5..e9ca7d9 100644 --- a/src/fastapi_poe/samples/echo.py +++ b/src/fastapi_poe/samples/echo.py @@ -14,7 +14,9 @@ class EchoBot(PoeBot): - async def get_response(self, request: QueryRequest) -> AsyncIterable[PartialResponse]: + async def get_response( + self, request: QueryRequest + ) -> AsyncIterable[PartialResponse]: last_message = request.query[-1].content yield PartialResponse(text=last_message)