Debian Codegraph @

src/anthropic/_utils/_resources_proxy.py

raw
1 from __future__ import annotations
2
3 from typing import Any
4 from typing_extensions import override
5
6 from ._proxy import LazyProxy
7
8
9 class ResourcesProxy(LazyProxy[Any]):
10 """A proxy for the `anthropic.resources` module.
11
12 This is used so that we can lazily import `anthropic.resources` only when
13 needed *and* so that users can just import `anthropic` and reference `anthropic.resources`
14 """
15
16 @override
17 def __load__(self) -> Any:
18 import importlib
19
20 mod = importlib.import_module("anthropic.resources")
21 return mod
22
23
24 resources = ResourcesProxy().__as_proxied__()