skjaini commited on
Commit
84df946
·
verified ·
1 Parent(s): 9bd49fa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import streamlit as st
2
  from crewai import Crew, Agent, Task, Process
3
- from langchain_core.tools import Tool # Import Tool from langchain_core.tools
4
  from langchain_community.tools import DuckDuckGoSearchRun
5
  from langchain_community.llms import HuggingFaceHub
6
  import datetime
@@ -43,7 +43,7 @@ def create_ai_news_crew():
43
  tools effectively to find information.""",
44
  verbose=True,
45
  allow_delegation=False,
46
- tools=[search_tool], # Pass the wrapped tool
47
  llm=HuggingFaceHub(
48
  repo_id="deepseek-ai/DeepSeek-Coder-33B-Instruct",
49
  model_kwargs={"temperature": 0.5, "max_new_tokens": 1024, "repetition_penalty": 1.2},
@@ -75,7 +75,8 @@ def create_ai_news_crew():
75
  industry news, ethical considerations, and new applications of AI.
76
  Return the titles and URLs of the most important articles.
77
  """,
78
- agent=researcher
 
79
  )
80
 
81
  summarize_task = Task(
@@ -85,7 +86,8 @@ def create_ai_news_crew():
85
  a very brief (1-2 sentence) summary of each item and, if possible, link to the source.
86
  Format the output using markdown for readability.
87
  """,
88
- agent=summarizer
 
89
  )
90
 
91
  # Create Crew
 
1
  import streamlit as st
2
  from crewai import Crew, Agent, Task, Process
3
+ from langchain_core.tools import Tool
4
  from langchain_community.tools import DuckDuckGoSearchRun
5
  from langchain_community.llms import HuggingFaceHub
6
  import datetime
 
43
  tools effectively to find information.""",
44
  verbose=True,
45
  allow_delegation=False,
46
+ tools=[search_tool],
47
  llm=HuggingFaceHub(
48
  repo_id="deepseek-ai/DeepSeek-Coder-33B-Instruct",
49
  model_kwargs={"temperature": 0.5, "max_new_tokens": 1024, "repetition_penalty": 1.2},
 
75
  industry news, ethical considerations, and new applications of AI.
76
  Return the titles and URLs of the most important articles.
77
  """,
78
+ agent=researcher,
79
+ expected_output="A list of titles and URLs of the most important AI news articles from yesterday." # Added expected_output
80
  )
81
 
82
  summarize_task = Task(
 
86
  a very brief (1-2 sentence) summary of each item and, if possible, link to the source.
87
  Format the output using markdown for readability.
88
  """,
89
+ agent=summarizer,
90
+ expected_output="A concise daily AI news briefing in markdown format, no more than 500 words." # Added expected_output
91
  )
92
 
93
  # Create Crew