MIRIX
MIRIX copied to clipboard
0.1.6版本添加多模态数据异常
使用最新的0.1.6版本框架,模型使用gpt4o,添加图片信息时,好像只能识别文字信息。 查看前端面板,给LLM发送的请求只包含文字部分 运行代码:
# 1. 创建 MirixClient
client = MirixClient(
api_key="xxx",
base_url="http://localhost:8531",
client_name="My Client Application",
client_scope="Sales",
org_id="my-org",
debug=False
)
# 2. 创建或获取用户
user_id = client.create_or_get_user(
user_id="demo-user",
user_name="Demo User"
)
# 3. 初始化 meta agent
config = yaml.safe_load(open("./configs/mirix_custom_model.yaml"))
client.initialize_meta_agent(
config=config,
update_agents=True,
)
# 4. 添加包含图片的信息
image_path = Path("/Users/xxx/Desktop/project/MIRIX/tests/logo.png")
data_url = encode_image_to_data_url(image_path)
result = client.add(
user_id=user_id,
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "我很喜欢这家公司,公司logo如图。"
},
{
"type": "image_data",
"image_data": {
"data": data_url,
"detail": "high"
}
}
]
}
],
chaining=True
)
print(f"Success: {result.get('success')}")
Thanks for bringing this up! We have fixed it in the newest commit in main branch, please check it out, thanks!
It would include the image id like this when showing into the dashboard, but the model will be able to see the original image
Thanks, the problem has been fixed.