mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-17 22:14:28 +01:00
Add documentation
This commit is contained in:
@@ -7,6 +7,7 @@ agents = {} # key, (task, full_message_history, model)
|
||||
|
||||
|
||||
def create_agent(task, prompt, model):
|
||||
"""Create a new agent and return its key"""
|
||||
global next_key
|
||||
global agents
|
||||
|
||||
@@ -34,6 +35,7 @@ def create_agent(task, prompt, model):
|
||||
|
||||
|
||||
def message_agent(key, message):
|
||||
"""Send a message to an agent and return its response"""
|
||||
global agents
|
||||
|
||||
task, messages, model = agents[int(key)]
|
||||
@@ -57,6 +59,7 @@ def message_agent(key, message):
|
||||
|
||||
|
||||
def list_agents():
|
||||
"""Return a list of all agents"""
|
||||
global agents
|
||||
|
||||
# Return a list of agent keys and their tasks
|
||||
@@ -64,6 +67,7 @@ def list_agents():
|
||||
|
||||
|
||||
def delete_agent(key):
|
||||
"""Delete an agent and return True if successful, False otherwise"""
|
||||
global agents
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user