types - Infernet Client
Description: Infernet Client Documentation

Skip to content

# Module: `types`

## `ChainInfo`

Bases: `TypedDict`

Chain information for the node.

Attributes:

Name | Type | Description
--- | --- | ---
`address` | `str` | The address of the chain.
`enabled` | `bool` | Whether the chain is enabled.

Source code in `src/infernet_client/types.py`

    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    class ChainInfo(TypedDict):
        """Chain information for the node.

        Attributes:
            address: The address of the chain.
            enabled: Whether the chain is enabled.
        """

        address: str
        enabled: bool

## `Container`

Bases: `TypedDict`

Container information.

Attributes:

Name | Type | Description
--- | --- | ---
`id` | `str` | The container ID.
`description` | `str` | The description of the container.
`external` | `bool` | Whether the container is external.
`image` | `str` | The image of the container.

Source code in `src/infernet_client/types.py`

    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    class Container(TypedDict):
        """Container information.

        Attributes:
            id: The container ID.
            description: The description of the container.
            external: Whether the container is external.
            image: The image of the container.
        """

        id: str
        description: str
        external: bool
        image: str

## `ContainerError`

Bases: `TypedDict`

Container error.

Attributes:

Name | Type | Description
--- | --- | ---
`container` | `str` | The container name.
`error` | `str` | The error message.

Source code in `src/infernet_client/types.py`

    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    class ContainerError(TypedDict):
        """Container error.

        Attributes:
            container: The container name.
            error: The error message.
        """

        container: str
        error: str

## `ContainerOutput`

Bases: `TypedDict`

Container output.

Attributes:

Name | Type | Description
--- | --- | ---
`container` | `str` | The container name.
`output` | `Any` | The output of the container.

Source code in `src/infernet_client/types.py`

    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    class ContainerOutput(TypedDict):
        """Container output.

        Attributes:
            container: The container name.
            output: The output of the container.
        """

        container: str
        output: Any

## `ErrorResponse`

Bases: `TypedDict`

Error response.

Attributes:

    error: The error message.
    params: The parameters of the error.

Source code in `src/infernet_client/types.py`

    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    class ErrorResponse(TypedDict):
        """Error response.

        Attributes:

            error: The error message.
            params: The parameters of the error.
        """

        error: str
        params: NotRequired[dict[str, Any]]

## `HealthInfo`

Bases: `TypedDict`

Health information for the server.

Attributes:

Name | Type | Description
--- | --- | ---
`status` | `Literal['healthy', 'unhealthy']` | The health status of the server.

Source code in `src/infernet_client/types.py`

     6
     7
     8
     9
    10
    11
    12
    13
    class HealthInfo(TypedDict):
        """Health information for the server.

        Attributes:
            status: The health status of the server.
        """

        status: Literal["healthy", "unhealthy"]

## `JobRequest`

Bases: `TypedDict`

Job request.

Attributes:

Name | Type | Description
--- | --- | ---
`containers` | `list[str]` | The list of container names.
`data` | `dict[str, Any]` | The data to pass to the containers.
`requires_proof` | `NotRequired[Optional[bool]]` | Whether the job requires proof.

Source code in `src/infernet_client/types.py`

     99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    class JobRequest(TypedDict):
        """Job request.

        Attributes:
            containers: The list of container names.
            data: The data to pass to the containers.
            requires_proof: Whether the job requires proof.
        """

        containers: list[str]
        data: dict[str, Any]
        requires_proof: NotRequired[Optional[bool]]

## `JobResponse`

Bases: `TypedDict`

Job response for asynchronous job requests.

Attributes:

Name | Type | Description
--- | --- | ---
`id` | `JobID` | The job ID.

Source code in `src/infernet_client/types.py`

    116
    117
    118
    119
    120
    121
    122
    123
    class JobResponse(TypedDict):
        """Job response for asynchronous job requests.

        Attributes:
            id: The job ID.
        """

        id: JobID

## `JobResult`

Bases: `TypedDict`

Job result.

Attributes:

Name | Type | Description
--- | --- | ---
`id` | `str` | The job ID.
`status` | `JobStatus` | The job status.
`result` | `Optional[ContainerResult]` | The job result.
`intermediate` | `NotRequired[list[ContainerResult]]` | Job result from intermediate containers.

Source code in `src/infernet_client/types.py`

    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    class JobResult(TypedDict):
        """Job result.

        Attributes:
            id: The job ID.
            status: The job status.
            result: The job result.
            intermediate: Job result from intermediate containers.
        """

        id: str
        status: JobStatus
        result: Optional[ContainerResult]
        intermediate: NotRequired[list[ContainerResult]]

## `NetworkContainer`

Network container.

Attributes:

Name | Type | Description
--- | --- | ---
`id` | `str` | The container ID.
`count` | `int` | The number of containers in the network.
`description` | `Optional[str]` | The container description.

Source code in `src/infernet_client/types.py`

    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    class NetworkContainer:
        """Network container.

        Attributes:
            id: The container ID.
            count: The number of containers in the network.
            description: The container description.
        """

        id: str
        count: int
        description: Optional[str]

## `NodeInfo`

Bases: `TypedDict`

Node information.

Attributes:

Name | Type | Description
--- | --- | ---
`version` | `str` | The version of the node.
`chain` | `ChainInfo` | The chain information.
`containers` | `list[Container]` | The container information.
`pending` | `PendingJobInfo` | The pending job information.

Source code in `src/infernet_client/types.py`

    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    class NodeInfo(TypedDict):
        """Node information.

        Attributes:
            version: The version of the node.
            chain: The chain information.
            containers: The container information.
            pending: The pending job information.
        """

        version: str
        chain: ChainInfo
        containers: list[Container]
        pending: PendingJobInfo

## `PendingJobInfo`

Bases: `TypedDict`

Pending job information.

Attributes:

Name | Type | Description
--- | --- | ---
`offchain` | `int` | The number of offchain jobs.
`onchain` | `int` | The number of onchain jobs.

Source code in `src/infernet_client/types.py`

    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    class PendingJobInfo(TypedDict):
        """Pending job information.

        Attributes:
            offchain: The number of offchain jobs.
            onchain: The number of onchain jobs.
        """

        offchain: int
        onchain: int