Skip to content

[Bug] When calling visual LLM such as GPT4o, the image URL cannot be called normally and no result is returned. #1878

@piwawa

Description

@piwawa

Contact Information

No response

MaxKB Version

1.8.1

Problem Description

调用视觉 LLM 如 GPT4o 时传入图片URL无法正常调用API,无返回结果

Steps to Reproduce

image

image

我添加了一个“图片理解”模型,结果上面 AI 模型无法导入

image

The expected correct result

应该在api调用时传入图片url可以正常识别并返回结果,目前传入图片url会报错

        user_messages = [{
            "role": "user",
            "content": [
            {
                "type": "text",
                "text": "识别以下图片"
            },
            {
                "type": "image_url",
                "image_url": {
                    "url": f"data:image/jpeg;base64,{base64_image}"
                }
            }
        ]
        }]
        completion = self.client.chat.completions.create(
            model="gpt-4o",
            messages=user_messages,
            stream=True
        )

Related log output

No response

Additional Information

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions