落地私聊空运询价与TMS报价回填,按后台模板出单。
查到价后把币种、单位、数量、单价、备注写入报价单,避免销售只看到光秃秃的金额。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -119,15 +119,22 @@ class LlmHttpClient:
|
||||
body["tools"] = tools
|
||||
if tool_choice is not None:
|
||||
body["tool_choice"] = tool_choice
|
||||
# deepseek-v4-flash 思考模式拒绝 named/required tool_choice,抽字段会 400
|
||||
if provider == "deepseek":
|
||||
body["thinking"] = {"type": "disabled"}
|
||||
try:
|
||||
with httpx.Client(timeout=self.timeout_seconds) as client:
|
||||
resp = client.post(url, headers=headers, json=body)
|
||||
data = resp.json() if resp.content else {}
|
||||
if resp.status_code >= 400:
|
||||
err_msg = ""
|
||||
if isinstance(data, dict) and isinstance(data.get("error"), dict):
|
||||
err_msg = str(data["error"].get("message") or "")[:200]
|
||||
logger.warning(
|
||||
"llm.http 失败 provider=%s status=%s",
|
||||
"llm.http 失败 provider=%s status=%s err=%s",
|
||||
provider,
|
||||
resp.status_code,
|
||||
err_msg,
|
||||
)
|
||||
return LlmHttpResult(
|
||||
ok=False,
|
||||
|
||||
Reference in New Issue
Block a user