BibTexResponse

Bases: BaseModel

This class represents a response in BibTeX format.

Source code in llm_utils/aiweb_common/fastapi/schemas.py
34
35
36
37
38
39
class BibTexResponse(BaseModel):
    """This class represents a response in BibTeX format."""

    encoded_docx: str = Field(
        ..., description="Base64-encoded BIB file. Decode to obtain the BIB file."
    )

JSONResponse

Bases: BaseModel

This class represents a response containing JSON data in a base64-encoded string. Decode this string to obtain the original JSON content.

Source code in llm_utils/aiweb_common/fastapi/schemas.py
50
51
52
53
54
55
56
57
58
class JSONResponse(BaseModel):
    """
    This class represents a response containing JSON data in a base64-encoded string.
    Decode this string to obtain the original JSON content.
    """

    encoded_json: str = Field(
        ..., description="Base64-encoded JSON data. Decode to obtain the JSON file."
    )

MSExcelResponse

Bases: BaseModel

This class likely represents a response from an API that interacts with Microsoft Excel files.

Source code in llm_utils/aiweb_common/fastapi/schemas.py
42
43
44
45
46
47
class MSExcelResponse(BaseModel):
    """This class likely represents a response from an API that interacts with Microsoft Excel files."""

    encoded_xlsx: str = Field(
        ..., description="Base64-encoded XLSX file. Decode to obtain the XLSX file."
    )

MSWordResponse

Bases: BaseModel

This class likely represents a response from a Microsoft Word document.

Source code in llm_utils/aiweb_common/fastapi/schemas.py
26
27
28
29
30
31
class MSWordResponse(BaseModel):
    """This class likely represents a response from a Microsoft Word document."""

    encoded_docx: str = Field(
        ..., description="Base64-encoded DOCX file. Decode to obtain the DOCX file."
    )

SearchRequest

Bases: BaseModel

This class represents a search request in Python.

Source code in llm_utils/aiweb_common/fastapi/schemas.py
20
21
22
23
class SearchRequest(BaseModel):
    """This class represents a search request in Python."""

    research_question: str

UploadableFiles

Bases: str, Enum

The class UploadableFiles is a subclass of str and Enum in Python.

Source code in llm_utils/aiweb_common/fastapi/schemas.py
 8
 9
10
11
12
class UploadableFiles(str, Enum):
    """The class `UploadableFiles` is a subclass of `str` and `Enum` in Python."""

    DOCX = ".docx"
    XLSX = ".xlsx"

XLSXinRequest

Bases: BaseModel

This class likely represents a request object for handling XLSX file data in a Python application.

Source code in llm_utils/aiweb_common/fastapi/schemas.py
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
class XLSXinRequest(BaseModel):
    """This class likely represents a request object for handling XLSX file data in a Python application."""

    xlsx_encoded: str = Field(..., description="Base64-encoded XLSX file content.")

    @field_validator("xlsx_encoded")
    @classmethod
    def check_mime_type(cls, v, values, **kwargs):
        """
        The function `check_mime_type` validates XLSX file bytes.

        Args:
          cls: In the provided code snippet, the `cls` parameter is typically used to refer to the class
        itself within a class method. It is a common convention in Python to use `cls` as the first
        parameter in class methods to represent the class object.
          v: The `v` parameter in the `check_mime_type` function likely represents the value that needs
        to be validated or checked for its MIME type. It is passed as an argument to the function when
        it is called.
          values: The `values` parameter typically refers to a dictionary containing all the values
        being passed to the function or method. In this context, it is likely used to pass additional
        information or context to the `check_mime_type` function.

        Returns:
          The `check_mime_type` function is returning the result of calling the `validate_xlsx_bytes`
        function with the arguments `cls`, `v`, and `values`.
        """
        return validate_xlsx_bytes(cls, v, values)

check_mime_type(v, values, **kwargs) classmethod

The function check_mime_type validates XLSX file bytes.

Parameters:
  • cls

    In the provided code snippet, the cls parameter is typically used to refer to the class

itself within a class method. It is a common convention in Python to use cls as the first parameter in class methods to represent the class object. v: The v parameter in the check_mime_type function likely represents the value that needs to be validated or checked for its MIME type. It is passed as an argument to the function when it is called. values: The values parameter typically refers to a dictionary containing all the values being passed to the function or method. In this context, it is likely used to pass additional information or context to the check_mime_type function.

Returns:
  • The check_mime_type function is returning the result of calling the validate_xlsx_bytes

function with the arguments cls, v, and values.

Source code in llm_utils/aiweb_common/fastapi/schemas.py
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@field_validator("xlsx_encoded")
@classmethod
def check_mime_type(cls, v, values, **kwargs):
    """
    The function `check_mime_type` validates XLSX file bytes.

    Args:
      cls: In the provided code snippet, the `cls` parameter is typically used to refer to the class
    itself within a class method. It is a common convention in Python to use `cls` as the first
    parameter in class methods to represent the class object.
      v: The `v` parameter in the `check_mime_type` function likely represents the value that needs
    to be validated or checked for its MIME type. It is passed as an argument to the function when
    it is called.
      values: The `values` parameter typically refers to a dictionary containing all the values
    being passed to the function or method. In this context, it is likely used to pass additional
    information or context to the `check_mime_type` function.

    Returns:
      The `check_mime_type` function is returning the result of calling the `validate_xlsx_bytes`
    function with the arguments `cls`, `v`, and `values`.
    """
    return validate_xlsx_bytes(cls, v, values)