Reddit PraisonAI Integration
Copy
export REDDIT_USER_AGENT=[USER]
export REDDIT_CLIENT_SECRET=xxxxxx
export REDDIT_CLIENT_ID=xxxxxx
Copy
pip install praisonai langchain_community praw
Copy
export OPENAI_API_KEY="Enter your API key"
Code
Single Agent
Copy
from praisonaiagents import Agent
from langchain_community.tools.reddit_search.tool import RedditSearchRun
agent = Agent(name="RedditSearchAgent",instructions="Search Reddit for information", tools=[RedditSearchRun],)
agent.start("Search Reddit for information about the latest AI advancements in subreddit all")
Multi Agents
Copy
from praisonaiagents import Agent, Task, PraisonAIAgents
from langchain_community.tools.reddit_search.tool import RedditSearchRun
agent = Agent(name="RedditSearchAgent",instructions="Search Reddit for information", tools=[RedditSearchRun],)
task = Task(description="Search Reddit for information about the latest AI news in subreddit all", agent=agent)
agents = PraisonAIAgents(agents=[agent],tasks=[task])
agents.start()
No Code
tools.pyCopy
from langchain_community.tools.reddit_search.tool import RedditSearchRun
Copy
framework: crewai
topic: research about the causes of lung disease
roles:
  research_analyst:
    backstory: Experienced in analyzing scientific data related to respiratory health.
    goal: Analyze data on lung diseases
    role: Research Analyst
    tasks:
      data_analysis:
        description: Gather and analyze data on the causes and risk factors of lung
          diseases.
        expected_output: Report detailing key findings on lung disease causes.
    tools:
    - 'RedditSearchRun'

