save code

This commit is contained in:
Ubuntu
2026-06-23 23:30:24 +08:00
parent 57d1a876cc
commit e58ece0ada
4 changed files with 316 additions and 0 deletions
+10
View File
@@ -103,6 +103,16 @@ def analyze_features(image_bytes: bytes = None, image_url: str = None):
{"type": "image_url", "image_url": {"url": url}},
{"type": "text", "text": _PROMPT},
],
# 【SDK原生支持的标准参数,绝对不报错】
max_tokens=1024, # 限制输出长度,模型秒回
temperature=0, # 固定输出,无随机采样,提速+结果稳定
stream=False, # 关闭流式,单次返回结果更快
# 【官方正确写法】扩展参数必须放在extra_body中传递
extra_body={
"thinking": {
"type": "disabled" # 【核心提速】彻底关闭深度思考模式,提速50%+,官方标准格式{insert\_element\_1\_}
}
}
}],
)
text = resp.choices[0].message.content