蓝色天空网mbsky.com · 知识 · 实践 · 创造DeepSeek Harness · 本地阅读预览
教程 / AI / 智能开发 / DeepSeek Harness

DeepSeek Harness多模态:图片输入、文件引用与版本迁移

区分视觉能力与请求结构,说明三种图片来源及Chat/Messages/Responses字段,保留历史模型和限制迁移,并离线观察独立输入片段。

本站独立整理的内容草稿。实例显示的是预期结果;浏览器、服务端运行与技术内容验收尚待完成,本页只用于阅读和图文核对。

学完这一章,你能够

多模态与模型版本

多模态表示多种信息形态,但图片输入支持不自动扩展为音频或视频能力。视觉编码器、patch和token合并是可能的实现方式;仅凭接口文档不能确认某个服务模型内部如何编码。

本章按2026年11月23日取得的官方图像与Files指南解释接口。旧视觉实验模型名称保留为迁移知识,实际请求已由最新Flash承接;固定DSH源码版本与云端模型版本应分别记录。

原教程的全局安装命令会改变机器上的DSH版本;示例工程应先固定可追溯版本并在隔离环境验证。模型能否接收图片还取决于当前服务端模型和所用提供方,更新CLI不等于视觉请求成功。本章没有执行该安装命令。

理解图片与历史基准

历史基准说明列出极简模式、max档位、temperature=1.0、top-p=0.95,并称文本模型在ApexBench及Agents’ Last Exam忽略多模态元素。这些是原教程列明的比较条件,本次两份接口指南没有完整测试集/结果可复核;不据此声称本站复现了分数或竞品差距。

当前图片token规则使用约544×544的最小总像素参考和约1300×1300的较大图片总像素参考,并保持长宽比。旧384×384、800×800以及384token结论不能当现行规则;具体用量仍需服务返回。

Chat中的图片来源

本地图片可以按原始字节编码成base64,并放入与实际格式相符的data URL。Chat Completions的user消息content是有序块数组,文本块与image_url块分别保留;密钥从独立环境变量读取,不写入源码或下载包。当前官方示例使用deepseek-flash,本批尚未向模型发送图片。

原教程展示的识字答案是示意输出,不能当作本站实际模型结果。当前取得的测试附件是1200×718的教程目录截图,既不是示例中另一个文件名,也不是已经执行的OCR;实际读取到哪些文字必须另留真实请求与响应。

外部图片URL会由服务端下载,客户端发送URL成功不等于平台已取到图片。当前指南要求URL最多8192字符、图片32MiB以内并在60秒内下载完成;本地回环地址不是平台的本地文件入口。参考实例所指静态图片尚未请求,不能把其状态记为403或可用。

Messages与Responses

Messages使用image块及source对象,source.type有base64、url、file三种形态,不能直接复用Chat的image_url对象。DeepSeek兼容路径为/anthropic/v1/messages,鉴权和最大输出字段按该接口处理;用file来源时另带anthropic-beta: files-api-2025-04-14。尚无真实模型调用。

Responses把图片放入input_image块,文本用input_text;图片可由image_url或file_id提供,两者互斥。当前官方还允许user/developer消息及特定工具输出中的图片,不能把Chat角色规则直接搬过来。SDK具有responses方法与服务端支持此模型是两项条件,均不能靠构造请求证明。

Files:上传、元信息与引用

Files上传采用multipart/form-data。图片以user_data上传;当前还支持文档的text_recognition和rich_layout_recognition,文档用途须排在file表单字段之前。有效期使用expires_after[anchor]=created_at与expires_after[seconds]一对字段,3600至2592000秒;未传则长期保留。本文未上传任何文件,费用需按当前计费资料另核。

文件对象中的id、filename、purpose、bytes、created_at及可选expires_at描述一次上传的元信息;它们不是模型分析结果。只有设置有效期才出现expires_at,Unix秒与字节单位须保留。示例file-api标识是惰性样本,不得假装已经存在于账号。

Chat中的file块可用已上传file_id,或使用内联file_data,两者互斥;filename可配file_data,不能与file_id并用。Responses对应input_image,Messages则是image.source.type=file;复用文件归属于同一账号,不代表能够跨账号任意使用。没有真实上传时不能把样本ID用于云端请求。

Files接口现已区分图片及文档解析。PDF、Word、PowerPoint不以user_data直接上传;应选择text_recognition或rich_layout_recognition,purpose表单字段放在file之前。上传文档后引用方式不能当图片块直接套用。

账号下文件可由该账号的不同API key和API家族复用,但文件是否仍存在、有效期、权限与请求格式需分别检查。本文没有真实上传、列出、删除文件,也不创建假的云端文件记录。

独立离线观察与素材边界

取得的测试附件是一张1200×718的网页教程目录PNG,273809字节,包含导航、分类与多列课程卡片。它与章节4张未取得的截图/SVG分别管理;视觉检查只确认附件像素内容,不代表模型已经识图或许可允许公开分发。

原教程代码中的非标准空白、平台字段和示意响应只保存在私有对照。本站代码需要重新编写并在隔离环境验证序列化、图片字节及接口参数;不得运行原脚本或把示意答案当真实结果。

离线验证可以检查字节编码、图片内容类型、请求块互斥、字段与大小边界,不能验证云端取图、模型理解质量、实际400响应、费用或使用量。即使未来使用本地传输回放,也应把模拟服务明确标成模拟。

本站工程用自编PNG、真实base64和UTF-8 JSON观察35个离线子目标,包含内容块顺序、字段互斥、边界和有效期计划。8192像素边界使用实际自编PNG;MiB等大容量分支仅输入明确标注的惰性数值,没有分配或上传对应大文件。没有模型请求、OCR或真实上传,完整API和DSH视觉任务继续待。

运行本站离线工程

下载四文件ZIP,使用Python3.12运行vision_payload_lab.py。标准库完成PNG CRC与受限RGB8解码、base64回环、UTF-8 JSON、内容顺序与字段/数字边界观察,输出逐项输入、条件、预期、实际结果和代码哈希。

owned-blue.png是本站代码构造的2×1色块;8192×1边界图由代码另行构造。大容量MiB分支仅测试明确标注的惰性数字,不声称真的构造或上传相应文件。

工程不依赖第三方SDK,不联网,不读密钥,不上传或删除文件,没有模型识图结果。原始网站截图附件只留私有,下载包仅包含独立代码、独立色块与README/哈希清单。

不同模态的能力边界

项目用途、条件与当前核对范围
文本文本用于文章、代码和对话;能否同时接收其他媒体由具体模型与端点决定,不能把所有LLM归为永远只接受文本。
图像图像输入适合截图、照片与图表,但可接收图片不等于每个文字、像素或关系都识别正确;应有可核对的任务输出。
音频音频输入、转写与音频生成是分别提供的能力;本章取得的视觉指南不能证明所选模型同时具备它们。
视频视频可以包含时序帧和音轨,支持单张图片不自动证明原生视频理解或音视频同步能力。

图片任务如何核对

项目用途、条件与当前核对范围
输入形式纯文本接口接收文字;当前图像接口使用有序的文本/图像内容块。具体消息形状按Chat、Messages、Responses区分。
排查代码报错截图可保留报错的布局和上下文,也可能裁切、模糊或漏行;诊断仍应与实际代码和错误日志核对。
还原设计稿设计稿可作为视觉约束输入,生成页面后还需检查尺寸、文字、交互和资源,不能把一次生成当还原验收。
分析数据图表图表识别要核对坐标、图例、单位和数据点,图片推断应与可取得原始数据比较,不能只接受自然语言结论。

历史模型比较与迁移

