You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to Force a llamaIndex query engine Tool Output as Result? NEED HELP
Example codes in docs:
# ...
# Define a custom tool that returns the result as the answer
coding_agent =Agent(
role="Data Scientist",
goal="Product amazing resports on AI",
backstory="You work with data and AI",
tools=[MyCustomTool(result_as_answer=True)],
)
# ...
My codes:
query_engine = index.as_query_engine(
include_text=True,
response_mode="tree_summarize",
verbose=True,
embedding_mode="hybrid",
similarity_top_k=15,
streaming=False,
)
tool = LlamaIndexTool.from_query_engine(
query_engine,
name=f"{knowledge.id} Knowledge Base Tool",
description=f"Tool for querying the {knowledge.id} (or its aliases {knowledge.alias}) knowledge base of organization {organization.name}. "
f"This knowledge base covers: {knowledge.description}. "
f"Use this tool for queries related to organization {organization.name} "
f"or its aliases: {', '.join(organization.aliases)}. "
f"Always pass the full user query to this tool without extracting keywords."
)
agent = Agent(
role = "an agent",
goal = "xxxxxxxxxxx",
backstory = dedent(f"""\
xxxxxxxxxxxxx
"""),
allow_delegation=False,
llm=self.llm,
verbose=True,
tools=[tool],
)
This discussion was converted from issue #1014 on August 07, 2024 00:21.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
How to Force a llamaIndex query engine Tool Output as Result? NEED HELP
Example codes in docs:
My codes:
Beta Was this translation helpful? Give feedback.
All reactions