Skip to content

Client

rationai.client.Client

Bases: Client

Source code in rationai/client.py
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
class Client(httpx.Client):
    def __init__(
        self,
        *,
        models_base_url: URL
        | str = "http://rayservice-model-serve-svc.rationai-jobs-ns.svc.cluster.local:8000",
        qc_base_url: URL
        | str = "http://rayservice-qc-serve-svc.rationai-jobs-ns.svc.cluster.local:8000",
        timeout: TimeoutTypes = 100,
        **kwargs: Any,
    ) -> None:
        super().__init__(timeout=timeout, follow_redirects=True, **kwargs)
        self.models_base_url = models_base_url
        self.qc_base_url = qc_base_url

    def __enter__(self) -> Self:
        super().__enter__()
        return self

    @cached_property
    def models(self) -> Models:
        from rationai.resources.models import Models

        return Models(self, base_url=self.models_base_url)

    @cached_property
    def slide(self) -> Slide:
        from rationai.resources.slide import Slide

        return Slide(self, base_url=self.models_base_url)

    @cached_property
    def qc(self) -> QualityControl:
        from rationai.resources.qc import QualityControl

        return QualityControl(self, base_url=self.qc_base_url)

models cached property

models_base_url = models_base_url instance-attribute

qc cached property

qc_base_url = qc_base_url instance-attribute

slide cached property

__enter__()

Source code in rationai/client.py
32
33
34
def __enter__(self) -> Self:
    super().__enter__()
    return self

__init__(*, models_base_url='http://rayservice-model-serve-svc.rationai-jobs-ns.svc.cluster.local:8000', qc_base_url='http://rayservice-qc-serve-svc.rationai-jobs-ns.svc.cluster.local:8000', timeout=100, **kwargs)

Source code in rationai/client.py
18
19
20
21
22
23
24
25
26
27
28
29
30
def __init__(
    self,
    *,
    models_base_url: URL
    | str = "http://rayservice-model-serve-svc.rationai-jobs-ns.svc.cluster.local:8000",
    qc_base_url: URL
    | str = "http://rayservice-qc-serve-svc.rationai-jobs-ns.svc.cluster.local:8000",
    timeout: TimeoutTypes = 100,
    **kwargs: Any,
) -> None:
    super().__init__(timeout=timeout, follow_redirects=True, **kwargs)
    self.models_base_url = models_base_url
    self.qc_base_url = qc_base_url

rationai.client.AsyncClient

Bases: AsyncClient

Source code in rationai/client.py
55
56
57
58
59
60
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
88
89
90
class AsyncClient(httpx.AsyncClient):
    def __init__(
        self,
        *,
        models_base_url: URL
        | str = "http://rayservice-model-serve-svc.rationai-jobs-ns.svc.cluster.local:8000",
        qc_base_url: URL
        | str = "http://rayservice-qc-serve-svc.rationai-jobs-ns.svc.cluster.local:8000",
        timeout: TimeoutTypes = 100,
        **kwargs: Any,
    ) -> None:
        super().__init__(timeout=timeout, follow_redirects=True, **kwargs)
        self.models_base_url = models_base_url
        self.qc_base_url = qc_base_url

    async def __aenter__(self) -> Self:
        await super().__aenter__()
        return self

    @cached_property
    def models(self) -> AsyncModels:
        from rationai.resources.models import AsyncModels

        return AsyncModels(self, base_url=self.models_base_url)

    @cached_property
    def slide(self) -> AsyncSlide:
        from rationai.resources.slide import AsyncSlide

        return AsyncSlide(self, base_url=self.models_base_url)

    @cached_property
    def qc(self) -> AsyncQualityControl:
        from rationai.resources.qc import AsyncQualityControl

        return AsyncQualityControl(self, base_url=self.qc_base_url)

models cached property

models_base_url = models_base_url instance-attribute

qc cached property

qc_base_url = qc_base_url instance-attribute

slide cached property

__aenter__() async

Source code in rationai/client.py
70
71
72
async def __aenter__(self) -> Self:
    await super().__aenter__()
    return self

__init__(*, models_base_url='http://rayservice-model-serve-svc.rationai-jobs-ns.svc.cluster.local:8000', qc_base_url='http://rayservice-qc-serve-svc.rationai-jobs-ns.svc.cluster.local:8000', timeout=100, **kwargs)

Source code in rationai/client.py
56
57
58
59
60
61
62
63
64
65
66
67
68
def __init__(
    self,
    *,
    models_base_url: URL
    | str = "http://rayservice-model-serve-svc.rationai-jobs-ns.svc.cluster.local:8000",
    qc_base_url: URL
    | str = "http://rayservice-qc-serve-svc.rationai-jobs-ns.svc.cluster.local:8000",
    timeout: TimeoutTypes = 100,
    **kwargs: Any,
) -> None:
    super().__init__(timeout=timeout, follow_redirects=True, **kwargs)
    self.models_base_url = models_base_url
    self.qc_base_url = qc_base_url