Merge branch 'main' of https://github.com/chenyme/grok2api
This commit is contained in:
commit
23acbb9bb2
2 files changed
+3
-2
No files matched your search
@@ -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,
|
||||
|
||||
@@ -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}"
|
||||
|
||||
|
||||
Reference in new issue
Block a user