graph LR
create_app["create_app"]
register_routes["register_routes"]
submit_scan_prompt["submit_scan_prompt"]
submit_scan_output["submit_scan_output"]
submit_analyze_prompt["submit_analyze_prompt"]
create_app -- "initiates" --> register_routes
register_routes -- "maps requests to" --> submit_scan_prompt
register_routes -- "maps requests to" --> submit_scan_output
register_routes -- "maps requests to" --> submit_analyze_prompt
The API Gateway subsystem serves as the primary external interface for the LLM Guard system, handling all incoming scan and analysis requests.
Initializes the FastAPI application, orchestrates the setup of scanners, and registers all API routes. It serves as the main entry point for the API.
Related Classes/Methods:
llm_guard_api.app.app.register_routes:162-495llm_guard_api.app.scanner._get_input_scanners_functionllm_guard_api.app.scanner._get_output_scanners_function
Defines and registers the various API endpoints (e.g., /scan/prompt, /scan/output, /analyze/prompt) with their respective handler functions. It also integrates authentication mechanisms.
Related Classes/Methods:
llm_guard_api.app.app.submit_scan_prompt:398-460llm_guard_api.app.app.submit_scan_output:265-333llm_guard_api.app.app.submit_analyze_prompt:335-396llm_guard_api.app.app._check_auth_function:91-123
Serves as the API endpoint handler for receiving and processing requests to scan user prompts. It delegates the actual scanning to the core scanner engine.
Related Classes/Methods:
Serves as the API endpoint handler for receiving and processing requests to scan LLM-generated outputs. It delegates the actual scanning to the core scanner engine.
Related Classes/Methods:
Serves as the API endpoint handler for requests related to prompt analysis.
Related Classes/Methods: