Agents

Agents, represented by Agent class, are the basic building blocks of the EDSL. They are the entities that stand-in for humans.

Agent class

AgentList class

They can also be grouped together in an AgentList

Invigilator class

The administration of Questions is managed by an Invigilator.

Module for creating Invigilators, which are objects to administer a question to an Agent.

class edsl.agents.Invigilator.InvigilatorAI(agent, question, scenario, model, memory_plan, current_answers: dict, iteration: int = 1)

Bases: InvigilatorBase

An invigilator that uses an AI model to answer questions.

answer_question(failed=False) AgentResponseDict

Answer a question using the AI model.

async async_answer_question(failed=False) AgentResponseDict

Answer a question using the AI model.

async async_get_response(user_prompt: Prompt, system_prompt: Prompt, iteration: int = 1)

Call the LLM and gets a response. Used in the answer_question method.

construct_system_prompt() Prompt

Construct the system prompt for the LLM call.

construct_user_prompt() Prompt

Construct the user prompt for the LLM call.

get_prompts() Dict[str, Prompt]

Get both prompts for the LLM call.

get_question_instructions() Prompt

Get the instructions for the question.

get_response(user_prompt: Prompt, system_prompt: Prompt, iteration: int = 1)

Call the LLM and gets a response. Used in the answer_question method.

class edsl.agents.Invigilator.InvigilatorBase(agent, question, scenario, model, memory_plan, current_answers: dict, iteration: int = 1)

Bases: ABC

An invigiator (someone who administers an exam) is a class that is responsible for administering a question to an agent.

answer_question(**kwargs)
abstract async async_answer_question()

Asnwer a question.

create_memory_prompt(question_name)

Create a memory for the agent.

classmethod example()

Return an example invigilator.

get_failed_task_result() AgentResponseDict

Return an AgentResponseDict used in case the question-askinf fails.

get_prompts() Dict[str, Prompt]

Return the prompt used.

class edsl.agents.Invigilator.InvigilatorDebug(agent, question, scenario, model, memory_plan, current_answers: dict, iteration: int = 1)

Bases: InvigilatorBase

An invigilator class for debugging purposes.

async async_answer_question(iteration: int = 0) AgentResponseDict

Return the answer to the question.

get_prompts() Dict[str, Prompt]

Return the prompts used.

class edsl.agents.Invigilator.InvigilatorFunctional(agent, question, scenario, model, memory_plan, current_answers: dict, iteration: int = 1)

Bases: InvigilatorBase

A Invigilator for when the question has a answer_question_directly function.

async async_answer_question(iteration: int = 0) AgentResponseDict

Return the answer to the question.

get_prompts() Dict[str, Prompt]

Return the prompts used.

class edsl.agents.Invigilator.InvigilatorHuman(agent, question, scenario, model, memory_plan, current_answers: dict, iteration: int = 1)

Bases: InvigilatorBase

An invigilator for when a human is answering the question.

async async_answer_question(iteration: int = 0) AgentResponseDict

Return the answer to the question.