πŸ” JobSearch Agent

It utilize various tools for internet search and document comparison to fulfill its task. Upon finding the relevant job opportunities, The script configures the agent's role, goal, backstory, capabilities, and specific task to accomplish. Additionally, it initializes logging for debugging purposes and triggers the execution of the agent.

Import Required Libraries

First, we need to import the necessary modules. Each module serves a specific purpose in our script. We utilize various tools for internet search and document comparison to fulfill the agent's task. Here’s what each import does:

  • GoogleSerpAPISearch and DuckDuckGoSearch are tools for performing web searches.

  • Admin manages the overall execution of tasks.

  • AzureChatOpenAIModel is used to configure the large language model from Azure.

  • Memory is for maintaining context during the agent's operations.

  • TaskPlanner helps in decomposing tasks into manageable sub-tasks.

  • Worker represents individual agents with specific roles and responsibilities.

  • Console and Markdown from the rich library are used for printing formatted outputs.

from openagi.actions.tools.serp_search import GoogleSerpAPISearch
from openagi.actions.tools.ddg_search import DuckDuckGoSearch
from openagi.agent import Admin
from openagi.llms.azure import AzureChatOpenAIModel
from openagi.memory import Memory
from openagi.planner.task_decomposer import TaskPlanner
from openagi.worker import Worker
from rich.console import Console
from rich.markdown import Markdown
import os

Setup LLM

Next, we set up the environment variables and configure the Azure OpenAI model. This setup allows us to use Azure's GPT-4 model with the script. Setting up the environment variables ensures the necessary keys and endpoints are accessible during execution.

Define Workers

We define workers with specific roles and instructions. Each worker agent is equipped with the tools necessary to perform their designated tasks. The worker in this script is set up to search for job opportunities using DuckDuckGo.

Define Admin

The Admin agent manages the workers and executes the tasks. It is configured to use the task planner without human intervention and maintains context using memory.

Execute Agent LLM

The admin runs with a specific query to find job opportunities. The query includes detailed instructions on what information to gather and how to present it.

Print the Results

Finally, the results are outputted using the rich library, which allows us to print the data in a nicely formatted markdown.

Sample Output

The expected output is a list of job opportunities with detailed descriptions. Each job entry includes the company name, location, job title, responsibilities, required skills, standout perks, and an application link.

Last updated