Skip to main content
Open In Colab在 GitHub 上打开

Google 工作机会

本笔记本介绍了如何使用 Google Jobs Tool 获取当前的招聘信息。

首先,您需要注册一个SerpApi key密钥地址:https://serpapi.com/users/sign_up,然后在此处获取您的 API 密钥:https://serpapi.com/manage-api-key

然后你必须安装google-search-results使用以下命令:pip install google-search-results

然后,您需要设置环境变量SERPAPI_API_KEY发送到您的SerpApi key

如果您使用的是 conda 环境,则可以在 kernal 中使用以下命令进行设置: conda activate [您的环境名称] conda env confiv vars SERPAPI_API_KEY='[your serp api key]'

使用工具

%pip install --upgrade --quiet  google-search-results langchain-community
Requirement already satisfied: google-search-results in /opt/anaconda3/envs/langchain/lib/python3.10/site-packages (2.4.2)
Requirement already satisfied: requests in /opt/anaconda3/envs/langchain/lib/python3.10/site-packages (from google-search-results) (2.31.0)
Requirement already satisfied: charset-normalizer<4,>=2 in /opt/anaconda3/envs/langchain/lib/python3.10/site-packages (from requests->google-search-results) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /opt/anaconda3/envs/langchain/lib/python3.10/site-packages (from requests->google-search-results) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/anaconda3/envs/langchain/lib/python3.10/site-packages (from requests->google-search-results) (2.1.0)
Requirement already satisfied: certifi>=2017.4.17 in /opt/anaconda3/envs/langchain/lib/python3.10/site-packages (from requests->google-search-results) (2023.11.17)
import os

from langchain_community.tools.google_jobs import GoogleJobsQueryRun
from langchain_community.utilities.google_jobs import GoogleJobsAPIWrapper

os.environ["SERPAPI_API_KEY"] = "[your serpapi key]"
tool = GoogleJobsQueryRun(api_wrapper=GoogleJobsAPIWrapper())
tool.run("Can I get an entry level job posting related to physics")
'\n_______________________________________________\nJob Title: Entry Level Mechanical, Electrical, Physics Engineer for Controls PLC programing\nCompany Name: Quest Global\nLocation: Schenectady, NY\nDescription: Job Requirements\n\nMechanical, Electrical, thermal and computer network engineers in developing control systems. The team works together closely in programing and testing control logic for industrial systems. The team will use simulations to test and represent real world operational conditions of electrical power plants.\n\nJob functions include:\n• Desired Experience in programming controllers, like an Arduino, Allen Bradly, Siemens, GE Vie or any Industrial controllers with HMI interface.\n• Working knowledge of instrumentation circuits, ex thermocouples, pressure transmitters,\n• Reading logic diagrams and programing ladder logic from them\n• Reviewing wiring diagrams for instrumentation installs\n• Interpret P&ID/Electrical Schematics and experience with basic instrumentation.\n• Collaborate with design engineers of various disciplines to develop control system requirements\n• Support Field Engineering Services in technical resolution of field problems\n• Providing input to quality assurance on projects\n• Review and interpret customer specifications on mechanical systems\n• Operational Knowledge of Steam or Gas Turbine Power Plants\n• Ability to interpret functional requirements and translate into control logic.\n• Ability to interpret P&ID/Electrical Schematics and experience with basic instrumentation\n\nRequired Skills and Experience\n• Preferred Hands-on experience programming controllers, GE Mark V, VI, VIe series turbine control and Cimplicity HMI software or other industry related controllers like Audrino, LabView.\n• Demonstrate experience working in the industrial controls or power generation industry\n• Have a fundamental understanding of Steam Turbine and Power Plant construction\n• Technical skills in engineering design and construction practices\n• Proven team player with solid cooperation, flexibility and demonstrated capacity to learn complex information quickly\n• Field experience in related equipment\n• Strong organizational / project execution skills and prior success in working with or leading cross-functional teams\n• Strong interpersonal skills with the ability to influence and lead others\n• Passion for continuous learning and applying best practices to achieve practical solutions\n\nWork Experience\n\nSkills\n• instrumentation\n• ladder logic\n• control systems\n• electrical schematics\n• control system\n• programming controllers\n• control\n• collaborate\n• quality assurance\n• best practices\n• wiring diagrams\n• functional requirements\n• industrial electrical controls\n• project execution\n• engineering design\n• instrumentation circuits\n• technical\n• power plant construction\n• electrical controls\n• cross-functional teams\n• continuous learning\n• strong organizational\n• mechanical systems\n• technical skills\n_______________________________________________\n\n'

在 ReAct 代理中使用该工具

要创建使用 Google Jobs 工具的代理,请安装 Langgraph

%pip install --upgrade --quiet langgraph langchain-openai

并使用create_react_agent功能来初始化 ReAct 代理。您还需要设置您的OPEN_API_KEY(访问 https://platform.openai.com)才能访问 OpenAI 的聊天模型。

import os

from langchain.agents import load_tools
from langchain.chat_models import init_chat_model
from langgraph.prebuilt import create_react_agent

os.environ["OPENAI_API_KEY"] = "[your openai key]"
os.environ["SERP_API_KEY"] = "[your serpapi key]"

llm = init_chat_model("gpt-4o-mini", model_provider="openai")
tools = load_tools(["google-jobs"], llm=llm)
agent = create_react_agent(llm, tools)

events = agent.stream(
{"messages": [("user", "Give me an entry level job posting related to physics?")]},
stream_mode="values",
)
for event in events:
event["messages"][-1].pretty_print()
================================ Human Message =================================

Give me an entry level job posting related to physics?
================================== Ai Message ==================================
Tool Calls:
google_jobs (call_PoViomaLqoCRXqNmxe7YDKTN)
Call ID: call_PoViomaLqoCRXqNmxe7YDKTN
Args:
query: entry level physics job
================================= Tool Message =================================
Name: google_jobs


_______________________________________________
Job Title: New Grad - Math / Physics Background
Company Name: Bits to Atoms (YC S24)
Location: San Francisco, CA
Description: We are working with Canopy Labs to hire a new grad with a strong background in math or physics to join the team. You can learn more about Canopy Labs here.

Company Overview

Canopy Labs is building digital humans that can:
• Hold real-time, multimodal video interactions that look and sound ultra-realistic
• Intelligently control their body: write, gesticulate, clap, etc.
• Exhibit spatial awareness: walk around and interact with their environment

Their mission is to bring virtual humans to life through cutting-edge generative models, enabling natural, embodied AI interactions at scale.

What We're Looking For
• Strong programming skills in Python
• Excited by ML research and solving really hard problems
• Can ship really, really fast
• Experienced with cloud platforms (AWS, GCP, Azure)

Nice to Haves
• Experience with training and model deployment
• Contributions to open-source ML projects

It’s ok if you don’t have much practical experience yet – we want to find exceptional individuals, even if you have demonstrated your abilities in non-professional settings. For example, if you have built a bunch of side projects and just love making things work, or even competed in math or physics competitions, we want to speak with you.

We're looking forward to hearing from you soon!
_______________________________________________


================================== Ai Message ==================================

Here's an entry-level job posting related to physics:

**Job Title:** New Grad - Math / Physics Background
**Company Name:** Bits to Atoms (YC S24)
**Location:** San Francisco, CA

**Description:**
We are working with Canopy Labs to hire a new grad with a strong background in math or physics to join the team. Canopy Labs is building digital humans that can:
- Hold real-time, multimodal video interactions that look and sound ultra-realistic.
- Intelligently control their body: write, gesticulate, clap, etc.
- Exhibit spatial awareness: walk around and interact with their environment.

Their mission is to bring virtual humans to life through cutting-edge generative models, enabling natural, embodied AI interactions at scale.

**What We're Looking For:**
- Strong programming skills in Python.
- Excited by ML research and solving really hard problems.
- Can ship really, really fast.
- Experienced with cloud platforms (AWS, GCP, Azure).

**Nice to Haves:**
- Experience with training and model deployment.
- Contributions to open-source ML projects.

It’s ok if you don’t have much practical experience yet – we want to find exceptional individuals, even if you have demonstrated your abilities in non-professional settings. For example, if you have built a bunch of side projects and just love making things work, or even competed in math or physics competitions, we want to speak with you.

We're looking forward to hearing from you soon!