Solved. I used the next code.
text_input = session.TextInput(text=message)
query_input = session.QueryInput(text=text_input, language_code=language_code)
params = {
"session_id": session_id
}
query_params = session.QueryParameters(parameters=params)
request = session.DetectIntentRequest(
session=session_path, query_input=query_input, query_params=query_params
)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…