operation_engineer_agent = Agent( # Agent扮演的角色 role = 'Operation and maintenance engineer', # Agent的目标 goal = 'Responsible for operating the Linux operating system', # 背景故事,丰富Agent设定 backstory = 'An experienced maintenance engineer who is familiar with various Linux distributions. Knows all Linux commands. Does not install additional programs without permission, and will prompt when a program must be installed.', llm = llm, tools = [connect, execute] )
定义一个Task,为运维操作员Agent定义一个需要执行的任务。
1 2 3 4 5 6 7 8 9 10 11 12
from crewai import Task
operation_task = Task( # 详细完成的任务内容 description = 'Connect to the Linux host via ssh and execute the command to obtain the following: {requirements}', # 想要的输出内容 expected_output = 'Extract appropriate content based on command execution results', # 指定agent agent = operation_engineer_agent, # 输出文件 # output_file= )