import superserve
from pydantic_ai import Agent
@superserve.tool(num_cpus=1)
def search_web(query: str) -> str:
"""Search the web for information."""
return f"Results for: {query}"
@superserve.tool(num_cpus=2, memory="4GB")
def analyze_data(data: str) -> dict:
"""Analyze data with heavy computation."""
return {"result": f"Analysis of {data}"}
def make_agent():
return Agent(
"openai:gpt-4o-mini",
system_prompt="You are a helpful assistant.",
tools=[search_web, analyze_data],
)
superserve.serve(make_agent, name="my-agent", num_cpus=1, memory="2GB")