Create and run a FastAPI server with search endpoints.
Parameters
Name
Type
Description
Default
vector_stores
list[VectorStore]
A list of VectorStore objects, each responsible for handling embedding and search operations for a specific endpoint.
required
endpoint_names
list[str]
Endpoint names corresponding to the VectorStore instances to expose.
required
port
int
The port on which the API server runs. Defaults to 8000.
8000
host_ip
str
The IP address on which the API server listens. Defaults to “127.0.0.1”. Note that “127.0.0.1” only accepts connections from the local machine. Use “0.0.0.0” to allow external connections.
'127.0.0.1'
log_level
str
The logging level for the Uvicorn server. Supported values are “critical”, “error”, “warning”, “info”, and “debug”.
'warning'
demo_mode
bool
Whether to display demo server information in the OpenAPI documentation.
False
Raises
Name
Type
Description
DataValidationError
If the input parameters are invalid, for example if the port value is out of bounds.