Add support for application/json MIME type in agent document processing

Co-authored-by: wukaixingxp <17387054+wukaixingxp@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-09-10 20:49:53 +00:00
parent b80fb507a0
commit ff9fd7c4b5
2 changed files with 47 additions and 3 deletions

View file

@ -920,7 +920,7 @@ async def get_raw_document_text(document: Document) -> str:
DeprecationWarning,
stacklevel=2,
)
elif not (document.mime_type.startswith("text/") or document.mime_type == "application/yaml"):
elif not (document.mime_type.startswith("text/") or document.mime_type in ("application/yaml", "application/json")):
raise ValueError(f"Unexpected document mime type: {document.mime_type}")
if isinstance(document.content, URL):