from agent_diff import AgentDiff, PythonExecutorProxy, create_smolagents_toolfrom smolagents import CodeAgent, HfApiModel# Initialize client and environmentclient = AgentDiff()env = client.init_env( templateService="slack", templateName="slack_default", impersonateUserId="U01AGENBOT9")# Create executor and smolagents toolpython_executor = PythonExecutorProxy(env.environmentId, base_url=client.base_url)python_tool = create_smolagents_tool(python_executor)# Create agentmodel = HfApiModel("Qwen/Qwen2.5-72B-Instruct")agent = CodeAgent( tools=[python_tool], model=model, system_prompt="""You are a Slack assistant. Use the execute_python tool to interact with Slack API at https://slack.com/api/*. Authentication is handled automatically.""")# Start run and executerun = client.start_run(envId=env.environmentId)result = agent.run("Post 'Hello World!' to #general")# Get diffdiff = client.diff_run(runId=run.runId)print(diff.diff['inserts'])# Cleanupclient.delete_env(envId=env.environmentId)