Skip to main content

A collection of tools for Large Language Model Agents

Project description

AgentX Logo

AgentX

AgentX is a comprehensive toolkit designed for use with Large Language Models (LLMs). It provides a variety of tools that can be utilized by LLM agents to perform a wide range of tasks, from date manipulation to statistical analysis, web scraping, and internet searching.

Features

  • Date Tools: Perform various date-related operations such as getting the current date, calculating the number of days between dates, and converting dates to different formats.
  • RAG Search Tools: Search through text files for specific medical codes or other information.
  • Scraping Tools: Scrape data from websites.
  • Search Tools: Search the internet for information on various topics.
  • Statistical Tools: Perform statistical calculations such as mean, median, standard deviation, and more.

Installation

To install AgentX, run the following command:

pip install agentx

Usage

Here are some examples of how to use the various tools provided by AgentX:

Date Tools

from agentx import AgentX

agent = AgentX()

# Test date tools
print(agent.date_tools.get_current_date.invoke({}))
print(agent.date_tools.get_current_time.invoke({}))
print(agent.date_tools.get_date_after_days.invoke({"days": 5}))
print(agent.date_tools.get_date_before_days.invoke({"days": 5}))
print(agent.date_tools.get_day_of_week({"date": {"year": 2023, "month": 6, "day": 10}}))
print(agent.date_tools.get_days_between_dates.invoke({"start_date": {"year": 2023, "month": 6, "day": 1}, "end_date": {"year": 2023, "month": 6, "day": 10}}))
print(agent.date_tools.get_first_day_of_month.invoke({"year": 2023, "month": 6}))
print(agent.date_tools.get_last_day_of_month.invoke({"year": 2023, "month": 6}))
print(agent.date_tools.get_next_month.invoke({"year": 2023, "month": 6}))
print(agent.date_tools.get_previous_month.invoke({"year": 2023, "month": 6}))
print(agent.date_tools.get_previous_year.invoke({"year": 2023}))
print(agent.date_tools.get_days_in_month.invoke({"year": 2023, "month": 6}))
print(agent.date_tools.get_week_number.invoke({"date": {"year": 2023, "month": 6, "day": 10}}))
print(agent.date_tools.get_quarter.invoke({"month": 6}))
print(agent.date_tools.get_date_from_week_and_year.invoke({"week": 23, "year": 2023}))
print(agent.date_tools.get_date_from_day_of_year.invoke({"day_of_year": 162, "year": 2023}))
print(agent.date_tools.get_day_of_year.invoke({"date": {"year": 2023, "month": 6, "day": 10}}))
print(agent.date_tools.get_days_until_end_of_year.invoke({"date": {"year": 2023, "month": 6, "day": 10}}))
print(agent.date_tools.get_days_since_beginning_of_year.invoke({"date": {"year": 2023, "month": 6, "day": 10}}))
print(agent.date_tools.get_next_weekday.invoke({"date": {"year": 2023, "month": 6, "day": 10}, "weekday": 0}))
print(agent.date_tools.get_previous_weekday.invoke({"date": {"year": 2023, "month": 6, "day": 10}, "weekday": 0}))
print(agent.date_tools.get_nth_weekday_of_month.invoke({"year": 2023, "month": 6, "day": 10, "weekday": 0, "n": 2}))
print(agent.date_tools.get_last_weekday_of_month.invoke({"year": 2023, "month": 6, "weekday": 0}))
print(agent.date_tools.get_age.invoke({"birth_date": {"year": 1990, "month": 1, "day": 1}, "current_date": {"year": 2023, "month": 6, "day": 10}}))
print(agent.date_tools.get_date_from_timestamp.invoke({"timestamp": 1686412800}))
print(agent.date_tools.get_timestamp_from_date.invoke({"date": {"year": 2023, "month": 6, "day": 10}}))
print(agent.date_tools.get_date_from_iso_format.invoke("2023-06-10"))
print(agent.date_tools.get_iso_format_from_date.invoke({"date": {"year": 2023, "month": 6, "day": 10}}))
print(agent.date_tools.get_date_from_ordinal.invoke({"ordinal": 738532}))

RAG Search Tools

from agentx import AgentX

agent = AgentX()

print(agent.rag_search_tools.search_rag_txt('what is the medical codes for autism?', txt_file=r'path/to/file.txt'))

Scraping Tools

from agentx import AgentX

agent = AgentX()

print(agent.scraping_tools.scrape_website('https://www.nbcnews.com/politics/politics-news/live-blog/hunter-biden-trial-live-updates-rcna156114'))

Search Tools

from agentx import AgentX

agent = AgentX()

print(agent.search_tools.search_internet.invoke('what is hawking radiation?'))

Statistical Tools

from agentx import AgentX

agent = AgentX()

print(agent.statistical_tools.calculate_mean.invoke({"values": [1, 2, 3, 4, 5]}))
print(agent.statistical_tools.calculate_median.invoke({"numbers": [1, 2, 3, 4, 5]}))
print(agent.statistical_tools.calculate_std.invoke({"numbers": [1, 2, 3, 4, 5]}))
print(agent.statistical_tools.calculate_variance.invoke({"numbers": [1, 2, 3, 4, 5]}))
print(agent.statistical_tools.calculate_min.invoke({"numbers": [1, 2, 3, 4, 5]}))
print(agent.statistical_tools.calculate_max.invoke({"numbers": [1, 2, 3, 4, 5]}))
print(agent.statistical_tools.calculate_sum.invoke({"numbers": [1, 2, 3, 4, 5]}))
print(agent.statistical_tools.calculate_percentile.invoke({"numbers": [1, 2, 3, 4, 5], "percentile": 50}))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentx_tools-0.5.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentx_tools-0.5-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

Details for the file agentx_tools-0.5.tar.gz.

File metadata

  • Download URL: agentx_tools-0.5.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.11

File hashes

Hashes for agentx_tools-0.5.tar.gz
Algorithm Hash digest
SHA256 554a03eeb78e534e74fa423ee971355adb244f3280c0a09db5a468f52ff0bc33
MD5 f054a12edd36ae836eb526df0b246040
BLAKE2b-256 97494a68b1f4c25103789179e553a187f6956794fa0fab5306c1b1e3668c2569

See more details on using hashes here.

File details

Details for the file agentx_tools-0.5-py3-none-any.whl.

File metadata

  • Download URL: agentx_tools-0.5-py3-none-any.whl
  • Upload date:
  • Size: 2.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.11

File hashes

Hashes for agentx_tools-0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 674b3e7e65e96de0ee9a93b4869ad8d5f2329b407006100eeb2b278cf3df8bb5
MD5 48c529b080a753778a2d1c1a44da1727
BLAKE2b-256 6a53807bc5d721a3575361b4ea40c6016817ea3e1ab2e5d1728f22b14286474c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page