Appearance
Utilities
Tools
calculator
Evaluate math expressions, solve equations, and perform calculus operations with symbolic support
Environment variables
| Variable | Required | Default | Description |
|---|---|---|---|
CALCULATOR_MODE | optional | evaluate | Default calculator mode |
CALCULATOR_PRECISION | optional | 10 | Decimal precision |
CALCULATOR_SCIENTIFIC | optional | False | Use scientific notation by default |
CALCULATOR_FORCE_NUMERIC | optional | False | Force numeric evaluation |
CALCULATOR_FORCE_SCIENTIFIC_THRESHOLD | optional | 1e21 | When to switch to scientific notation |
CALCULATOR_DERIVE_ORDER | optional | 1 | Default derivative order |
CALCULATOR_SERIES_POINT | optional | 0 | Default series expansion point |
CALCULATOR_SERIES_ORDER | optional | 5 | Default series order |
current_time
Return the current date and time with optional timezone — useful for scheduling and time-sensitive tasks
Environment variables
| Variable | Required | Default | Description |
|---|---|---|---|
DEFAULT_TIMEZONE | optional | UTC | Timezone used by current_time |
load_tool
Dynamically import and register tools from Python files at runtime without restarting the agent
Environment variables
| Variable | Required | Default | Description |
|---|---|---|---|
ELSAI_DISABLE_LOAD_TOOL | optional | unset | Set to true to turn off the load_tool runtime loader |
sleep
Pause the agent for a specified duration; respects interrupts so long waits can be cancelled
Environment variables
| Variable | Required | Default | Description |
|---|---|---|---|
MAX_SLEEP_SECONDS | optional | 300 | Longest allowed sleep duration (seconds) |
stop
Force-stop the agent event loop immediately, ending the current run
Environment variables
No dedicated environment variables.
Examples
Requires OPENAI_API_KEY.
bash
pip install --extra-index-url https://elsai-agents.elsai.ai/root/ elsai-agents==0.3.1
pip install --extra-index-url https://core-packages.elsai.ai/root/ "elsai-model[openai]==2.1.0"
pip install --extra-index-url https://elsai-agents.elsai.ai/root/ elsai-agents-tools==0.3.0python
import os
from elsai import Agent
from elsai.agent import AgentConfig
from elsai_model.openai import OpenAIModel
from elsai_tools.calculator import calculator
from elsai_tools.current_time import current_time
agent = Agent(
model=OpenAIModel(
model_id="gpt-4o-mini",
client_args={"api_key": os.environ["OPENAI_API_KEY"]},
),
tools=[calculator, current_time],
system_prompt=(
"Use calculator for math and current_time for dates. "
"After using tools, answer the user clearly in plain text."
),
config=AgentConfig(name="utility_assistant"),
)
result = agent("What is 17 * 28, and what is the current UTC date?")
print(result)Parameter reference: Utilities API.
API reference
See Utilities API for parameters and import paths.