Pipe Interface
Rest API
This documentation provides an overview of the code used to implement a RESTful API server for the pipeline using
the SuperagentX library and FastAPI. The server processes incoming requests, authenticates users via API tokens,
and handles search queries related to the trip planner.
The lifespan function initializes the trip planner pipeline when the FastAPI application starts and clears
it when the app shuts down. The pipes dictionary is used to store the pipeline for later use in request handling.
A custom dependency function, verify_api_token, checks the validity of the API token passed in the api-token header.
If the token is invalid, the function raises an HTTP 401 Unauthorized error.
The main API application (ecom_app) is created using FastAPI. The /search endpoint processes search queries
related to the trip planner. The verify_api_token function is included as a dependency to authenticate requests before processing them.
This RESTful API provides a simple yet powerful interface for interacting with the trip planner pipeline, ensuring
secure access via API token validation.

