mirror of
https://github.com/MervinPraison/PraisonAI.git
synced 2026-11-07 12:47:55 -10:00
Added multiple examples demonstrating the creation and management of agents, environments, sessions, and custom tools in the managed agents architecture. This comprehensive set of examples now includes functionalities such as tool selection, disabling tools, and updating agent configurations, providing users with clear guidance on utilizing the framework effectively.
26 lines
766 B
Python
26 lines
766 B
Python
from praisonai import Agent, ManagedAgent, ManagedConfig
|
|
|
|
# Disable specific tools: web access disabled, everything else stays on
|
|
managed = ManagedAgent(
|
|
config=ManagedConfig(
|
|
name="No Web Agent",
|
|
model="claude-haiku-4-5",
|
|
system="You are a coding assistant. You cannot access the web.",
|
|
tools=[
|
|
{
|
|
"type": "agent_toolset_20260401",
|
|
"configs": [
|
|
{"name": "web_fetch", "enabled": False},
|
|
{"name": "web_search", "enabled": False},
|
|
],
|
|
},
|
|
],
|
|
),
|
|
)
|
|
|
|
agent = Agent(name="no-web-agent", backend=managed)
|
|
result = agent.start("Write a hello world Python script and run it")
|
|
|
|
print(result)
|
|
print("\nAgent finished.")
|