Find answers from the community

Updated 3 months ago

Hello team. My question is could we use

Hello team. My question is could we use chat_engine with SubQuestionQueryEngine?
if yes please send me an example url. thanks
A
L
12 comments
i've created a lot of indexes with SubQuestionQueryEngine and it works fine with query.
now i want to make it as chat_engine.
How can we do it?
You'll need to pass the query engine to an agent or condense question chat engine and build it from the constructor, rather than as_chat_engine

https://docs.llamaindex.ai/en/stable/examples/agent/openai_agent_with_query_engine.html
thanks @Logan M which function we will use with agent for query from the user?

text = data['message'] agent = OpenAIAgent.from_tools(query_engine_tools, verbose=True) response = agent.chat(text)

it gives me the error. how can we query it?
Error:
openai.error.InvalidRequestError: '2611 inventory' does not match '^[a-zA-Z0-9_-]{1,64}$' - 'functions.2.name'
here is my query_engine_tools
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)
The names cant have spaces it seems
openai.error.InvalidRequestError: '224#200inventory' does not match '^[a-zA-Z0-9_-]{1,64}$' - 'functions.2.name'


still the same error with nospace @Logan M
You can't have # either -- the error is a regex stating the allowed characters [a-zA-Z0-9_-]
thanks @Logan M
@Logan M hi one more question here.
how can we gave the message history like last few messages for better context.
and it still not remember the last messages.
Add a reply
Sign up and join the conversation on Discord