please install flaml[openai] option to use the flaml.autogen.oai subpackage.
My code always has this error, but shows that flaml has been installed, even if I reinstall it using the python virtual environment it still has the same error! my code : from flaml import autogen from ***** import get_user_taskinfo from ***** import user_context
def autogentask(task: str): #from flaml import autogen
user_data = user_context.get() user_path = user_data["user_path"] # create an AssistantAgent instance named "assistant" assistant = autogen.AssistantAgent(name="assistant")
create a UserProxyAgent instance named "user_proxy"
user = autogen.UserProxyAgent( name="user assistant", human_input_mode="NEVER", # in this mode, the agent will never solicit human input but always auto reply max_consecutive_auto_reply=5, code_execution_config={"work_dir": user_path}, system_message="You are a helpful AI Assistant,You will do your best to complete the user's task in the least number of steps while maintaining quality", )
the assistant receives a message from the user, which contains the task description
user.initiate_chat( assistant, message=task, )
The autogen part has spined off to https://github.com/microsoft/autogen. Please install the new package.