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
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
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
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
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
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
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
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
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
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
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
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
class PendingJobInfo(TypedDict):
    """Pending job information.

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

    offchain: int
    onchain: int