def detect_intent_stream(project_id, session_id, audio_file_path,<EOL>language_code):
import dialogflow_v2 as dialogflow<EOL>session_client = dialogflow.SessionsClient()<EOL>audio_encoding = dialogflow.enums.AudioEncoding.AUDIO_ENCODING_LINEAR_16<EOL>sample_rate_hertz = <NUM_LIT><EOL>session_path = session_client.session_path(project_id, session_id)<EOL>print('<STR_LIT>'.format(session_path))<EOL>def request_generator(audio_config, audio_file_path):<EOL><INDENT>query_input = dialogflow.types.QueryInput(audio_config=audio_config)<EOL>yield dialogflow.types.StreamingDetectIntentRequest(<EOL>session=session_path, query_input=query_input)<EOL>with open(audio_file_path, '<STR_LIT:rb>') as audio_file:<EOL><INDENT>while True:<EOL><INDENT>chunk = audio_file.read(<NUM_LIT>)<EOL>if not chunk:<EOL><INDENT>break<EOL><DEDENT>yield dialogflow.types.StreamingDetectIntentRequest(<EOL>input_audio=chunk)<EOL><DEDENT><DEDENT><DEDENT>audio_config = dialogflow.types.InputAudioConfig(<EOL>audio_encoding=audio_encoding, language_code=language_code,<EOL>sample_rate_hertz=sample_rate_hertz)<EOL>requests = request_generator(audio_config, audio_file_path)<EOL>responses = session_client.streaming_detect_intent(requests)<EOL>print('<STR_LIT:=>' * <NUM_LIT:20>)<EOL>for response in responses:<EOL><INDENT>print('<STR_LIT>'.format(<EOL>response.recognition_result.transcript))<EOL><DEDENT>query_result = response.query_result<EOL>print('<STR_LIT:=>' * <NUM_LIT:20>)<EOL>print('<STR_LIT>'.format(query_result.query_text))<EOL>print('<STR_LIT>'.format(<EOL>query_result.intent.display_name,<EOL>query_result.intent_detection_confidence))<EOL>print('<STR_LIT>'.format(<EOL>query_result.fulfillment_text))<EOL>
Returns the result of detect intent with streaming audio as input.

    Using the same `session_id` between requests allows continuation
    of the conversaion.