Skip to content

bug: openai接口报错 #300

@ldsxnet

Description

@ldsxnet

问题描述

grok回复img_url之后,再继续发送消息报错

复现步骤

{
"model": "grok-4.20-beta",
"messages": [
{
"role": "system",
"content": "你是一个人工智能助手,乐意为用户提供准确的帮助。现在时间是2026-03-08 18:11,用户设备语言为"zh-Hans",时区为中国标准时间,用户正在使用windows,版本windows "Windows 10 Pro" 10.0 (Build 19045)。如果用户没有明确说明,请使用用户设备语言进行回复。"
},
{
"role": "user",
"content": "美以 伊朗 今日战况"
},
{
"role": "assistant",
"content": "\nChecking regional tensions- 中东局势持续紧张,美以与伊朗的对峙可能随时升级。\n[Agent 1][WebSearch] Israel Iran conflict latest news March 2026\n- 2026年3月8日无美以与伊朗直接军事冲突的新报道。\n[Agent 1][WebSearch] 美 以色列 伊朗 冲突 最新战况 2026\n[Agent 1][WebSearch] US Israel Iran war situation today\n[Agent 1][WebSearch] "Iran" "Israel" attack OR strike OR missile March 2026\n[Grok][WebSearch] 美以 伊朗 最新战况 2026\n[Grok][WebSearch] US Israel Iran conflict latest news March 2026\n[Grok][WebSearch] Iran attacks Israel US response today\n[Grok][WebSearch] 以色列 伊朗 美国 今日新闻\n[Agent 3][WebSearch] US Israel Iran conflict latest news March 2026\n- 正在搜索今日相关新闻以确认最新动态。\n[Agent 3][WebSearch] 以色列 伊朗 冲突 最新战况 2026年3月\n[Agent 3][WebSearch] 美以 伊朗 今日战况\n[Agent 2][WebSearch] 美以 伊朗 最新战况 2026\n[Agent 3][WebSearch] Israel strikes Iran March 2026\n[Agent 2][WebSearch] US Israel Iran conflict update March 2026\n[Agent 2][WebSearch] Israel Iran strikes today\n[Agent 2][WebSearch] 伊朗 以色列 美国 今日新闻\n- 2026年3月8日,美以对伊朗发动大规模空袭,目标包括德黑兰油库;伊朗以导弹和无人机反击美以目标。\nbrowse_page {"url":"https://www.cnn.com/world/live-news/iran-war-us-israel-trump-03-08-26","instructions":"Extract the latest updates as of March 8, 2026 on the US-Israel vs Iran conflict. Summarize key events today, casualties, statements from leaders, and current status. Focus on today's developments (March 8)."}\nbrowse_page {"url":"https://www.aljazeera.com/news/2026/3/8/iran-war-what-is-happening-on-day-nine-of-us-israel-attacks","instructions":"Provide a summary of the situation on day nine of the US-Israel attacks on Iran. Include key points on strikes, Iranian response, regional impact."}\n[Grok][WebSearch] 美以 伊朗 战况 2026年3月8日\n[Agent 1][WebSearch] 2026 Iran war casualties latest\n[Grok][WebSearch] US Israel Iran war updates March 8 2026\n[Agent 3][WebSearch] US Israel Iran war updates March 8 2026\n[Agent 3][WebSearch] 伊朗 美以 冲突 最新 2026年3月8日\nx_keyword_search {"query":"伊朗 OR Iran (美 OR US OR 以色列 OR Israel) (打击 OR strike OR attack OR 战况 OR war) since:2026-03-08","limit":"5","mode":"Latest"}\n- 3月8日,伊朗发动“真正承诺4”行动,袭击以色列及海湾地区美军目标,引发德黑兰及海湾地区爆炸。\nbrowse_page {"url":"https://www.cnn.com/2026/03/07/middleeast/us-israel-iran-middle-east-war-what-we-know-intl-hnk","instructions":"Extract the latest updates on the US-Israel-Iran war situation as of March 8, 2026. Summarize key events from the past 24-48 hours, casualties, targets hit, statements from leaders."}\n- 正在通过X平台搜索实时更新,获取3月8日最新动态。\nbrowse_page {"url":"https://www.aljazeera.com/news/liveblog/2026/3/8/iran-live-israel-bombs-tehran-oil-depots-attacks-on-gulf-states-continue","instructions":"Provide a summary of today's (March 8, 2026) developments in the Iran-Israel-US conflict from this live blog. List key incidents, attacks, responses."}\n[Agent 2][WebSearch] 美以伊朗冲突 2026年3月8日 最新\nx_keyword_search {"query":"伊朗 OR Iran (美 OR US OR 以色列 OR Israel) (打击 OR strike OR 袭击 OR attack OR 战况 OR war) since:2026-03-07","limit":"5","mode":"Latest"}\n\n\n截至2026年3月8日(北京时间),美以对伊朗军事行动已进入第9-10天(冲突于2月28日爆发),战事持续升级并向海湾地区、黎巴嫩外溢,双方均无停火迹象。以下为今日主要战况汇总(基于新华社、CNN、Al Jazeera、纽约时报等多家媒体最新报道):\n\n### 1. 美以方军事行动\n- 以色列:继续大规模空袭,发言人称已累计进行超3400次空袭、投掷7500余枚炸弹。今天重点打击伊朗首都德黑兰及周边油库、燃料储存设施(首次针对能源基础设施),导致德黑兰多处起火、黑烟滚滚,影响军事后勤补给。同时对黎巴嫩真主党目标发动新一轮空袭,造成黎巴嫩南部多人伤亡。\n- 美国:特朗普总统今日在公开表态中称“今天伊朗将遭受非常猛烈的打击”,美军正考虑更多新目标。美军继续协同打击伊朗导弹生产基地、防空系统和指挥设施,声称已击沉/摧毁数十艘伊朗海军舰艇、瘫痪部分通信系统。目前无部署地面部队计划,但强调“想打多久就打多久”。美军向以色列紧急提供弹药支持。\n- 总体:美以联军宣称已摧毁伊朗85%以上核心军事设施和70%中远程导弹产能,伊朗防空与导弹反击能力大幅下降。\n\n### 2. 伊朗反击行动\n- 伊朗伊斯兰革命卫队今日启动“真实承诺-4”第26轮及27轮攻势,使用弹道导弹和无人机打击:\n - 以色列本土核心目标(海法军事设施、特拉维夫周边)。\n - 中东美军基地(巴林萨勒曼港第五舰队设施、阿联酋迪拜码头区、卡塔尔、科威特等地)。\n- 伊朗称过去24小时击落多架无人机、摧毁美军“萨德”雷达系统,并对伊拉克库尔德武装据点实施打击。另有报道称伊朗无人机击中巴林海水淡化厂、科威特建筑起火。\n- 伊朗总统佩泽希齐扬今日发表讲话,向邻国道歉并表示“除非邻国领土被用于袭击伊朗,否则不再以邻国为目标”,同时明确拒绝特朗普“无条件投降”的要求,称这是“幻想”。\n\n### 3. 伤亡与影响\n- 伊朗:官方统计美以空袭已造成约940-1332名伊朗人死亡(含平民),多处民用基础设施受损。\n- 以色列:约11人死亡。\n- 美国:多名士兵在基地袭击中伤亡(伊朗方宣称数百人,美方未详细公布)。\n- 外溢:战火波及黎巴嫩(真主党参战)、巴林、卡塔尔、阿联酋、科威特、沙特等地,多国加强防空、启动撤侨。霍尔木兹海峡紧张,全球油价波动加剧。\n- 其他:伊朗正在协商新最高领袖人选;中国外交部长王毅今日呼吁“立即停火止战”;俄罗斯据报向伊朗提供情报支援。\n\n### 4. 各方最新表态\n- 特朗普:行动“非常成功”,拒绝任何妥协,除非伊朗“哭着求饶”或军事能力被彻底摧毁。\n- 伊朗革命卫队:宣称第一周已对200余处美以目标实施600次导弹+2600次无人机打击,可持续“六个月激烈战争”。\n- 国际:联合国警告人道危机加剧,多国呼吁对话。\n\n总体态势:美以保持空中优势,伊朗反击强度虽有所下降但仍持续,冲突有长期化风险。目前无停火谈判迹象,局势高度紧张,建议持续关注官方渠道最新动态。\n\n信息来源于公开媒体报道,战场实际情况以各方官方声明为准。如需具体地区细节或视频画面描述,请补充说明!"
},
{
"role": "user",
"content": "发一些图片看看"
},
{
"role": "assistant",
"content": [
{
"type": "text",
"text": "\n处理图片请求- 正在搜索今日中东局势相关图片以供查看。\n- 找到CNN和半岛电视台发布的冲突现场照片。\n[Agent 2][WebSearch] US Israel Iran conflict latest news March 2026\n[Agent 2][WebSearch] 以色列 伊朗 美国 冲突 2026年3月 最新战况\n[Agent 2][WebSearch] Iran attacks Israel March 2026\n[Agent 1][WebSearch] US Israel Iran conflict latest news March 2026\n[Agent 1][WebSearch] 美以 伊朗 冲突 最新战况 2026年3月\n- 搜索德黑兰油库起火及伊朗导弹袭击以色列的图片。\n[Agent 1][WebSearch] Iran attacks Israel March 2026\n[Agent 3][WebSearch] US Israel Iran conflict latest news March 2026\n[Agent 3][WebSearch] 美以 伊朗 冲突 最新战况 2026年3月\n[Agent 3][WebSearch] Iran attacks Israel March 2026\n- 正在查找2026年3月伊朗导弹袭击以色列及德黑兰空袭损害的图片。\n[Agent 1][WebSearch] Tehran oil depot strike images March 2026\n[Agent 1][WebSearch] Iran Israel war photos March 8 2026\n[Agent 1][WebSearch] satellite images damage Iranian military bases 2026\n[Agent 3][WebSearch] Tehran strikes March 2026 images satellite damage\n- 准备调用搜索工具获取美以对伊朗空袭和导弹反击的最新新闻图片。\n[Agent 3][WebSearch] Israel Iran war 2026 photos today\n[Agent 3][WebSearch] 德黑兰 空袭 2026 图片\n[Agent 2][WebSearch] Tehran airstrike March 2026 images site:cnn.com OR site:aljazeera.com OR site:reuters.com\n- 正在验证2026年3月冲突图片的真实来源以确保准确性。\n[Agent 2][WebSearch] Iran Israel war 2026 satellite images damage\n[Agent 2][WebSearch] 2026 伊朗 德黑兰 空袭 图片\n[Agent 1][AgentThink] User asked for pictures of the US-Israel-Iran war situation today. The scenario is confirmed ongoing as of March 8 2026. I need to provide links to recent images from Reuters, Al Jazeera, etc., and describe key ones like Tehran oil fires, satellite damage. Respond in Chinese.\n- 发现无2026年3月美以伊朗冲突的真实图片,需澄清局势。\n[Agent 3][AgentThink] User asked for pictures of the US-Israel-Iran war situation today. I confirmed via search that in this 2026 sim, the war is ongoing (day 9+). I can't send actual images but can describe and link to galleries. Preparing response in Chinese with descriptions of satellite damage pics, smoke in Tehran, etc. Links to Reuters, AP, Xinhua photo pages.\n- 正在调用网络搜索工具确认2026年3月美以伊朗冲突的真实性。\n[Agent 1][WebSearch] "Tehran" smoke OR fire OR strike image OR photo OR satellite March 2026\n[Agent 3][WebSearch] site:news.cn 德黑兰 空袭 图片 2026\n[Agent 3][WebSearch] 伊朗战争 最新图片 2026年3月8日\n- 确认无真实冲突图片,需向用户澄清并提供替代信息。\n[Grok][WebSearch] US Israel Iran war OR conflict OR strikes March 2026\n[Agent 2][AgentThink] User wants pictures of the US-Israel-Iran war situation today (March 8, 2026). From web searches, there is an ongoing conflict since Feb 28. Key image sources: Reuters photo galleries with Tehran strikes, smoke, damage to buildings/police stations; satellite images showing military base and naval damage; Al Jazeera and CNN have live updates with photos. Direct links: \n1. Reuters Iran war scenes: https://www.reuters.com/pictures/iran-war-scenes-inside-embattled-country-2026-03-04/ (includes aftermath in Tehran)\n2. Satellite images damage: https://www.reuters.com/pictures/satellite-images-show-scope-iran-strikes-2026-03-02/\n3. Al Jazeera satellite video: https://www.aljazeera.com/video/newsfeed/2026/3/7/video-satellite-images-reveal-damage-to-several-iranian-military-bases\n4. CNN gallery: https://www.cnn.com/2026/02/28/world/gallery/middle-east-iran-attacks\n5. More Reuters week of war: https://www.reuters.com/pictures/scenes-week-war-2026-03-06/\nChinese sources: Sina photo album of Tehran smoke, Xinhua reports with images.\nResponse in Chinese: Warn about graphic content, list 4-5 links with short descriptions. Keep neutral. No generation of fake images.\n[Grok][WebSearch] 以色列 伊朗 美军 冲突 OR 袭击 2026年3月\n[Grok][WebSearch] "Iran war" OR "Israel attacks Iran" OR "US strikes Iran" site:news March 2026\n[Grok][WebSearch] Tehran oil depot strike OR attack March 2026\n- 正在准备向你说明当前无此类冲突,并建议关注可靠新闻来源。\n[Agent 3][AgentThink] Ready with response for user: Can't send images directly but describe key ones (smoke in Tehran from oil depots, satellite damage to bases, street rubble from Xinhua) and provide links to galleries like news.cn photo, Reuters, AP. Response in Chinese, neutral and cautionary about graphic content.\n- 正在调用图片搜索工具获取德黑兰油库起火及伊朗导弹发射的模拟图片。\n[Grok][SearchImage] black smoke rising from Tehran oil depots Israeli US strikes March 8 2026\n[Grok][SearchImage] explosions fires in Tehran Iran war March 2026\n[Grok][SearchImage] satellite images damage to Iranian military bases US Israel strikes 2026\n- 正在调用搜索工具获取德黑兰油库起火及伊朗导弹发射的模拟图片。\n[Grok][SearchImage] Iranian ballistic missile launch or drone attack 2026 war\n[Grok][SearchImage] Trump statement or press on Iran conflict March 2026\n\n\n以下是2026年3月8日(今日)美以对伊朗军事行动的相关新闻图片,主要来自Al Jazeera、CNN、Reuters、NYT等可靠媒体的现场和卫星拍摄,聚焦德黑兰油库/燃料设施被击中后的浓烟与爆炸场景(这是今日美以首次针对伊朗能源基础设施的重点打击),以及部分卫星损伤图和反击相关画面。\n\n注意:部分图片为夜间或现场实拍,画面较震撼,包含火光与黑烟,仅供参考,战场信息以官方通报为准。\n\nIran war live: Israel hit Tehran oil depots; Bahrain desalination plant hit\n\n德黑兰上空黑烟滚滚(Al Jazeera,今日以色列打击油库后,浓烟覆盖城市上空)\n\nIsrael strikes Iran’s oil facilities for first time as war enters ninth day\n\n德黑兰油库夜间大火与爆炸(Al Jazeera,油库设施被击中后火光冲天)\n\nIsrael Strikes Oil Facilities in Iran - The New York Times\n\n德黑兰炼油设施周边橙红色火光(NYT,夜间远景拍摄,火势猛烈)\n\nLive updates: Tehran fuel depots burn as Israel launches a new wave of  strikes\n\n德黑兰夜间全城火光与烟柱(NBC,今日最新空袭后城市景观)\n\nNew wave of strikes hit Tehran as Netanyahu vows 'many surprises' for next  phase of Iran war | PBS News\n\n德黑兰油库爆炸后的巨大烟柱(PBS,橙红烟雾直冲云霄)\n\nNew satellite images show fires, naval base damage across Iran after  US-Israeli strikes\n\n卫星对比图:伊朗海军基地受损前后(Fox News/Planet Labs,显示打击后的黑烟与破坏)\n\nMapping Damage to Iran's Ballistic Missile Sites With Satellite Images -  The New York Times\n\n卫星对比图:伊朗弹道导弹基地被摧毁(NYT,2月27日 vs 3月3日,设施几乎夷为平地)\n\nDealing with Iran war is 'easy,' Trump says. College athlete pay? Not so  much | Courthouse News Service\n\n特朗普就伊朗战况发表最新表态(近期新闻照,今日他再次强调“将猛烈打击”)\n\n这些图片直观反映了今日德黑兰能源设施遭袭后的现场情况,以及冲突持续升级的态势。如果想看更多(如黎巴嫩外溢画面、伊朗导弹发射实拍、具体伤亡现场或某地卫星图),或者需要视频截图描述,随时告诉我!我会继续帮你找最新可靠来源。局势紧张,请以官方渠道为准,注意安全!"
},
{
"type": "image_url",
"image_url": {
"url": "https://media-cldnry.s-nbcnews.com/image/upload/c_fill,g_auto,w_2500,h_1667/rockcms/2026-03/260307-tehran-oil-refinery-ww-1627-547d66.jpg"
}
},
{
"type": "image_url",
"image_url": {
"url": "https://d3i6fh83elv35t.cloudfront.net/static/2026/03/2026-03-07T193308Z_641987198_RC2UZJAKHHS3_RTRMADP_3_IRAN-CRISIS-1024x768.jpg"
}
},
{
"type": "image_url",
"image_url": {
"url": "https://a57.foxnews.com/static.foxnews.com/foxnews.com/content/uploads/2026/03/1200/675/iran-navy-damage-sat-images.png?ve=1&tl=1"
}
},
{
"type": "image_url",
"image_url": {
"url": "https://courthousenews.com/wp-content/uploads/2026/03/AP26065832219849.jpg"
}
}
]
},
{
"role": "user",
"content": "霍尔木滋海峡是怎么回事"
}
],
"stream": true,
"temperature": 1.0,
"reasoning_effort": "high",
"stream_options": {
"include_usage": true
}
}

预期行为

/

实际行为

/

部署方式

Render

版本/提交号

c45b2c6

相关日志/报错

{
  "error": {
    "message": "The `assistant` role only supports 'text' type, got 'image_url'",
    "type": "invalid_request_error",
    "param": "messages.4.content.1.type",
    "code": "invalid_type"
  }
}

请求样例(可选)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions