add google jobs

This commit is contained in:
David Westgate 2024-04-25 10:52:31 -07:00
parent 767104cac8
commit fd20f8d694
2 changed files with 5 additions and 4 deletions

View File

@ -3,15 +3,17 @@ from langchain.agents import AgentExecutor, create_react_agent, load_tools
from langchain.tools import tool
from langchain_openai import ChatOpenAI
from langchain_community.utilities.dalle_image_generator import DallEAPIWrapper
from langchain_community.tools.google_jobs import GoogleJobsQueryRun
from langchain_community.utilities.google_jobs import GoogleJobsAPIWrapper
from dotenv import load_dotenv
from tools import lookup_ip, lookup_name
from langsmith import Client
"""
This is the main runner of the custom agent. Agent tools are defined seperatly and imported from tools.py
This is the main runner of the custom agent. Custom agent tools are defined seperatly and imported from tools.py
So far, wholly adapted from https://github.com/wu4f/cs410g-src/blob/main/04_Agents/07_tools_custom_agent.py
Adapted from https://github.com/wu4f/cs410g-src/blob/main/04_Agents/07_tools_custom_agent.py
"""
@ -22,7 +24,7 @@ load_dotenv()
#client = Client()
llm = ChatOpenAI(model_name="gpt-4-turbo", temperature=0)
tools = load_tools(["serpapi", "terminal", "dalle-image-generator"], allow_dangerous_tools=True)
tools = load_tools(["serpapi", "terminal", "dalle-image-generator", "google-jobs"], allow_dangerous_tools=True, llm=llm)
tools.extend([lookup_name, lookup_ip])
base_prompt = hub.pull("langchain-ai/react-agent-template")

View File

@ -2,7 +2,6 @@ from langchain_core.pydantic_v1 import BaseModel, Field, root_validator
from langchain.tools import tool
import dns.resolver, dns.reversename
import validators
import validators
"""
Tools to be run by my custom agent.