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.
19 lines
608 B
Python
19 lines
608 B
Python
from praisonai import Agent, ManagedAgent, ManagedConfig
|
|
|
|
# Agent, environment, and session are all created automatically on first use
|
|
managed = ManagedAgent(
|
|
config=ManagedConfig(
|
|
name="Coding Assistant",
|
|
model="claude-haiku-4-5",
|
|
system="You are a helpful coding assistant. Write clean, well-documented code.",
|
|
session_title="Quickstart session",
|
|
),
|
|
)
|
|
|
|
agent = Agent(name="coder", backend=managed)
|
|
result = agent.start("Say hello")
|
|
|
|
print(f"Agent ID: {managed.agent_id}")
|
|
print(f"Environment ID: {managed.environment_id}")
|
|
print(f"Session ID: {managed.session_id}")
|