Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Python: [Bug]: OllamaChatClient sends non-image data content to Ollama as images

Đã đóng
#8,916 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@eavanvalkenburg đang làm issue này rồi.

Từ ngày 30/9/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

agents python reproduced
Description

OllamaChatClient._format_user_message checks if any data content is an image, but then sends all data content as images. So a message with an image and a PDF incorrectly sends the PDF to Ollama as an image.

Code Sample
from agent_framework import Content, Message
from agent_framework_ollama import OllamaChatClient
client = OllamaChatClient(model="llava")
msg = Message(role="user", contents=[
    "describe",
    Content.from_uri(uri="data:image/png;base64,SU1H", media_type="image/png"),
    Content.from_uri(uri="data:application/pdf;base64,UERG", media_type="application/pdf"),
])
print(client._prepare_messages_for_ollama([msg]))
# images=['SU1H', 'UERG'] -> the PDF is sent as an image
Error Messages / Stack Traces
No error is raised by the framework. The PDF is silently included in the `images` list sent to Ollama, which then fails later with an image-decoding error or produces an unrelated answer.
Package Versions

agent-framework-core: 1.19.0, agent-framework-ollama: 1.0.0b260813 (current main), ollama: 0.5.3

Python Version

Python 3.11.15

Additional Context

No response

Ngôn ngữ chính
Python
Star
14k
Fork
2.5k
Merge trung bình
2 ngày 10 giờ
Pull request đã merge (30 ngày)
424

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/agent-framework

Tất cả issue của microsoft/agent-framework

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.