# Define an asynchronous function that simulates some asynchronous task (e.g., I/O operation)asyncdefmy_asynchronous_function():print("Start asynchronous function")awaitasyncio.sleep(2)# Simulate some asynchronous task (e.g., I/O operation)print("End asynchronous function")return"input"# Define a custom class `CustomisedUserProxyAgent` that extends `UserProxyAgent`classCustomisedUserProxyAgent(UserProxyAgent):# Asynchronous function to get human inputasyncdefa_get_human_input(self,prompt:str)->str:# Call the asynchronous function to get user input asynchronouslyuser_input=awaitmy_asynchronous_function()returnuser_input# Asynchronous function to receive a messageasyncdefa_receive(self,message:Union[Dict,str],sender,request_reply:Optional[bool]=None,silent:Optional[bool]=False,):# Call the superclass method to handle message reception asynchronouslyawaitsuper().a_receive(message,sender,request_reply,silent)classCustomisedAssistantAgent(AssistantAgent):# Asynchronous function to get human inputasyncdefa_get_human_input(self,prompt:str)->str:# Call the asynchronous function to get user input asynchronouslyuser_input=awaitmy_asynchronous_function()returnuser_input# Asynchronous function to receive a messageasyncdefa_receive(self,message:Union[Dict,str],sender,request_reply:Optional[bool]=None,silent:Optional[bool]=False,):# Call the superclass method to handle message reception asynchronouslyawaitsuper().a_receive(message,sender,request_reply,silent)
nest_asyncio.apply()asyncdefmain():boss=CustomisedUserProxyAgent(name="boss",human_input_mode="ALWAYS",max_consecutive_auto_reply=0,code_execution_config=False,)assistant=CustomisedAssistantAgent(name="assistant",system_message="You will provide some agenda, and I will create questions for an interview meeting. Every time when you generate question then you have to ask user for feedback and if user provides the feedback then you have to incorporate that feedback and generate new set of questions and if user don't want to update then terminate the process and exit",llm_config=create_llm_config("gpt-4","0.4","23"),)awaitboss.a_initiate_chat(assistant,message="Resume Review, Technical Skills Assessment, Project Discussion, Job Role Expectations, Closing Remarks.",n_results=3,)awaitmain()