Add optional TwelveLabs Pegasus video-QA tool#19
Open
mohit-twelvelabs wants to merge 1 commit into
Open
Conversation
|
@mohit-twelvelabs please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hi! I'm Mohit, I work at TwelveLabs (@mohit-twelvelabs).
This PR adds an optional TwelveLabs Pegasus video-understanding tool to the DVD agent.
What it adds
TwelveLabsPegasusServiceindvd/utils.py— a thin wrapper that uploads a local video as a TwelveLabs asset and calls Pegasus (analyze) to answer a prompt over an optional[start_time, end_time]window.pegasus_video_qa_toolindvd/build_database.py— a new agent tool, wired intoDVDCoreAgentnext to the existingframe_inspect_tool.dvd/config.py(USE_TWELVELABS_PEGASUS,TWELVELABS_PEGASUS_MODEL_NAME,TWELVELABS_PEGASUS_MAX_TOKENS).Why it helps DVD
DVD's deep-research QA loop reasons over very long videos by sampling still frames (
frame_inspect_tool) and searching clip captions. Pegasus complements this: instead of a handful of stills, it analyzes the actual video pixels server-side, so it can answer questions about motion, ordering of events, and detail between sampled frames — exactly the cases where frame sampling falls short. It's offered as one more tool the orchestrator can choose.Opt-in / non-breaking
TWELVELABS_API_KEYis set.twelvelabsSDK is an optional install, imported lazily only when the feature is used.How it was tested
tests/test_twelvelabs_pegasus.py): verify the opt-in gating logic and that the tool produces a valid function schema. These always run.TWELVELABS_API_KEY, skipped otherwise) uploads a public sample video and asserts a non-empty Pegasus answer. I ran it locally against the real API — it passed (upload + analyze round-trip ~36s).twelvelabs>=1.2.8SDK signatures (assets.create,analyze,VideoContext_AssetId, response.data) match the wrapper.Note on CLA
I understand microsoft/* repos use the Microsoft CLA bot; happy to sign it on this PR.
You can grab a free API key at https://twelvelabs.io — there's a generous free tier.