paper-qa
paper-qa copied to clipboard
DIfference between 'ask' function and 'doc.query' ?
Hello,
What is the difference between 'ask' function and 'doc.query' function from behavior point of view?
Best regards. @dosa.
The 'ask' function and the 'doc.query' function differ in their behavior:
-
'ask' Function: This is a convenience wrapper that uses the
SearchPaperstool to query a local index of files. It's designed for quick and straightforward queries with configurable settings like temperature and paper directory. -
'doc.query' Function: Part of the
Docsobject interface, this function allows for more control. You can manually add documents and query them, offering flexibility with settings like the maximum number of sources for answers.
In summary, 'ask' is for quick queries, while 'doc.query' provides more control over document management and querying [1].
To continue talking to Dosu, mention @dosu.
Hi @Snikch63200 the docs.query method will query based on the current papers/objects that have been added into the docs object. All docs you'd like to use need to be added with docs.add. ask is an agentic workflow which first finds relevant papers via keyword searches, parses and adds them into an underlying docs object, then calls docs.query for you, without you needing to manually add each paper.