diff --git a/prisma/migrations/20240324101818_add_more_tools/migration.sql b/prisma/migrations/20240324101818_add_more_tools/migration.sql new file mode 100644 index 0000000..0a7ce73 --- /dev/null +++ b/prisma/migrations/20240324101818_add_more_tools/migration.sql @@ -0,0 +1,10 @@ +-- AlterEnum +-- This migration adds more than one value to an enum. +-- With PostgreSQL versions 11 and earlier, this is not possible +-- in a single migration. This can be worked around by creating +-- multiple migrations, each migration adding only one value to +-- the enum. + + +ALTER TYPE "AgentTool" ADD VALUE 'ARXIV'; +ALTER TYPE "AgentTool" ADD VALUE 'PUBMED'; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 5c7bcfb..060b9ee 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -17,6 +17,8 @@ enum AgentTool { WIKIPEDIA YAHOO_FINANCE YUOUTUBE_SEARCH + ARXIV + PUBMED } model Agent { diff --git a/requirements.txt b/requirements.txt index 56caa65..d707806 100644 --- a/requirements.txt +++ b/requirements.txt @@ -74,9 +74,9 @@ jsonpatch==1.33 jsonpointer==2.4 kubernetes==29.0.0 lancedb==0.5.7 -langchain==0.1.12 -langchain-community==0.0.28 -langchain-core==0.1.32 +langchain==0.1.13 +langchain-community==0.0.29 +langchain-core==0.1.33 langchain-experimental==0.0.52 langchain-google-genai==0.0.9 langchain-openai==0.0.5 diff --git a/src/app/api/graphql/crew_ai.py b/src/app/api/graphql/crew_ai.py index 1249a2c..5fdfcbd 100644 --- a/src/app/api/graphql/crew_ai.py +++ b/src/app/api/graphql/crew_ai.py @@ -3,13 +3,15 @@ import os from textwrap import dedent from crewai import Agent, Task, Crew, Process from langchain_google_genai import ChatGoogleGenerativeAI -from langchain_community.tools import DuckDuckGoSearchRun +from langchain_community.tools.ddg_search import DuckDuckGoSearchRun from langchain_community.tools.semanticscholar.tool import SemanticScholarQueryRun from langchain_community.tools.wikidata.tool import WikidataAPIWrapper, WikidataQueryRun -from langchain_community.tools import WikipediaQueryRun -from langchain_community.utilities import WikipediaAPIWrapper +from langchain_community.tools.wikipedia.tool import WikipediaQueryRun +from langchain_community.utilities.wikipedia import WikipediaAPIWrapper from langchain_community.tools.yahoo_finance_news import YahooFinanceNewsTool -from langchain_community.tools import YouTubeSearchTool +from langchain_community.tools.youtube.search import YouTubeSearchTool +from langchain_community.tools.arxiv.tool import ArxivQueryRun +from langchain_community.tools.pubmed.tool import PubmedQueryRun from dotenv import load_dotenv load_dotenv() @@ -26,6 +28,8 @@ tool_dict = { "WIKIPEDIA": WikipediaQueryRun(api_wrapper=WikipediaAPIWrapper()), "YAHOO_FINANCE": YahooFinanceNewsTool(), "YUOUTUBE_SEARCH": YouTubeSearchTool(), + "ARXIV": ArxivQueryRun(), + "PUBMED": PubmedQueryRun(), } diff --git a/src/app/api/graphql/schema.ts b/src/app/api/graphql/schema.ts index 44bcf4f..db20c47 100644 --- a/src/app/api/graphql/schema.ts +++ b/src/app/api/graphql/schema.ts @@ -6,6 +6,8 @@ const typeDefs = `#graphql WIKIPEDIA YAHOO_FINANCE YUOUTUBE_SEARCH + ARXIV + PUBMED } type Agent { @@ -98,7 +100,7 @@ const typeDefs = `#graphql createMission( name: String! crew: [Int!] = [] - verbose: Boolean = false + verbose: Boolean process: MissionProcess = "SEQUENTIAL" ): Mission! diff --git a/src/components/modals/mission_modal.tsx b/src/components/modals/mission_modal.tsx index 7486bfc..84ad0d2 100644 --- a/src/components/modals/mission_modal.tsx +++ b/src/components/modals/mission_modal.tsx @@ -79,6 +79,7 @@ export default function MissionModal(props: { tasks: missionData.tasks.map((task) => ({ name: task.name, description: task.description, + expected_output: task.expected_output, agent: Number.parseInt(task.agent?.id as string), })), }, @@ -359,14 +360,12 @@ export default function MissionModal(props: {
- {mission?.result && ( -
- {missionResult} -
- )} +
+ {missionResult} +
)} diff --git a/src/data/data.ts b/src/data/data.ts index 074c437..c68f603 100644 --- a/src/data/data.ts +++ b/src/data/data.ts @@ -53,7 +53,8 @@ export const tools = [ { text: "WIKIPEDIA", value: "WIKIPEDIA" }, { text: "YAHOO_FINANCE", value: "YAHOO_FINANCE" }, { text: "YUOUTUBE_SEARCH", value: "YUOUTUBE_SEARCH" }, - { text: "CodeDocsSearchTool", value: "CodeDocsSearchTool" }, + { text: "ARXIV", value: "ARXIV" }, + { text: "PUBMED", value: "PUBMED" }, ]; const game = ` diff --git a/src/types/agent.ts b/src/types/agent.ts index 7ea6cb9..429da42 100644 --- a/src/types/agent.ts +++ b/src/types/agent.ts @@ -4,7 +4,9 @@ type Tool = | "WIKIDATA" | "WIKIPEDIA" | "YAHOO_FINANCE" - | "YUOUTUBE_SEARCH"; + | "YUOUTUBE_SEARCH" + | "ARXIV" + | "PUBMED"; export type Agent = { id?: number | string;