import asynciofrom praisonaiagents import Agentfrom praisonai.integrations.managed_agents import ManagedAgent, ManagedConfigmanaged = ManagedAgent( provider="local", config=ManagedConfig( model="gpt-4o-mini", system="You are a Python developer. Use the E2B sandbox to run and test code." ), compute="e2b")agent = Agent(name="python-dev", backend=managed)# Provision sandboxinfo = asyncio.run(managed.provision_compute())# LLM can execute code in the sandboxresult = agent.start( "Write a Python script that downloads a JSON file from an API, processes it, and shows statistics", stream=True)# Multi-turn with persistent sandboxresult2 = agent.start( "Now modify that script to save the results to a CSV file", stream=True)# Clean upasyncio.run(managed.shutdown_compute())
import asynciofrom praisonaiagents import Agentfrom praisonai.integrations.managed_agents import ManagedAgent, ManagedConfigmanaged = ManagedAgent( provider="local", config=ManagedConfig( model="gpt-4o-mini", system="You are a data scientist. Use Python for analysis and visualization." ), compute="e2b")agent = Agent(name="data-scientist", backend=managed)# Provision for data scienceinfo = asyncio.run(managed.provision_compute())# Install data science packages if neededasyncio.run(managed.execute_in_compute("pip install pandas matplotlib seaborn"))# Analyze dataresult = agent.start("""Analyze this sales data and create a visualization:January: 1000February: 1200March: 800April: 1500May: 1300""", stream=True)
import asynciofrom praisonaiagents import Agentfrom praisonai.integrations.managed_agents import ManagedAgent, ManagedConfigmanaged = ManagedAgent( provider="local", config=ManagedConfig( model="gpt-4o-mini", system="You are an API testing expert." ), compute="e2b")agent = Agent(name="api-tester", backend=managed)# Test REST APIsinfo = asyncio.run(managed.provision_compute())result = agent.start("""Test these REST API endpoints and report status:1. GET https://api.github.com/users/octocat2. GET https://jsonplaceholder.typicode.com/posts/13. GET https://httpbin.org/getShow response codes, headers, and sample data for each.""")