feat(document_loaders): add SupadataLoader integration #450
+329
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a new
SupadataLoadertolangchain_community.document_loadersthat integrates with the Supadata Web & Video Data API.Key points:
SupadataLoaderdataclass inlibs/community/langchain_community/document_loaders/supadata.py.operation="transcript"– fetches media transcripts with options:lang(preferred language)text(plain text vs structured)mode("native" | "auto" | "generate")operation="metadata"– fetches structured media metadata.api_keyargument, or falls back to theSUPADATA_API_KEYenvironment variable.supadatais optional:_get_client.ImportErroris raised with an install hint ifsupadatais not installed.Documentobjects with:page_contentas transcript text or JSON-serialized metadata.metadataincludingsource,supadata_operation, and optionallang/mode.Documentwith an emptypage_contentand ajob_idstored inmetadata.Tests:
libs/community/tests/unit_tests/document_loaders/test_supadata_loader.py.metadataoperation callsSupadata.metadatawith the expected URL and params.transcriptoperation handles immediate transcript results (withcontent).transcriptoperation handles job-style results (withjob_id).api_keyoverSUPADATA_API_KEY.Issue
N/A – this is a new integration; not linked to an existing issue.
Dependencies
pyproject.toml.pip install supadatasupadatamodule and do not require the real service.Testing
From the
libs/communitydirectory:cd libs/community/tests/unit_tests/document_loaders uv run pytest test_supadata_loader.py