项目用途、条件与当前核对范围
纯文本 Agent 任务原教程声称视觉实验版文本Agent与正式版持平;两份当前指南未提供该基准的测试集、分数与复现实验,比较保留待核。
推理与世界知识推理和世界知识是否持平需要同版本、同条件测试;接口指南不构成这项性能结论的证据。
视觉理解 Agent 任务接近特定竞品以及ApexBench/Agents’ Last Exam的历史结论需完整基准依据,不能由视觉接口可用或忽略媒体的描述推导。
模型定位当前官方明确旧deepseek-v4-flash-vision-exp已下线,旧名请求由最新Flash承接;示例现用deepseek-flash,旧实验版名称不代表仍在运行原模型。

三种API格式

项目用途、条件与当前核对范围
Chat CompletionsChat使用messages和content块数组:text配文字,image_url配URL/data URL,file配文件引用。熟悉OpenAI风格仍需核对DeepSeek扩展字段。
MessagesMessages采用image/source形状及/anthropic兼容路径;源类型、鉴权、file beta头和返回结构分别核对,不能宣称所有SDK代码无修改即可切换。
ResponsesResponses采用input_text和input_image;image_url/file_id互斥,detail与适用角色按此接口解释。SDK调用名相同不证明返回、工具或计费合同完全一致。

三种传图路径

项目用途、条件与当前核对范围
base64 内联base64把图片字节放进请求,免去外部图床;编码和JSON包裹会增加体积,并计入48MiB请求体。应计算实际UTF-8请求字节。
外部 URL外部URL减少请求体中的图片字节,但要求服务端可访问;8192字符、32MiB、60秒下载限制与本地构造请求是不同检查。
Files APIFiles先上传再复用id,图片上限64MiB;上传、文件归属、保留和引用是不同阶段,并非取得id就完成模型任务。

detail四种取值

项目用途、条件与当前核对范围
low当前指南的low会在推理前缩放到512×512,适合不需要精细内容的任务;是否更便宜仍应观察实际usage而非自编估算。
highhigh是兼容取值,当前与original同义,不是额外更高一级的专属保证。
originaloriginal保留原图这一处理选项,不代表图片绕过后续模型缩放或所有文字一定可辨认。
autoauto当前等同original;这是当前指南行为,后续模型或接口版本变化时需重新核对。

文件元信息

项目用途、条件与当前核对范围
id文件id是上传结果身份,当前示例以file-api-开头;不能凭格式相似推定该文件存在、可访问或属于当前账号。
filenamefilename保存上传名称,当前Files文件名最长512字节;名称和扩展名不能替代内容格式检测。
purposepurpose不再只有user_data:图片等可用user_data,文档解析另有text_recognition与rich_layout_recognition,并有类型及表单顺序条件。
bytesbytes按字节给出文件大小,不能与base64字符数或完整JSON请求体字节混为一个指标。
created_atcreated_at是Unix时间戳秒;Anthropic兼容文件对象则使用RFC3339字符串,跨接口需转换而不是原样比较。
expires_atexpires_at仅在设置有效期时返回;未给有效期字段表示长期保留,不应自动填一个虚构过期时间。

计费与用量

项目用途、条件与当前核对范围
图片计费图片按尺寸换算token并计入模型用量,实际计费需当前定价及服务返回usage;离线编码长度不是图片token数。
单张图片上限原教程384token上限已过时;当前视觉指南写单图最多1024token。10图理论上界因此为10240,不等每次实际消耗。
价格原教程称与旧V4-Flash同价,当前两份指南没有给出可核对的现行价格表,此处保留待核,不沿用旧价格。
Files API原教程称Files免费;当前Files指南包含存储、格式与有效期限制,但没有本次可核对的免费承诺,价格不据此宣称已确认。

图片请求限制

