Skip to content

Add `response_schema` parameter to `Docs`'s aquery response generation

de6751f
Select commit
Loading
Failed to load commit list.
Open

Add response_schema parameter to Docs's aquery response generation #1202

Add `response_schema` parameter to `Docs`'s aquery response generation
de6751f
Select commit
Loading
Failed to load commit list.
Cursor / Cursor Bugbot completed Nov 14, 2025 in 1m 33s

Bugbot Review

Bugbot Analysis Progress (1m 35s elapsed)

✅ Gathered PR context (2s)
✅ Analyzed code changes (1s)
✅ Completed bug detection — 1 potential bug found (1m 25s)
✅ Validation and filtering completed (0s)
✅ Posted analysis results — 1 bug reported (7s)
✅ Analysis completed successfully (0s)

Final Result: Bugbot completed review and found 1 potential issue

Request ID: serverGenReqId_1e2f4900-7f62-447a-b117-2ad2089e3104

Details

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Bug: Synchronous method lacks schema feature parity.

The synchronous query method lacks the new response_schema parameter that was added to aquery, breaking the wrapper pattern where both methods should accept identical parameters. This prevents users of the synchronous method from using structured response schemas and causes a parameter mismatch between the wrapper and the underlying async implementation.

src/paperqa/docs.py#L744-L769

def query(
self,
query: PQASession | str,
settings: MaybeSettings = None,
callbacks: Sequence[Callable] | None = None,
llm_model: LLMModel | None = None,
summary_llm_model: LLMModel | None = None,
embedding_model: EmbeddingModel | None = None,
partitioning_fn: Callable[[Embeddable], int] | None = None,
) -> PQASession:
warnings.warn(
"The synchronous `query` method is being deprecated in favor of the"
" asynchronous `aquery` method, this deprecation will conclude in"
" version 6.",
category=DeprecationWarning,
stacklevel=2,
)
return get_loop().run_until_complete(
self.aquery(
query,
settings=settings,
callbacks=callbacks,
llm_model=llm_model,
summary_llm_model=summary_llm_model,
embedding_model=embedding_model,

Fix in Cursor Fix in Web


Comment @cursor review or bugbot run to trigger another review on this PR