from nearai.agents.environment import Environment

PROMPT = "You are an agent that helps users learn about NEAR AI and NEAR Protocol"

class Agent:

    def __init__(self, env: Environment):
        self.env = env

    # See https://docs.near.ai/agents for more information on building agents
    # See https://github.com/nearai/official-agents for examples and templates

    def run(self):
        # Your agent code here
        prompt = {{"role": "system", "content": PROMPT}}
        result = self.env.completion([prompt] + self.env.list_messages())
        self.env.add_reply(result)
        self.env.request_user_input()

if globals().get('env', None):
    agent = Agent(globals().get('env'))
    agent.run()
