agentic-tools
A python package that lets you setup agents with tools very easy
All you need is to add a docorator do the function that should be made accessable to the LLM.
from agentic_tools import ai_tool
def llm_can_not_use():
pass
@ai_tool
def llm_can_use():
pass
Be awere that this will eat more input tokens, since you are adding context of the functions.
Context that gets added
- Function signarure, icludeing, arguments and type hints
- Docstring
install
pip install agentic-tools
Agentic tools needs a LangChain object chat model.
build
git clone git@github.com:AxelGard/agentic-tools.git
cd agentic-tools
python3 -m venv env
source ./env/bin/activate
pip install -e .
# or
# pip install -e .[dev]
# if you want dev depenacies
DEMO
you can check out my expriment notebook
or
suppose you have some functions that you want you LLM to be able to call.
Agentic tools allows you to just add a decorator to it and then the agent will have access to those tools.
All LangChain models are supported, but for this demo I will use Ollama with llama3.1
install
install Ollma
curl -fsSL https://ollama.com/install.sh | sh
and then run ollama
ollama run llama3.1
install the python dependacnices
pip install agentic-tools langchain-ollama yfinance
Example
from langchain_ollama.chat_models import ChatOllama
from agentic_tools import ai_tool, Agent
import yfinance as yf
@ai_tool
def get_stock_price(symbol: str, period:str="1d") -> str:
stock = yf.Ticker(symbol)
price = stock.history(period=period)["Close"].iloc[0]
return f"The stock price of {symbol} was ${price:.2f} {period} ago"
@ai_tool
def get_market_cap(symbol: str) -> str:
stock = yf.Ticker(symbol)
cap = stock.info.get("marketCap", None)
if cap:
return f"The market cap of {symbol} is ${cap:,}"
return f"Market cap data for {symbol} is not available."
@ai_tool
def get_pe_ratio(symbol: str) -> str:
""" Will return P/E ratrio of the company """
stock = yf.Ticker(symbol)
pe = stock.info.get("trailingPE", None)
if pe:
return f"The P/E ratio of {symbol} is {pe:.2f}"
return f"P/E ratio data for {symbol} is not available."
llm = ChatOllama(model="llama3.1", temperature=0)
agent = Agent(llm_chat_model=llm)
query = "what was apples stock price a 5 days ago?"
print(f"{agent.query(question=query)}\n")
# The stock price of AAPL was $210.16 5d ago
query="who are you?"
print(f"{agent.query(question=query)}\n")
# I'm an AI assistant. I don't have a personal identity or emotions, but I can provide information and help with tasks to the best of my abilities. How can I assist you today?
Release files for agentic-tools 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| agentic_tools-0.2.1.tar.gz | 5.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agentic_tools-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.1 kB
Release files / agentic_tools-0.2.1.tar.gz
| Download URL | agentic_tools-0.2.1.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
034b39ab03332c49762bd7dd1edfdfffe36c9a0392cdaeed695f48eca7ee9aad
|
|
BLAKE2b-256 checksum How to use checksums |
ccc9232ee8b14c78f7f9bda22f599b6ec99c6aaea91326cc4a2400cbe7589703
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 24, 2025.
Transparency logRelease files / agentic_tools-0.2.1-py3-none-any.whl
| Download URL | agentic_tools-0.2.1-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1821309fd1ab8a34ea98367e12265ec6169635635ab7020fe65ce40eeabfa4ce
|
|
BLAKE2b-256 checksum How to use checksums |
1ca014702a857a32cf02f8a24513eba1b45ad005c305c7de6ce94b03a4a0625c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 24, 2025.
Transparency log