wapadil Claude commited on
Commit ·
49e37f6
1
Parent(s): d3720bc
[BUGFIX] 修复 SyncClient 初始化错误 - 移除不支持的 headers 参数
Browse files根因: SyncClient 不支持 headers 参数(仅 AsyncClient 支持)
症状: TypeError - SyncClient.__init__() got an unexpected keyword argument 'headers'
修复: 移除 SyncClient 构造函数中的 headers 参数
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- api/fal_client.py +3 -5
api/fal_client.py
CHANGED
|
@@ -19,11 +19,9 @@ class FALClient:
|
|
| 19 |
if not self.api_key:
|
| 20 |
raise ValueError("FAL API key is required")
|
| 21 |
|
| 22 |
-
# 使用简单的同步客户端
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
headers={"X-Fal-Store-IO": "0"} # 阻止 FAL 平台保存生成历史
|
| 26 |
-
)
|
| 27 |
|
| 28 |
def generate_image(self, model_endpoint: str, arguments: Dict[str, Any]) -> Dict[str, Any]:
|
| 29 |
"""
|
|
|
|
| 19 |
if not self.api_key:
|
| 20 |
raise ValueError("FAL API key is required")
|
| 21 |
|
| 22 |
+
# 使用简单的同步客户端
|
| 23 |
+
# 注意: SyncClient 不支持 headers 参数(与 AsyncClient 不同)
|
| 24 |
+
self.client = fal_client.SyncClient(key=self.api_key)
|
|
|
|
|
|
|
| 25 |
|
| 26 |
def generate_image(self, model_endpoint: str, arguments: Dict[str, Any]) -> Dict[str, Any]:
|
| 27 |
"""
|