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.7.tar.gz (8.3 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.7-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentx_tools-0.7.tar.gz
  • Upload date:
  • Size: 8.3 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.7.tar.gz
Algorithm Hash digest
SHA256 734f6be93367b46021d4c3360212ce7aecee6c964fbccf78d9491a533f49e313
MD5 3a3bd4312fe0fb23939028289bcd8fab
BLAKE2b-256 82008da1504e8e6d762333686339b1f4a731b6f635cd82f8f178db73702e740e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: agentx_tools-0.7-py3-none-any.whl
  • Upload date:
  • Size: 8.0 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 f7c9e98927975c3c1fffc8975c91aa088dd385960589534e78804d8f67159a2f
MD5 ef230f886f2bb1e4affdf4e52d1ff7fa
BLAKE2b-256 94dd2085b7b9e70717a5fbe76ecfbdccd191dfb0ee949198f1901400625085f3

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