update langchain and add arxiv and pubmed tools
This commit is contained in:
@@ -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';
|
||||||
@@ -17,6 +17,8 @@ enum AgentTool {
|
|||||||
WIKIPEDIA
|
WIKIPEDIA
|
||||||
YAHOO_FINANCE
|
YAHOO_FINANCE
|
||||||
YUOUTUBE_SEARCH
|
YUOUTUBE_SEARCH
|
||||||
|
ARXIV
|
||||||
|
PUBMED
|
||||||
}
|
}
|
||||||
|
|
||||||
model Agent {
|
model Agent {
|
||||||
|
|||||||
@@ -74,9 +74,9 @@ jsonpatch==1.33
|
|||||||
jsonpointer==2.4
|
jsonpointer==2.4
|
||||||
kubernetes==29.0.0
|
kubernetes==29.0.0
|
||||||
lancedb==0.5.7
|
lancedb==0.5.7
|
||||||
langchain==0.1.12
|
langchain==0.1.13
|
||||||
langchain-community==0.0.28
|
langchain-community==0.0.29
|
||||||
langchain-core==0.1.32
|
langchain-core==0.1.33
|
||||||
langchain-experimental==0.0.52
|
langchain-experimental==0.0.52
|
||||||
langchain-google-genai==0.0.9
|
langchain-google-genai==0.0.9
|
||||||
langchain-openai==0.0.5
|
langchain-openai==0.0.5
|
||||||
|
|||||||
@@ -3,13 +3,15 @@ import os
|
|||||||
from textwrap import dedent
|
from textwrap import dedent
|
||||||
from crewai import Agent, Task, Crew, Process
|
from crewai import Agent, Task, Crew, Process
|
||||||
from langchain_google_genai import ChatGoogleGenerativeAI
|
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.semanticscholar.tool import SemanticScholarQueryRun
|
||||||
from langchain_community.tools.wikidata.tool import WikidataAPIWrapper, WikidataQueryRun
|
from langchain_community.tools.wikidata.tool import WikidataAPIWrapper, WikidataQueryRun
|
||||||
from langchain_community.tools import WikipediaQueryRun
|
from langchain_community.tools.wikipedia.tool import WikipediaQueryRun
|
||||||
from langchain_community.utilities import WikipediaAPIWrapper
|
from langchain_community.utilities.wikipedia import WikipediaAPIWrapper
|
||||||
from langchain_community.tools.yahoo_finance_news import YahooFinanceNewsTool
|
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
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
@@ -26,6 +28,8 @@ tool_dict = {
|
|||||||
"WIKIPEDIA": WikipediaQueryRun(api_wrapper=WikipediaAPIWrapper()),
|
"WIKIPEDIA": WikipediaQueryRun(api_wrapper=WikipediaAPIWrapper()),
|
||||||
"YAHOO_FINANCE": YahooFinanceNewsTool(),
|
"YAHOO_FINANCE": YahooFinanceNewsTool(),
|
||||||
"YUOUTUBE_SEARCH": YouTubeSearchTool(),
|
"YUOUTUBE_SEARCH": YouTubeSearchTool(),
|
||||||
|
"ARXIV": ArxivQueryRun(),
|
||||||
|
"PUBMED": PubmedQueryRun(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ const typeDefs = `#graphql
|
|||||||
WIKIPEDIA
|
WIKIPEDIA
|
||||||
YAHOO_FINANCE
|
YAHOO_FINANCE
|
||||||
YUOUTUBE_SEARCH
|
YUOUTUBE_SEARCH
|
||||||
|
ARXIV
|
||||||
|
PUBMED
|
||||||
}
|
}
|
||||||
|
|
||||||
type Agent {
|
type Agent {
|
||||||
@@ -98,7 +100,7 @@ const typeDefs = `#graphql
|
|||||||
createMission(
|
createMission(
|
||||||
name: String!
|
name: String!
|
||||||
crew: [Int!] = []
|
crew: [Int!] = []
|
||||||
verbose: Boolean = false
|
verbose: Boolean
|
||||||
process: MissionProcess = "SEQUENTIAL"
|
process: MissionProcess = "SEQUENTIAL"
|
||||||
): Mission!
|
): Mission!
|
||||||
|
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ export default function MissionModal(props: {
|
|||||||
tasks: missionData.tasks.map((task) => ({
|
tasks: missionData.tasks.map((task) => ({
|
||||||
name: task.name,
|
name: task.name,
|
||||||
description: task.description,
|
description: task.description,
|
||||||
|
expected_output: task.expected_output,
|
||||||
agent: Number.parseInt(task.agent?.id as string),
|
agent: Number.parseInt(task.agent?.id as string),
|
||||||
})),
|
})),
|
||||||
},
|
},
|
||||||
@@ -359,14 +360,12 @@ export default function MissionModal(props: {
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label className="font-bold text-lg">Result:</label>
|
<label className="font-bold text-lg">Result:</label>
|
||||||
{mission?.result && (
|
<div
|
||||||
<div
|
className="border-2 rounded p-2"
|
||||||
className="border-2 rounded p-2"
|
style={{ whiteSpace: "pre-line" }}
|
||||||
style={{ whiteSpace: "pre-line" }}
|
>
|
||||||
>
|
{missionResult}
|
||||||
{missionResult}
|
</div>
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -53,7 +53,8 @@ export const tools = [
|
|||||||
{ text: "WIKIPEDIA", value: "WIKIPEDIA" },
|
{ text: "WIKIPEDIA", value: "WIKIPEDIA" },
|
||||||
{ text: "YAHOO_FINANCE", value: "YAHOO_FINANCE" },
|
{ text: "YAHOO_FINANCE", value: "YAHOO_FINANCE" },
|
||||||
{ text: "YUOUTUBE_SEARCH", value: "YUOUTUBE_SEARCH" },
|
{ text: "YUOUTUBE_SEARCH", value: "YUOUTUBE_SEARCH" },
|
||||||
{ text: "CodeDocsSearchTool", value: "CodeDocsSearchTool" },
|
{ text: "ARXIV", value: "ARXIV" },
|
||||||
|
{ text: "PUBMED", value: "PUBMED" },
|
||||||
];
|
];
|
||||||
|
|
||||||
const game = `
|
const game = `
|
||||||
|
|||||||
@@ -4,7 +4,9 @@ type Tool =
|
|||||||
| "WIKIDATA"
|
| "WIKIDATA"
|
||||||
| "WIKIPEDIA"
|
| "WIKIPEDIA"
|
||||||
| "YAHOO_FINANCE"
|
| "YAHOO_FINANCE"
|
||||||
| "YUOUTUBE_SEARCH";
|
| "YUOUTUBE_SEARCH"
|
||||||
|
| "ARXIV"
|
||||||
|
| "PUBMED";
|
||||||
|
|
||||||
export type Agent = {
|
export type Agent = {
|
||||||
id?: number | string;
|
id?: number | string;
|
||||||
|
|||||||
Reference in New Issue
Block a user