class langgraph_agent_toolkit.service.factory.ServiceRunner(custom_settings=None)[source][source]

Bases: object

A factory class to run the API service in different ways.

This class provides methods to run the service with different runners: - With Uvicorn - With Gunicorn - With Mangum (AWS Lambda) - With Azure Functions

Initialize the ServiceRunner.

Parameters:

custom_settings (Dict[str, Any] | None) – Optional dictionary of settings to override the default settings.

__init__(custom_settings=None)[source][source]

Initialize the ServiceRunner.

Parameters:

custom_settings (Dict[str, Any] | None) – Optional dictionary of settings to override the default settings.

run_uvicorn(**kwargs)[source][source]

Run the API service with uvicorn.

run_gunicorn(**kwargs)[source][source]

Run the API service with gunicorn.

Parameters:

**kwargs – Additional arguments to pass to gunicorn

run_aws_lambda(**kwargs)[source][source]

Prepare the API service for AWS Lambda.

run_azure_functions(**kwargs)[source][source]

Prepare the API service for Azure Functions.

run(runner_type=RunnerType.UVICORN, **kwargs)[source][source]

Run the API service with the specified runner type.

Parameters:
  • runner_type (RunnerType) – The type of runner to use.

  • **kwargs – Additional arguments to pass to the runner.