def search_messages(session, thread_id, query, limit=<NUM_LIT:20>,<EOL>offset=<NUM_LIT:0>, message_context_details=None,<EOL>window_above=None, window_below=None):
query = {<EOL>'<STR_LIT>': thread_id,<EOL>'<STR_LIT>': query,<EOL>'<STR_LIT>': limit,<EOL>'<STR_LIT>': offset<EOL>}<EOL>if message_context_details:<EOL><INDENT>query['<STR_LIT>'] = message_context_details<EOL><DEDENT>if window_above:<EOL><INDENT>query['<STR_LIT>'] = window_above<EOL><DEDENT>if window_below:<EOL><INDENT>query['<STR_LIT>'] = window_below<EOL><DEDENT>response = make_get_request(session, '<STR_LIT>', params_data=query)<EOL>json_data = response.json()<EOL>if response.status_code == <NUM_LIT:200>:<EOL><INDENT>return json_data['<STR_LIT:result>']<EOL><DEDENT>else:<EOL><INDENT>raise MessagesNotFoundException(<EOL>message=json_data['<STR_LIT:message>'],<EOL>error_code=json_data['<STR_LIT>'],<EOL>request_id=json_data['<STR_LIT>']<EOL>)<EOL><DEDENT>
Search for messages