This commit is contained in:
Chenyme committed 2025-12-16 16:40:39 +08:00
commit 23acbb9bb2
2 files changed
+3 -2

No files matched your search

+1 -1
View File
@@ -103,7 +103,7 @@ _MODEL_CONFIG: Dict[str, Dict[str, Any]] = {
"cost": {"type": "low_cost", "multiplier": 1, "description": "计1次调用"},
"requires_super": False,
"display_name": "Grok Imagine 0.9",
"description": "Video generation model powered by Grok",
"description": "Image and video generation model. Supports text-to-image and image-to-video generation.",
"raw_model_path": "xai/grok-imagine-0.9",
"default_temperature": 1.0,
"default_max_output_tokens": 8192,
+2 -1
View File
@@ -188,7 +188,8 @@ class GrokClient:
# 构建请求
headers = GrokClient._build_headers(token)
if model == "grok-imagine-0.9":
ref_id = post_id or payload.get("fileAttachments", [""])[0]
file_attachments = payload.get("fileAttachments", [])
ref_id = post_id or (file_attachments[0] if file_attachments else "")
if ref_id:
headers["Referer"] = f"https://grok.com/imagine/{ref_id}"