In addition to the general instructions for using an agent,
this page describes features that are specific to LlamaIndexQueryPipelineAgent
.
Before you begin
This tutorial assumes that you have read and followed the instructions in:
- Develop a LlamaIndexQueryPipeline agent: to develop
agent
as an instance ofLlamaIndexQueryPipelineAgent
. - User authentication to authenticate as a user for querying the agent.
Supported operations
The following operations are supported for LlamaIndexQueryPipelineAgent
:
query
: for getting a response to a query synchronously.
The query
method supports the following type of argument:
input
: the messages to be sent to the agent.
Query the agent
The command:
agent.query(input="What is Paul Graham's life in college?")
is equivalent to the following (in full form):
agent.query(input={"input": "What is Paul Graham's life in college?"})
To customize the input dictionary, see Customize the prompt template.
You can also customize the agent's behavior beyond input
by passing additional keyword arguments to query()
.
response = agent.query(
input={
"input" = [
"What is Paul Graham's life in college?",
"How did Paul Graham's college experience shape his career?",
"How did Paul Graham's college experience shape his entrepreneurial mindset?",
],
},
batch=True # run the pipeline in batch mode and pass a list of inputs.
)
print(response)
See the QueryPipeline.run
code for a complete list of available parameters.