Files
PraisonAI/examples/python/input/simple_input.py
T
2026-01-31 08:34:24 +00:00

30 lines
799 B
Python

"""
Simple Input Example for PraisonAI
This example demonstrates how to use basic user input to create dynamic agents and tasks.
The user is prompted for a search query, and the agent searches for information about it.
"""
from praisonaiagents import Agent, Task, AgentTeam
# Get user input
user_query = input("What would you like to search for? ")
# Create agent
agent = Agent(
name="SearchAgent",
role="Information Finder",
goal="Find information about user's query",
backstory="Expert researcher with web access"
)
# Create task with dynamic input
task = Task(
description=f"Search for information about: {user_query}",
expected_output=f"Summary of findings about {user_query}",
agent=agent
)
# Run
agents = AgentTeam(agents=[agent], tasks=[task])
agents.start()