glm、kimi等模型在alma里无法读取docx、pdf等文档

上传pdf或docx文件要求分析的时候报错:

kimi:
AI_APICallError: Invalid request: the message at position 1 with role 'user' contains an invalid part type: file

glm:

messages[1].content[1].type type error

(抱歉之前发错了,写的是 feature request, 但是没法修改了,所以又发了一遍)

猜测应该是:Kimi 和 GLM 对 PDF 的处理都不接受 Alma 当前这种 AI SDK 通用格式:

{ "type": "file", "mediaType": "application/pdf", "data": "data:application/pdf;base64,..." }

kimi应该是:

  • 调 /v1/files 上传文件,purpose=file-extract

  • 调 files.content(file_id) 取出解析后的文本

  • 把解析出的文本作为 system 或上下文 message 放进 /v1/chat/completions

glm应该是:

glm-5.1 官方页面标的是 输入模态:文本,不是文件。OpenClaw 官方配置里也把 glm-5.1 的 input 写成 ["text"]。 https://docs.bigmodel.cn/cn/guide/models/text/glm-5.1

Please authenticate to join the conversation.

Upvoters
Status

In Review

Board
🐛

Bug Reports

Date

About 1 hour ago

Author

Steven Chu

Subscribe to post

Get notified by email when there are changes.