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.3.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.3-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentx_tools-0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 2d99b83a1b48bbaf63f0578d432092bfceba6f0ebf7ef45608ebbf023511a7f5
MD5 3fb6d18f14d12e2928b53dd55fb6c250
BLAKE2b-256 fc58c900d0b3061e26c2821ff36ebdee5605a8200f29ae9ba2e611a16b8b4d44

See more details on using hashes here.

File details

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

File metadata

  • Download URL: agentx_tools-0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d7ad2a332146488ebb7e15db451494a16d10626151a5bb74cf0e4b8b84f58e05
MD5 3c8a70916232d4326101fef873f3704c
BLAKE2b-256 6cb6ceaf280969e4474b88085c86815452a31575d3f2dfacc10b6a15a04bf662

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