Skip to content

修改langchain原始页面,可以显示3D结构文件

License

Notifications You must be signed in to change notification settings

SQAgent/agent-chat-ui

Repository files navigation

UPDATE

优化AImessage渲染模块使其支持图片输出和3D文件可视化。当前仅支持STL文件 需额外运行:

pnpm install three @react-three/fiber @react-three/drei --force

LangGraph 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

Error: Could not load potsdamer_platz_1k.hdr: NetworkError when attempting to fetch resource.

该错误与STLViewer.tsx文件有关。

About

修改langchain原始页面,可以显示3D结构文件

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published