项目用途、条件与当前核对范围
图片格式视觉图片格式为JPEG、PNG、GIF、WebP,并按实际内容判断。Files文档解析支持更多图片格式属于另一用途,不扩大直接视觉输入格式。
外部 URL 长度外部图片链接最多8192字符且需60秒内下载完成;构造URL本身不验证公网可达或服务端下载成功。
请求体大小内联编码和其他字段都计入48MiB请求体;应核对最终序列化字节,不能只比较原文件大小。
单张图片大小base64/URL图片单张32MiB,Files引用图片64MiB。另有单请求图片总大小:不含file_id最多64MiB,包含file_id最高200MiB。
单请求图片数量单次最多600张图片;数量合规仍需同时满足请求体、单图、总字节与尺寸限制。
图片最大边长图片单边最长8192像素;请求包含15张及以上图片时降为4096。14到15张会改变每张图适用的尺寸边界。
图片位置仅user可带图的旧说法已过时:Chat当前允许user/system/tool,assistant仍拒绝;Responses允许user/developer和指定工具输出,消息形状要按各API分别核对。

构造并核对独立图片请求片段

python · 阅读源码
"""Owned offline image request construction; never sends an API request."""
import argparse,base64,copy,hashlib,json,struct,sys,zlib
from pathlib import Path
GUIDE_DATE="2026-11-23"
MIB=1024*1024
def png(width=2,height=1):
 def chunk(kind,data):return struct.pack(">I",len(data))+kind+data+struct.pack(">I",zlib.crc32(kind+data)&0xffffffff)
 scan=(b"\0"+b"\x20\x70\xd0"*width)*height
 return b"\x89PNG\r\n\x1a\n"+chunk(b"IHDR",struct.pack(">IIBBBBB",width,height,8,2,0,0,0))+chunk(b"IDAT",zlib.compress(scan))+chunk(b"IEND",b"")
def inspect_png(data):
 if data[:8]!=b"\x89PNG\r\n\x1a\n":raise ValueError("not_png")
 offset=8;packed=b"";size=None;ended=False
 while offset<len(data):
  if offset+12>len(data):raise ValueError("truncated")
  length=struct.unpack(">I",data[offset:offset+4])[0]
  if length>len(data)-offset-12:raise ValueError("truncated")
  kind=data[offset+4:offset+8];body=data[offset+8:offset+8+length]
  if zlib.crc32(kind+body)&0xffffffff!=struct.unpack(">I",data[offset+8+length:offset+12+length])[0]:raise ValueError("crc")
  if kind==b"IHDR":
   width,height,depth,color,compression,filtering,interlace=struct.unpack(">IIBBBBB",body)
   if size or not width or not height or depth!=8 or color!=2 or compression or filtering or interlace:raise ValueError("owned_fixture_profile_only")
   size=(width,height)
  if kind==b"IDAT":packed+=body
  offset+=length+12
  if kind==b"IEND":ended=True;break
 if not ended or offset!=len(data) or size is None:raise ValueError("truncated_or_extra")
 expected=size[1]*(1+size[0]*3)
 if expected>10*MIB:raise ValueError("owned_decoder_budget")
 decoder=zlib.decompressobj();scan=decoder.decompress(packed,expected+1)
 if not decoder.eof or decoder.unconsumed_tail or len(scan)!=expected:raise ValueError("scanline")
 # This teaching decoder deliberately accepts only its owned filter-0 RGB8 fixtures.
 if any(scan[y*(1+size[0]*3)]!=0 for y in range(size[1])):raise ValueError("owned_fixture_profile_only")
 return dict(mime="image/png",width=size[0],height=size[1],bytes=len(data),sha256=hashlib.sha256(data).hexdigest())
def image_block(*,raw=None,url=None,file_id=None,file_data=None,filename=None,detail=None):
 if sum(v is not None for v in (raw,url,file_id,file_data))!=1:raise ValueError("one_image_source")
 if detail not in (None,"low","high","original","auto"):raise ValueError("detail")
 if file_id is not None:
  if not file_id or filename is not None:raise ValueError("file_identity_fields")
  if detail is not None:raise ValueError("detail_requires_image_url")
  return {"type":"file","file_id":file_id}
 if file_data is not None:
  if detail is not None:raise ValueError("detail_requires_image_url")
  return {"type":"file","file_data":file_data,**({"filename":filename} if filename is not None else {})}
 if filename is not None:raise ValueError("filename_requires_file_data")
 if raw is not None:
  meta=inspect_png(raw);value="data:"+meta["mime"]+";base64,"+base64.b64encode(raw).decode("ascii")
 else:
  if not url.startswith(("https://","http://")) or len(url)>8192:raise ValueError("url_shape")
  value=url
 return {"type":"image_url","image_url":{"url":value,**({"detail":detail} if detail else {})}}
