import asyncio
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from mirage import MountMode, RAMResource, Workspace
from mirage.agents.agno import MirageToolkit
ws = Workspace({"/data": RAMResource()}, mode=MountMode.WRITE)
agent = Agent(
model=OpenAIChat(id="gpt-4o"),
tools=[MirageToolkit(ws)],
instructions=("You have access to a virtual filesystem via shell "
"tools. Use them to explore and read files."),
markdown=True,
)
async def main() -> None:
await ws.execute('echo "hello from mirage" | tee /data/hello.txt')
await agent.aprint_response(
"List all files under /data and show the contents of each one.")
asyncio.run(main())