优化AImessage渲染模块使其支持图片输出和3D文件可视化。当前仅支持STL文件 需额外运行:
pnpm install three @react-three/fiber @react-three/drei --forceLangGraph agent 应该返回如下格式的 AI 消息:
import base64
def generate_response_with_stl():
# 读取 STL 文件
with open("model.stl", "rb") as f:
stl_bytes = f.read()
stl_base64 = base64.b64encode(stl_bytes).decode('utf-8')
# 返回包含 STL 的消息
return AIMessage(
content=[
{"type": "text", "text": "这是生成的 3D 模型:"},
{
"type": "file",
"source_type": "base64",
"mime_type": "model/stl",
"data": stl_base64,
"metadata": {"filename": "model.stl"}
}
]
)Error: Could not load potsdamer_platz_1k.hdr: NetworkError when attempting to fetch resource.
该错误与STLViewer.tsx文件有关。