def content(family,block,prompt):
 if family=="chat":return [{"type":"text","text":prompt},copy.deepcopy(block)]
 if family=="responses":
  image={"type":"input_image"}
  if block["type"]=="file":
   if "file_id" not in block:raise ValueError("owned_responses_file_data_not_implemented")
   image["file_id"]=block["file_id"]
  else:
   image["image_url"]=block["image_url"]["url"]
   if "detail" in block["image_url"]:image["detail"]=block["image_url"]["detail"]
  return [{"type":"input_text","text":prompt},image]
 if family=="messages":
  if block["type"]=="file":raise ValueError("owned_messages_file_source_pending")
  value=block["image_url"]["url"]
  if value.startswith("data:"):
   header,data=value.split(",",1);source={"type":"base64","media_type":header[5:].split(";",1)[0],"data":data}
  else:source={"type":"url","url":value}
  return [{"type":"text","text":prompt},{"type":"image","source":source}]
 raise ValueError("family")
def wire_request(family,blocks,role="user"):
 # These are message/image fragments for the guide, not a complete provider schema.
 allowed={"chat":{"user","system","tool"},"messages":{"user"},"responses":{"user","developer"}}
 if role not in allowed.get(family,set()):raise ValueError("owned_role_subset")
 key="input" if family=="responses" else "messages"
 request={"model":"deepseek-flash",key:[{"role":role,"content":copy.deepcopy(blocks)}]}
 if family=="messages":request["max_tokens"]=256
 return request
def wire_bytes(value):return json.dumps(value,ensure_ascii=False,separators=(",",":")).encode("utf8")
def bounds(*,count,width,height,image_bytes,request_bytes,total_bytes,has_file_id=False):
 if count<1 or count>600:return "count"
 if max(width,height)>(4096 if count>=15 else 8192):return "dimension"
 if image_bytes>(64 if has_file_id else 32)*MIB:return "single_image"
 if request_bytes>48*MIB:return "request_body"
 if total_bytes>(200 if has_file_id else 64)*MIB:return "aggregate"
 return "accepted_by_owned_checks"
def upload_fields(purpose,seconds=None):
 if purpose not in ("user_data","text_recognition","rich_layout_recognition"):raise ValueError("purpose")
 fields=[("purpose",purpose)]
 if seconds is not None:
  if type(seconds) is not int or not 3600<=seconds<=2592000:raise ValueError("expiry")
  fields.extend([("expires_after[anchor]","created_at"),("expires_after[seconds]",str(seconds))])
 return fields
def observe():
 cases=[]
 def add(name,input,expected,actual,operation):
  if actual!=expected:raise AssertionError((name,expected,actual))
  cases.append(dict(name=name,input=input,preconditions="Owned RGB8 filter-0 PNG or explicitly inert numeric boundary metadata; no account/endpoint.",
   operation=operation,expected=expected,actual=actual,passed=True))
 def error(fn):
  try:fn()
  except ValueError as e:return str(e)
  raise AssertionError("expected failure")
 fixture=png();meta=inspect_png(fixture)
 add("actual_PNG_bytes",{"bytes":len(fixture),"sha256":meta["sha256"]},[2,1,"image/png"],[meta["width"],meta["height"],meta["mime"]],"Validate CRC, inflate and owned RGB8 scanline profile.")
 broken=bytearray(fixture);broken[30]^=1
 add("CRC_corruption",{"changed_offset":30},"crc",error(lambda:inspect_png(bytes(broken))),"Parse corrupted bytes without relying on a filename.")
 block=image_block(raw=fixture)
 encoded=block["image_url"]["url"].split(",",1)[1]
 add("base64_roundtrip",{"raw_sha256":meta["sha256"]},fixture.hex(),base64.b64decode(encoded,validate=True).hex(),"Encode original bytes, decode strict base64 and compare every byte.")
 add("base64_character_count",{"raw_bytes":len(fixture)},4*((len(fixture)+2)//3),len(encoded),"Compare actual base64 length with block padding formula.")
 for family in ("chat","messages","responses"):
  parts=content(family,block,"核对蓝色图块")
  request=wire_request(family,parts);raw=wire_bytes(request);recovered=json.loads(raw)
  key="input" if family=="responses" else "messages"
  add(family+"_ordered_blocks",{"payload_sha256":hashlib.sha256(raw).hexdigest()},["text","image"],
   ["text" if x["type"] in ("text","input_text") else "image" for x in recovered[key][0]["content"]],"Serialize UTF-8 JSON and parse actual content order; no HTTP.")
 add("UTF8_bytes_differ_from_characters",{"prompt":"蓝色"},True,len(wire_bytes({"text":"蓝色"}))>len(wire_bytes({"text":"蓝色"}).decode("utf8")),"Measure final UTF-8 bytes rather than character count.")
 for detail in ("low","high","original","auto"):
  add("detail_"+detail,{"detail":detail},detail,image_block(raw=fixture,detail=detail)["image_url"]["detail"],"Inspect independently built image_url detail field; no image scaling or token measurement.")
 add("mutually_exclusive_sources",{}, "one_image_source",error(lambda:image_block(raw=fixture,url="https://example.com/i.png")),"Reject ambiguous owned builder arguments before serialization.")
 add("file_id_filename_mutex",{}, "file_identity_fields",error(lambda:image_block(file_id="owned-inert-id",filename="x.png")),"Do not attach filename to file_id.")
 inline=image_block(file_data=block["image_url"]["url"],filename="owned.png")
 add("inline_file_fields",{},["file","owned.png"],[inline["type"],inline["filename"]],"Build file_data variant without claiming an upload exists.")
 add("Responses_file_id",{},{"type":"input_image","file_id":"owned-inert-id"},content("responses",image_block(file_id="owned-inert-id"),"x")[1],"Inspect file_id field; sample identity is deliberately inert.")
 for family in ("chat","responses"):
  add(family+"_assistant_rejected",{},"owned_role_subset",error(lambda:wire_request(family,[],"assistant")),"Apply the explicitly implemented local role subset, not a server response.")
 url="https://example.com/"+("a"*(8192-len("https://example.com/")))
 add("URL_8192",{"length":8192},8192,len(image_block(url=url)["image_url"]["url"]),"Build a syntactically allowed length; no URL download or DNS.")
 add("URL_8193",{"length":8193},"url_shape",error(lambda:image_block(url=url+"a")),"Check local URL length only.")
 base=dict(count=1,width=2,height=1,image_bytes=len(fixture),request_bytes=len(wire_bytes(wire_request("chat",content("chat",block,"x")))),total_bytes=len(fixture))
 large=inspect_png(png(8192,1))
 for count,expected in [(14,"accepted_by_owned_checks"),(15,"dimension")]:
  values={**base,"count":count,"width":large["width"],"height":large["height"]}
  add("actual_8192px_PNG_count_"+str(count),values,expected,bounds(**values),"Read actual owned PNG dimensions and evaluate count-dependent rule; no upload.")
 for label,changes,expected in [
  ("count_600",{"count":600},"accepted_by_owned_checks"),("count_601",{"count":601},"count"),
  ("body_48MiB",{"request_bytes":48*MIB},"accepted_by_owned_checks"),("body_over_48MiB",{"request_bytes":48*MIB+1},"request_body"),
  ("raw_32MiB",{"image_bytes":32*MIB},"accepted_by_owned_checks"),("raw_over_32MiB",{"image_bytes":32*MIB+1},"single_image"),
  ("file_64MiB",{"image_bytes":64*MIB,"has_file_id":True},"accepted_by_owned_checks"),
  ("total_200MiB",{"total_bytes":200*MIB,"has_file_id":True},"accepted_by_owned_checks"),
  ("total_over_200MiB",{"total_bytes":200*MIB+1,"has_file_id":True},"aggregate")]:
  values={**base,**changes};add("numeric_"+label,values,expected,bounds(**values),"Evaluate explicitly inert numeric manifest metadata; no file of this size was allocated/uploaded.")
 for seconds in (3600,2592000):
  fields=upload_fields("user_data",seconds)
  add("expiry_"+str(seconds),{"seconds":seconds},[["purpose","user_data"],["expires_after[anchor]","created_at"],["expires_after[seconds]",str(seconds)]],[list(x) for x in fields],"Construct ordered upload field plan; multipart body and upload not performed.")
 add("expiry_under_minimum",{"seconds":3599},"expiry",error(lambda:upload_fields("user_data",3599)),"Reject local expiry value outside current documented range.")
 add("document_purpose_before_file",{}, "rich_layout_recognition",upload_fields("rich_layout_recognition")[0][1],"Construct purpose-first field plan; no document parsing.")
 path=Path(__file__).resolve();digest=hashlib.sha256(path.read_bytes()).hexdigest()
 for case in cases:case["test_source"]={"path":path.name,"sha256":digest}
 return dict(cases=cases,version="Python"+sys.version.split()[0],binary_sha256=hashlib.sha256(Path(sys.executable).read_bytes()).hexdigest(),
  guide_snapshot=GUIDE_DATE,source_sha256=digest,fixture_sha256=meta["sha256"],owned_decoder_profile="RGB8 noninterlaced PNG with filter0 only; not a general media decoder",
  scope="Owned offline encoding, JSON, field and numeric boundary observations only. Not DSH/SDK/provider execution, OCR, model accuracy, API400, upload, download, token or billing proof.",
  model_requests=0,network_requests=0,source_tutorial_scripts_executed=False,real_uploads=0,real_file_deletes=0,DSH_application_executed=False)
if __name__=="__main__":
 parser=argparse.ArgumentParser();parser.add_argument("--fixture-output",type=Path);args=parser.parse_args()
 if args.fixture_output:args.fixture_output.write_bytes(png())
 print(json.dumps(observe(),ensure_ascii=False))
预期结果 · 待实际运行核验
  • Python3.12实际观察35项离线子目标,包含真实PNG/base64/UTF-8及明确标注的惰性边界数据。没有模型、OCR、真实API400或上传结果。
构造并核对独立图片请求片段

所需环境:Windows、Python3.12标准库;完全离线,无第三方SDK、真实密钥或模型。

当前源码 SHA256:ddfd6fbdc99c6d09f9dddff5f9239c918f1b05466fc6371bfe49ad57156f0b5c

下载本站示例源码

解压后检查输入片段

四文件含独立Python代码、自编2×1 PNG、README与SOURCES哈希。原始截图附件与私有全文不在包内。

下载本站多模态请求离线观察工程

所需环境:Windows、Python3.12标准库;完全离线,无第三方SDK、真实密钥或模型。

ZIP SHA256:10410c390213d351a06a1e32628483bb3e6b81c2213f4f587654c603ad83f21c

常见错误与边界

  • 更新客户端不等于云端模型或视觉任务成功。
  • 消息角色、内容块与文件字段按具体API区分。
  • base64字符数、请求UTF-8字节和图片token不能混用。
  • 样本file_id不是已上传文件。
  • 本地检查通过不等服务端400/模型或计费验证。

练习与解答

为什么35项本地检查都符合预期,也不能说模型已经看懂图片?

展开参考解答

这些观察只证明独立代码对固定输入的字节、JSON和边界处理。服务端取图、模型理解、真实Schema和费用需要另外的真实请求与证据,示意输出和惰性file_id不能替代。

规范与官方依据