constants.py

Overview

The constants.py file serves as a centralized location within the InfiniFlow system for defining global constant values that are used throughout the application. These constants include configuration settings, limits on input parameters, API versioning, and standard string prefixes. By consolidating these values, the file ensures consistency, simplifies maintenance, and reduces the risk of magic numbers or strings scattered across the codebase.

This file contains only constant variable declarations and does not define any classes or functions. These constants primarily configure limits (such as name lengths), service identifiers, versioning, and timing parameters.


Detailed Explanation of Constants

NAME_LENGTH_LIMIT

IMG_BASE64_PREFIX

SERVICE_CONF

API_VERSION

RAG_FLOW_SERVICE_NAME

REQUEST_WAIT_SEC

REQUEST_MAX_WAIT_SEC

DATASET_NAME_LIMIT

FILE_NAME_LEN_LIMIT


Implementation Details


Interaction with Other System Components

By centralizing these constants, the file promotes maintainability and consistency across the InfiniFlow application.


Visual Diagram

flowchart TD
    A[constants.py] --> B[NAME_LENGTH_LIMIT]
    A --> C[IMG_BASE64_PREFIX]
    A --> D[SERVICE_CONF]
    A --> E[API_VERSION]
    A --> F[RAG_FLOW_SERVICE_NAME]
    A --> G[REQUEST_WAIT_SEC]
    A --> H[REQUEST_MAX_WAIT_SEC]
    A --> I[DATASET_NAME_LIMIT]
    A --> J[FILE_NAME_LEN_LIMIT]

    B --> K[Used for input validation]
    C --> L[Used for image data URLs]
    D --> M[Service config file reference]
    E --> N[API versioning in routes]
    F --> O[Service identification]
    G --> P[Request polling interval]
    H --> Q[Request timeout threshold]
    I --> R[Dataset name validation]
    J --> S[File name validation]

Summary

constants.py is a utility file containing important fixed values that govern naming rules, API versions, service names, request timings, and configuration file naming within the InfiniFlow system. It plays a foundational role in maintaining consistent behavior, improving code clarity, and facilitating configuration management across multiple modules.