3.1 Http Trigger
Introduction
In this chapter, we will start to focus on how to use AWEL to develop a network program. First, we will create a simple HTTP trigger that receives a request and returns a response.
HttpTrigger is a special InputOperator.
Installation
We have already created a project named awel-tutorial in the
previous chapter
and added the dbgpt dependency.
To use the HttpTrigger operator, we need to install the fastapi and uvicorn packages.
poetry add fastapi uvicorn
The output should look like this:
➜ awel-tutorial poetry add fastapi uvicorn
Using version ^0.110.0 for fastapi
Using version ^0.27.1 for uvicorn
Updating dependencies
Resolving dependencies... (2.7s)
Package operations: 7 installs, 0 updates, 0 removals
• Installing sniffio (1.3.1)
• Installing anyio (4.3.0)
• Installing click (8.1.7)
• Installing h11 (0.14.0)
• Installing starlette (0.36.3)
• Installing fastapi (0.110.0)
• Installing uvicorn (0.27.1)
Writing lock file