MCPcopy Create free account
hub / github.com/HisMax/RedInk / __init__

Method __init__

backend/generators/image_api_client.py:18–27  ·  view source on GitHub ↗
(
        self,
        policy: ImageProviderPolicy,
        session: Optional[requests.Session] = None,
        timeout: int = 300,
    )

Source from the content-addressed store, hash-verified

16 """负责请求兼容图片上游、退避重试和响应解析。"""
17
18 def __init__(
19 self,
20 policy: ImageProviderPolicy,
21 session: Optional[requests.Session] = None,
22 timeout: int = 300,
23 ):
24 self.policy = policy
25 self.session = session or requests.Session()
26 self.timeout = timeout
27 self.extractor = ImageResponseExtractor(self.download_image)
28
29 def generate_via_images(self, payload: Dict[str, Any]) -> bytes:
30 result = self._post_json(payload, label="Image API")

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected