Yea, **kwargs need better handling, it's on the todo list
What chat engine are you using? You can create initialize it from the actual chat engine class. The kwargs you are passing will go into the query engine π
from llama_index.agent import OpenAIAgent
from llama_index.tools.query_engine import QueryEngineTool
# convert query engine to tool
query_engine = index.as_query_engine(...)
query_engine_tool = QueryEngineTool.from_defaults(query_engine=query_engine)
# create agent/chat engine
agent = OpenAIAgent.from_tools(tools=[query_engine_tool], llm=llm)