Set your OpenAI API key as an environment variable:
Copy
export OPENAI_API_KEY=your_api_key_here
3
Create Script
Create a new file shopping_assistant.py:
Copy
from praisonaiagents import Agent, Toolsfrom praisonaiagents.tools import duckduckgo# Create Shopping Agentshopping_agent = Agent( name="ShoppingAssistant", role="Shopping Specialist", goal="Find the best prices and deals across stores", instructions="You are a Shopping Agent", tools=[duckduckgo])# Search for product pricesresponse = shopping_agent.start( "I want to buy iPhone 16 Pro Max, check 5 stores and give me price in table")# Save price comparisonwith open('price_comparison.md', 'w') as f: f.write(response)
# Example: Compare product pricesfrom praisonaiagents import Agent, Toolsfrom praisonaiagents.tools import duckduckgoagent = Agent(instructions="You are a Shopping Agent", tools=[duckduckgo])agent.start("I want to buy iPhone 16 Pro Max, check 5 stores and give me price in table")