MCPcopy Index your code
hub / github.com/HisMax/RedInk / validate_config

Method validate_config

backend/generators/image_api.py:33–41  ·  view source on GitHub ↗

验证配置是否有效

(self)

Source from the content-addressed store, hash-verified

31 logger.info(f"ImageApiGenerator 初始化完成: base_url={self.base_url}, model={self.model}, endpoint={self.endpoint_type}")
32
33 def validate_config(self) -> bool:
34 """验证配置是否有效"""
35 if not self.api_key:
36 logger.error("Image API Key 未配置")
37 raise ValueError(
38 "Image API Key 未配置。\n"
39 "解决方案:在系统设置页面编辑该服务商,填写 API Key"
40 )
41 return True
42
43 def get_supported_sizes(self) -> List[str]:
44 """获取支持的图片尺寸"""

Callers 1

generate_imageMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected