baseline setup of agent abstract

This commit is contained in:
2025-11-04 18:05:01 +01:00
parent 811c4334e1
commit 8072e9567e
4 changed files with 57 additions and 0 deletions

View File

@@ -0,0 +1 @@
"""Agentic behavior runner for PHANTOM research platform."""

View File

@@ -0,0 +1,26 @@
from base import Agent
class GenericComputerUseAgent(Agent):
# TODO: implement code using computer-use library
"""
async def do_job(jtbd):
browser = Browser(headless=True)
llm = ChatOpenAI(model="gpt-5-mini")
task = "You are an agent for doing anything on http://localhost:3000 (wait for the website to load) for the user. The user wants you to do the following job: "+jtbd + ". Use the browser to do it. Be careful to follow all instructions and complete the job fully. You have the power to purchase or to do anything."
agent = Agent(task=task, llm=llm, browser=browser)
return await agent.run()
if __name__ == "__main__":
JTBD= "Book the best room"
R=asyncio.run(do_job(JTBD))
print(R.final_result())
"""
pass
def get_agent():
# construct
pass

View File

@@ -0,0 +1,27 @@
import asyncio
class Agent:
def __init__(self,
goal : str = "Get Information on All Prices",
environment_url : str = "https://www.example.com",
timeout : int = 60 * 5):
self.goal = goal
self.environment_url = environment_url
self.timeout = timeout
self.result = None
# TODO: implement agent initialization
pass
async def act(self):
# set the self.result to whatever text result the agents returns
pass # return await _async_method()
def final_result(self) -> str|None:
return self.result
# asyncio.run(Agent(...).act())
if __name__ == "__main__":
print("Testing Agent...")
agent = Agent(goal="Find the best price for a laptop", environment_url="https://www.example.com")
asyncio.run(agent.act())
print(f"Agent Result: {agent.final_result()}")

View File

@@ -0,0 +1,3 @@
import pytest
from agent import get_agent