Spaces:
Runtime error
Runtime error
migrate back to openai with gpt3.5
Browse files- agents/article_evaluator.py +2 -2
- agents/curiosity_catalyst.py +2 -2
- agents/learning_curator.py +2 -2
- agents/learning_profiler.py +2 -2
- crew/article_suggestion.py +18 -10
- llms/gemini.py +1 -2
- llms/gpt.py +3 -0
- requirements.txt +1 -0
agents/article_evaluator.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
from crewai import Agent
|
| 2 |
-
from llms.
|
| 3 |
|
| 4 |
article_evaluator = Agent(
|
| 5 |
role="Recommended Article Evaluator",
|
|
@@ -14,5 +14,5 @@ article_evaluator = Agent(
|
|
| 14 |
"incremental learning once the user completes reading the articles."
|
| 15 |
),
|
| 16 |
allow_delegation=False,
|
| 17 |
-
llm=
|
| 18 |
)
|
|
|
|
| 1 |
from crewai import Agent
|
| 2 |
+
from llms.gpt import llm
|
| 3 |
|
| 4 |
article_evaluator = Agent(
|
| 5 |
role="Recommended Article Evaluator",
|
|
|
|
| 14 |
"incremental learning once the user completes reading the articles."
|
| 15 |
),
|
| 16 |
allow_delegation=False,
|
| 17 |
+
llm=llm
|
| 18 |
)
|
agents/curiosity_catalyst.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
from crewai import Agent
|
| 2 |
-
from llms.
|
| 3 |
from tools.scrape_website import scrape_tool
|
| 4 |
|
| 5 |
curiosity_catalyst = Agent(
|
|
@@ -12,5 +12,5 @@ curiosity_catalyst = Agent(
|
|
| 12 |
"for reading the articles."
|
| 13 |
),
|
| 14 |
allow_delegation=False,
|
| 15 |
-
llm=
|
| 16 |
)
|
|
|
|
| 1 |
from crewai import Agent
|
| 2 |
+
from llms.gpt import llm
|
| 3 |
from tools.scrape_website import scrape_tool
|
| 4 |
|
| 5 |
curiosity_catalyst = Agent(
|
|
|
|
| 12 |
"for reading the articles."
|
| 13 |
),
|
| 14 |
allow_delegation=False,
|
| 15 |
+
llm=llm
|
| 16 |
)
|
agents/learning_curator.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
from crewai import Agent
|
| 2 |
from tools.scrape_website import scrape_tool
|
| 3 |
from tools.search_web import search_tool
|
| 4 |
-
from llms.
|
| 5 |
|
| 6 |
learning_curator = Agent(
|
| 7 |
role="Personal Learning Curator",
|
|
@@ -14,5 +14,5 @@ learning_curator = Agent(
|
|
| 14 |
),
|
| 15 |
allow_delegation=False,
|
| 16 |
tools=[scrape_tool, search_tool],
|
| 17 |
-
llm=
|
| 18 |
)
|
|
|
|
| 1 |
from crewai import Agent
|
| 2 |
from tools.scrape_website import scrape_tool
|
| 3 |
from tools.search_web import search_tool
|
| 4 |
+
from llms.gpt import llm
|
| 5 |
|
| 6 |
learning_curator = Agent(
|
| 7 |
role="Personal Learning Curator",
|
|
|
|
| 14 |
),
|
| 15 |
allow_delegation=False,
|
| 16 |
tools=[scrape_tool, search_tool],
|
| 17 |
+
llm=llm
|
| 18 |
)
|
agents/learning_profiler.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
from crewai import Agent
|
| 2 |
from tools.scrape_website import scrape_tool
|
| 3 |
-
from llms.
|
| 4 |
|
| 5 |
learning_profiler = Agent(
|
| 6 |
role="Personal Learning Profiler",
|
|
@@ -12,5 +12,5 @@ learning_profiler = Agent(
|
|
| 12 |
"The profile you build gives a high level overview of what interests that the user has. "
|
| 13 |
),
|
| 14 |
allow_delegation=False,
|
| 15 |
-
llm=
|
| 16 |
)
|
|
|
|
| 1 |
from crewai import Agent
|
| 2 |
from tools.scrape_website import scrape_tool
|
| 3 |
+
from llms.gpt import llm
|
| 4 |
|
| 5 |
learning_profiler = Agent(
|
| 6 |
role="Personal Learning Profiler",
|
|
|
|
| 12 |
"The profile you build gives a high level overview of what interests that the user has. "
|
| 13 |
),
|
| 14 |
allow_delegation=False,
|
| 15 |
+
llm=llm
|
| 16 |
)
|
crew/article_suggestion.py
CHANGED
|
@@ -7,20 +7,28 @@ from tasks.create_learning_profile import learning_profile_task
|
|
| 7 |
from tasks.new_article_suggestion import article_suggestion_task
|
| 8 |
from tasks.evaluate_articles import evaluation_task
|
| 9 |
from tasks.create_article_pitch import article_pitch_task
|
| 10 |
-
from llms.
|
| 11 |
|
| 12 |
article_recommendation_crew = Crew(
|
| 13 |
-
agents=[learning_profiler, learning_curator,
|
| 14 |
-
|
|
|
|
|
|
|
| 15 |
verbose=True,
|
| 16 |
memory=True,
|
| 17 |
-
manager_llm=
|
| 18 |
embedder={
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
"task_type": "retrieval_document",
|
| 23 |
-
"title": "Embeddings for Embedchain"
|
| 24 |
-
}
|
| 25 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
)
|
|
|
|
| 7 |
from tasks.new_article_suggestion import article_suggestion_task
|
| 8 |
from tasks.evaluate_articles import evaluation_task
|
| 9 |
from tasks.create_article_pitch import article_pitch_task
|
| 10 |
+
from llms.gpt import llm
|
| 11 |
|
| 12 |
article_recommendation_crew = Crew(
|
| 13 |
+
agents=[learning_profiler, learning_curator,
|
| 14 |
+
article_evaluator, curiosity_catalyst],
|
| 15 |
+
tasks=[learning_profile_task, article_suggestion_task,
|
| 16 |
+
evaluation_task, article_pitch_task],
|
| 17 |
verbose=True,
|
| 18 |
memory=True,
|
| 19 |
+
manager_llm=llm,
|
| 20 |
embedder={
|
| 21 |
+
"provider": "openai",
|
| 22 |
+
"config": {
|
| 23 |
+
"model": 'text-embedding-3-small'
|
|
|
|
|
|
|
|
|
|
| 24 |
}
|
| 25 |
+
}
|
| 26 |
+
# embedder={
|
| 27 |
+
# "provider": "google",
|
| 28 |
+
# "config":{
|
| 29 |
+
# "model": 'models/embedding-001',
|
| 30 |
+
# "task_type": "retrieval_document",
|
| 31 |
+
# "title": "Embeddings for Embedchain"
|
| 32 |
+
# }
|
| 33 |
+
# }
|
| 34 |
)
|
llms/gemini.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
| 2 |
-
import os
|
| 3 |
|
| 4 |
-
|
|
|
|
| 1 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
|
|
|
| 2 |
|
| 3 |
+
llm=ChatGoogleGenerativeAI(model="gemini-1.5-flash",verbose=True)
|
llms/gpt.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from langchain_openai import ChatOpenAI
|
| 2 |
+
|
| 3 |
+
llm = ChatOpenAI(model="gpt-3.5-turbo", temperature=0.5)
|
requirements.txt
CHANGED
|
@@ -3,3 +3,4 @@ crewai
|
|
| 3 |
crewai_tools
|
| 4 |
langchain_community
|
| 5 |
langchain_google_genai
|
|
|
|
|
|
| 3 |
crewai_tools
|
| 4 |
langchain_community
|
| 5 |
langchain_google_genai
|
| 6 |
+
langchain_openai
|