Skip to content

Support .md file in LLMFileAnalysisOperator - #71611

Merged
gopidesupavan merged 1 commit into
apache:mainfrom
jeff3071:md-support
Aug 23, 2026
Merged

gopidesupavan merged 1 commit into
apache:mainfrom
jeff3071:md-support

Conversation

@jeff3071

Copy link
Copy Markdown
Contributor

Why

LLMFileAnalysisOperator do not support .md file and return LLMFileAnalysisUnsupportedFormatError.

What

  • add md in SUPPORTED_FILE_FORMATS
  • update LLMFileAnalysisOperator docs

Test

Use the testing dag with self host LLM.

from pathlib import Path

from airflow.providers.common.ai.operators.llm_file_analysis import LLMFileAnalysisOperator
from airflow.providers.common.compat.sdk import dag, task

MARKDOWN_PATH = "/tmp/llm_file_analysis_repro.md"


@dag(
    dag_id="repro_llm_file_analysis_markdown",
    schedule=None,
    catchup=False,
    tags=["manual", "repro", "common-ai"],
)
def repro_llm_file_analysis_markdown():
    @task
    def create_markdown_file() -> str:
        Path(MARKDOWN_PATH).write_text(
            "# Incident report\n\nThe API returned HTTP 503 for five minutes.\n",
            encoding="utf-8",
        )
        return MARKDOWN_PATH

    markdown_path = create_markdown_file()

    LLMFileAnalysisOperator(
        task_id="analyze_markdown",
        prompt="Summarize the incident report.",
        llm_conn_id="pydanticai_default",
        file_path=markdown_path,
    )


repro_llm_file_analysis_markdown()

Log

Before

[2026-08-14 18:36:35] INFO - Preparing file analysis request for path=/tmp/llm_file_analysis_repro.md, file_conn_id=None, multi_modal=False, max_files=20, max_file_size_bytes=5242880, max_total_size_bytes=20971520, max_text_chars=100000, sample_rows=10
[2026-08-14 18:36:35] INFO - Resolved 1 file(s) from /tmp/llm_file_analysis_repro.md
[2026-08-14 18:36:35] ERROR - Task failed with exception
LLMFileAnalysisUnsupportedFormatError: Unsupported file format 'md' for /tmp/llm_file_analysis_repro.md. Supported formats: avro, csv, jpeg, jpg, json, log, parquet, pdf, png, txt.

After

[2026-08-14 19:05:40] INFO - Preparing file analysis request for path=/tmp/llm_file_analysis_repro.md, file_conn_id=None, multi_modal=False, max_files=20, max_file_size_bytes=5242880, max_total_size_bytes=20971520, max_text_chars=100000, sample_rows=10
[2026-08-14 19:05:40] INFO - Resolved 1 file(s) from /tmp/llm_file_analysis_repro.md
[2026-08-14 19:05:41] WARNING - You are using a Python version (3.10.20) which Google will stop supporting in new releases of google.api_core once it reaches its end of life (2026-10-04). Please upgrade to the latest Python version, or at least Python 3.11, to continue receiving updates for google.api_core past that date. category=FutureWarning
[2026-08-14 19:05:42] WARNING - You are using a Python version (3.10.20) which Google will stop supporting in new releases of google.cloud.secretmanager_v1 once it reaches its end of life (2026-10-04). Please upgrade to the latest Python version, or at least Python 3.11, to continue receiving updates for google.cloud.secretmanager_v1 past that date. category=FutureWarning
[2026-08-14 19:05:42] INFO - Validated byte limits for 1 file(s) before reading file contents; total_size_bytes=63.
[2026-08-14 19:05:43] INFO - Prepared file analysis request with 1 text file(s), 0 attachment(s), total_size_bytes=63.
[2026-08-14 19:05:43] INFO - Calling model for file analysis: files=1, attachments=0, text_files=1, total_size_bytes=63, omitted_files=0, text_truncated=False, multi_modal=False, sample_rows=10
[2026-08-14 19:05:43] INFO - Using explicit credentials for provider with model 'openai:Qwen/Qwen3-0.6B': ['api_key', 'base_url']

Was generative AI tooling used to co-author this PR?
  • Yes (Codex:GPT-5.6-sol)
    Generated-by: (Codex:GPT-5.6-sol) following the guidelines

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@uros-b

uros-b commented Aug 15, 2026

Copy link
Copy Markdown
Member

Thank you @jeff3071!

@gopidesupavan
gopidesupavan merged commit a4b6b77 into apache:main Aug 23, 2026
83 checks passed
imrichardwu pushed a commit to imrichardwu/airflow that referenced this pull request Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants