aiq.front_ends.fastapi.fastapi_front_end_config#

Attributes#

Classes#

AIQEvaluateRequest

Request model for the evaluate endpoint.

AIQEvaluateResponse

Response model for the evaluate endpoint.

AIQEvaluateStatusResponse

Response model for the evaluate status endpoint.

FastApiFrontEndConfig

A FastAPI based front end that allows an AIQ Toolkit workflow to be served as a microservice.

Module Contents#

logger#
class AIQEvaluateRequest(/, **data: Any)#

Bases: pydantic.BaseModel

Request model for the evaluate endpoint.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

config_file: str = None#
job_id: str | None = None#
reps: int = None#
expiry_seconds: int = None#
class AIQEvaluateResponse(/, **data: Any)#

Bases: pydantic.BaseModel

Response model for the evaluate endpoint.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

job_id: str = None#
status: str = None#
class AIQEvaluateStatusResponse(/, **data: Any)#

Bases: pydantic.BaseModel

Response model for the evaluate status endpoint.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

job_id: str = None#
status: str = None#
config_file: str = None#
error: str | None = None#
output_path: str | None = None#
created_at: datetime.datetime = None#
updated_at: datetime.datetime = None#
expires_at: datetime.datetime | None = None#
class FastApiFrontEndConfig(/, **data: Any)#

Bases: aiq.data_models.front_end.FrontEndBaseConfig

A FastAPI based front end that allows an AIQ Toolkit workflow to be served as a microservice.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

class EndpointBase(/, **data: Any)#

Bases: pydantic.BaseModel

method: Literal['GET', 'POST', 'PUT', 'DELETE']#
description: str#
path: str | None = None#
websocket_path: str | None = None#
openai_api_path: str | None = None#
class Endpoint(/, **data: Any)#

Bases: EndpointBase

function_name: str = None#
class CrossOriginResourceSharing(/, **data: Any)#

Bases: pydantic.BaseModel

allow_origins: list[str] | None = None#
allow_origin_regex: str | None = None#
allow_methods: list[str] | None = None#
allow_headers: list[str] | None = None#
allow_credentials: bool | None = None#
expose_headers: list[str] | None = None#
max_age: int | None = None#
root_path: str = None#
host: str = None#
port: int = None#
reload: bool = None#
workers: int = None#
step_adaptor: aiq.data_models.step_adaptor.StepAdaptorConfig#
workflow: Annotated[FastApiFrontEndConfig.EndpointBase, Field(description='Endpoint for the default workflow.')]#
evaluate: Annotated[FastApiFrontEndConfig.EndpointBase, Field(description='Endpoint for evaluating workflows.')]#
endpoints: list[FastApiFrontEndConfig.Endpoint] = None#
cors: FastApiFrontEndConfig.CrossOriginResourceSharing = None#
use_gunicorn: bool = None#
runner_class: str | None = None#