Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Demetrous-fd committed Feb 10, 2024
1 parent 93d8d9c commit ea90b11
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,25 @@ from aiohttp import web

async def handler(request):
body = await request.json()
alice_request = AliceRequest.model_validate_json(body)
alice_request = AliceRequest.model_validate(body)

reply = AliceResponse()

if alice_request.is_new_session():
reply.response.text = "Привет, скажи что-нибудь и я это повторю"
return reply

reply.response.text = alice_request.request.original_utterance
else:
reply.response.text = alice_request.request.original_utterance

body = reply.model_dump()
return web.json_response(body)


app = web.Application()
app.router.add_post('/', handler)

if __name__ == "__main__":
web.run_app(app)

```

</details>
Expand Down

0 comments on commit ea90b11

Please sign in to comment.