text = data['message']
agent = OpenAIAgent.from_tools(query_engine_tools, verbose=True)
response = agent.chat(text)
query_engine_tools = [
QueryEngineTool(
query_engine=policies_engine,
metadata=ToolMetadata(
name='policies',
description="Provide information about policies of the company"
"Use a detailed plain text question as input to the tool.",
)
),
QueryEngineTool(
query_engine=property_info_engine,
metadata=ToolMetadata(name='property',
description="Provide information about Property info sheets")
),
]
for engine_name, property_engine in property_engines.items():
cleaned_engine_name = engine_name.replace('-inventory-engine', '').replace('_', ' ')
tool_metadata = ToolMetadata(
name=f"{cleaned_engine_name} inventory",
description=f"Provide information about {cleaned_engine_name} inventory"
"Use a detailed plain text question as input to the tool."
)
query_tool = QueryEngineTool(query_engine=property_engine, metadata=tool_metadata)
query_engine_tools.append(query_tool)
s_engine = SubQuestionQueryEngine.from_defaults(
query_engine_tools=query_engine_tools)
[a-zA-Z0-9_-]