teff.tool.builtin¶
teff.tool.builtin
¶
Modules:
| Name | Description |
|---|---|
calculator |
Calculator tool — AST-based safe evaluation of math expressions. |
csv |
CSV tools — read, filter and aggregate tabular data from CSV files. |
data |
Data tools — JSON/YAML parsing, a persistent key-value store, and safe eval. |
file |
File tools — read, write, and edit files on disk. |
fs |
Filesystem/env tools — list, glob, env vars, and time. |
git |
Git tools — read-only inspection of a git repository. |
github |
GitHub tools — list pull requests, fetch diffs, post comments, approve. |
gitlab |
GitLab tools — list merge requests, fetch diffs, post notes, approve. |
http |
HTTP tool — send arbitrary HTTP requests to APIs. |
human |
AskHuman — pause a ReAct run and wait for an operator's answer. |
lock |
Distributed lock over a Redis-compatible store (Redis/KeyDB/Valkey). |
notify |
Notification tools — send email via SMTP and Telegram bot messages. |
pdf |
PDF read tool — extract text from a PDF file. |
rag_ingest |
Write tool — add documents to a vector store from a workflow YAML. |
redis |
Redis-like store tools — Redis, KeyDB, Valkey (any RESP server). |
s3 |
S3 tools — list, read, and write objects in Amazon S3 (or S3-compatible stores). |
shell |
Shell tool — run shell commands asynchronously, without a shell. |
slack |
Slack tool — send messages to a Slack channel. |
sql |
SQL tools — read-only queries and schema inspection for SQLite/PostgreSQL. |
wait_for |
WaitForTool — poll until a condition holds or a timeout elapses. |
web_fetch |
Web fetch tool — download a URL and extract its text content. |
web_search |
Web search tool — DuckDuckGo search without API key. |
Classes:
| Name | Description |
|---|---|
AskHuman |
Pause the workflow and ask the human operator a question. |
CalculatorTool |
Evaluate mathematical expressions using AST-based safe eval. |
CsvQueryTool |
Read, filter and aggregate a CSV file. |
CurrentTimeTool |
Get the current date and time. |
EditFileTool |
Edit a file by replacing the first occurrence of a string. |
GetEnvTool |
Read an environment variable, masking secret-looking values. |
GitHubApproveTool |
Approve a pull request by submitting an APPROVE review. |
GitHubGetPRChangesTool |
Fetch a pull request's diff (changed files + per-file patches). |
GitHubListOpenPRsTool |
List open pull requests for an |
GitHubPostCommentTool |
Post a comment on a pull request (as an issue comment). |
GitLabApproveTool |
Approve a merge request. |
GitLabGetMRChangesTool |
Fetch a merge request's diff (changed files + line-level changes). |
GitLabListOpenMRsTool |
List open merge requests for a project. |
GitLabPostNoteTool |
Post a note (comment) on a merge request. |
GitTool |
Inspect a git repository without mutating it. |
GlobTool |
Find files matching a glob pattern. |
HttpRequestTool |
Send an HTTP request to an API endpoint. |
JsonParseTool |
Parse a JSON string and pretty-print it (or validate it). |
KVStoreTool |
A persistent JSON-backed key-value store. |
ListDirTool |
List the contents of a directory. |
LockTool |
Distributed lock over Redis (KeyDB/Valkey supported). |
MemoryTool |
Tool that lets an agent read and write long-term memory. |
PDFReadTool |
Extract text from a PDF file. |
PythonEvalTool |
Safely evaluate a Python expression using an AST whitelist. |
RAGIngestTool |
Add documents to a vector store. |
ReadFileTool |
Read a file's contents. |
RedisTool |
Read/write a Redis-compatible store (KeyDB/Valkey supported). |
S3GetTool |
Download an object from an S3 bucket and return its contents. |
S3PutTool |
Upload text content to an object in an S3 bucket. |
S3Tool |
List objects in an S3 bucket. |
SQLDescribeTool |
Describe a table's columns and types. |
SQLListTablesTool |
List the tables in a database. |
SQLQueryTool |
Run a read-only SQL query against a database. |
SendEmailTool |
Send an email message via SMTP. |
SendTelegramTool |
Send a message via the Telegram Bot API. |
ShellTool |
Run shell commands without a shell. |
SlackSendTool |
Send a message to a Slack channel. |
WaitForTool |
Poll until a condition holds or a timeout elapses. |
WebFetchTool |
Fetch a URL and return the page's text content. |
WebSearchTool |
Search the web using DuckDuckGo (no API key required). |
WriteFileTool |
Write text content to a file. |
YamlParseTool |
Parse a YAML string and dump it as pretty JSON. |
AskHuman
¶
Bases: Tool
Pause the workflow and ask the human operator a question.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
question
|
The question to ask the operator. The run pauses and the operator's free-form reply is returned as the tool result. |
required |
Requires a checkpointer on graph.run() (the pause is a
GraphInterrupt); resume with the answer under the ask_human
state key::
graph.run(state, checkpointer=cp, resume={"ask_human": "42"})
Source code in teff/tool/builtin/human.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | |
CalculatorTool
¶
Bases: Tool
Evaluate mathematical expressions using AST-based safe eval.
Source code in teff/tool/builtin/calculator.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
CsvQueryTool
¶
Bases: Tool
Read, filter and aggregate a CSV file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action
|
|
required | |
path
|
CSV file path (falls back to config |
required | |
column
|
Column name for |
required | |
value
|
Exact value to match for |
required | |
op
|
|
required | |
group_by
|
Optional column to group |
required | |
limit
|
Max rows to return (default 100). |
required |
Args (config): path: Default CSV file path.
Source code in teff/tool/builtin/csv.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |
CurrentTimeTool
¶
Bases: Tool
Get the current date and time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict | None
|
Optional dict with |
None
|
Source code in teff/tool/builtin/fs.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | |
EditFileTool
¶
Bases: Tool
Edit a file by replacing the first occurrence of a string.
Source code in teff/tool/builtin/file.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | |
GetEnvTool
¶
Bases: Tool
Read an environment variable, masking secret-looking values.
Values whose names hint at credentials (TOKEN, API_KEY,
PASSWORD, DSN, …) are returned as *** unless the tool is
configured with mask_secrets=False.
Source code in teff/tool/builtin/fs.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | |
GitHubApproveTool
¶
Bases: _GitHubBase
Approve a pull request by submitting an APPROVE review.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repo
|
|
required | |
number
|
Pull request number. |
required |
Source code in teff/tool/builtin/github.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
GitHubGetPRChangesTool
¶
Bases: _GitHubBase
Fetch a pull request's diff (changed files + per-file patches).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repo
|
|
required | |
number
|
Pull request number (the |
required | |
max_chars
|
Cap on the returned diff text (default 20000). |
required |
Source code in teff/tool/builtin/github.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |
GitHubListOpenPRsTool
¶
Bases: _GitHubBase
List open pull requests for an owner/repo.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repo
|
|
required | |
limit
|
Maximum number of PRs to return (default 50). |
required | |
state
|
PR state filter (default |
required |
Source code in teff/tool/builtin/github.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | |
GitHubPostCommentTool
¶
Bases: _GitHubBase
Post a comment on a pull request (as an issue comment).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repo
|
|
required | |
number
|
Pull request number. |
required | |
body
|
The comment text to post. |
required |
Source code in teff/tool/builtin/github.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | |
GitLabApproveTool
¶
Bases: _GitLabBase
Approve a merge request.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project
|
Project id or URL-encoded path. |
required | |
iid
|
Merge request internal id. |
required |
Source code in teff/tool/builtin/gitlab.py
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | |
GitLabGetMRChangesTool
¶
Bases: _GitLabBase
Fetch a merge request's diff (changed files + line-level changes).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project
|
Project id or URL-encoded path. |
required | |
iid
|
Merge request internal id (the |
required | |
max_chars
|
Cap on the returned diff text (default 20000). |
required |
Source code in teff/tool/builtin/gitlab.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | |
GitLabListOpenMRsTool
¶
Bases: _GitLabBase
List open merge requests for a project.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project
|
Project id or URL-encoded path ( |
required | |
limit
|
Maximum number of MRs to return (default 50). |
required | |
state
|
MR state filter (default |
required |
Source code in teff/tool/builtin/gitlab.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
GitLabPostNoteTool
¶
Bases: _GitLabBase
Post a note (comment) on a merge request.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project
|
Project id or URL-encoded path. |
required | |
iid
|
Merge request internal id. |
required | |
body
|
The note text to post. |
required |
Source code in teff/tool/builtin/gitlab.py
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | |
GitTool
¶
Bases: Tool
Inspect a git repository without mutating it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action
|
|
required | |
limit
|
Max commits for |
required | |
ref
|
Commit/ref for |
required | |
path
|
Restrict |
required | |
max_chars
|
Cap on returned output (default 20000). |
required |
Args (config):
path: Repository directory (default .).
Source code in teff/tool/builtin/git.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | |
GlobTool
¶
Bases: Tool
Find files matching a glob pattern.
Source code in teff/tool/builtin/fs.py
44 45 46 47 48 49 50 51 52 53 54 | |
HttpRequestTool
¶
Bases: Tool
Send an HTTP request to an API endpoint.
Unlike :class:~teff.tool.builtin.web_fetch.WebFetchTool, this tool
exposes the full request surface: method, headers, and body, and
returns the raw response (status, headers, text).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict | None
|
Optional dict with |
None
|
Source code in teff/tool/builtin/http.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
JsonParseTool
¶
Bases: Tool
Parse a JSON string and pretty-print it (or validate it).
Source code in teff/tool/builtin/data.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 | |
KVStoreTool
¶
Bases: Tool
A persistent JSON-backed key-value store.
Data lives in a single JSON file (config key path). Operations
are selected with action: get, set, delete, list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict | None
|
Optional dict with |
None
|
Source code in teff/tool/builtin/data.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
ListDirTool
¶
Bases: Tool
List the contents of a directory.
Source code in teff/tool/builtin/fs.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | |
LockTool
¶
Bases: _RedisBase
Distributed lock over Redis (KeyDB/Valkey supported).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action
|
|
required | |
key
|
Lock name. |
required | |
ttl
|
Lease length in seconds for |
required |
Args (config): same as the redis tool — url or
host/port/db/password/username.
Source code in teff/tool/builtin/lock.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | |
MemoryTool
¶
Bases: Tool
Tool that lets an agent read and write long-term memory.
Usage::
memory = MemoryTool(
store=SQLiteVectorStore(path="./memory.db", dim=768),
embedder=Embedder(provider="ollama", model="nomic-embed-text"),
namespace=("users", "u1"),
)
await memory.arun(action="remember", text="prefers email over Slack")
result = await memory.arun(action="recall", query="how to reach them?")
Actions (passed as action):
remember— upsert a fact (textplus optionalmetadata). Whensimilarity_thresholdis set and a semantically close item already exists in the namespace, the new text overwrites that item instead of creating a duplicate.recall— return top-k memories for aquery(or the most recent if no query is given), formatted for a prompt.forget— delete the memory atkey.list— enumerate stored keys.
Can be built from a config dict (e.g. a tools: entry in a
workflow YAML)::
{
"name": "memory",
"store": {"type": "sqlite", "path": "./memory.db", "dim": 768},
"embedder": {"provider": "ollama", "model": "nomic-embed-text"},
"namespace": ["users", "${USER_ID}"],
"default_k": 5,
"similarity_threshold": 0.6,
}
Supported store types match RAGTool: in_memory (default),
sqlite, chroma, qdrant, pgvector, faiss, lance,
milvus, weaviate, pinecone.
Methods:
| Name | Description |
|---|---|
arun |
Run a memory operation and return a human-readable result. |
Source code in teff/memory/tool.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | |
arun
async
¶
arun(action='recall', key='', text='', value=None, query='', metadata=None, k=None)
Run a memory operation and return a human-readable result.
The namespace is fixed at construction time and can never be
overridden by the caller — an agent cannot address another owner's
memories by passing a namespace. Per-owner isolation is achieved by
building one tool per owner (namespace=("users", owner)).
Source code in teff/memory/tool.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | |
PDFReadTool
¶
Bases: Tool
Extract text from a PDF file.
Requires pypdf (from teff[tools]). Returns the text of each
page, optionally limited to max_chars characters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict | None
|
Optional dict. Currently unused, kept for config parity. |
None
|
Source code in teff/tool/builtin/pdf.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |
PythonEvalTool
¶
Bases: Tool
Safely evaluate a Python expression using an AST whitelist.
Supports numbers, arithmetic, math constants/functions, strings,
lists, tuples, dicts, and comparisons. Imports, attributes beyond
math., and calls outside the whitelist are rejected.
Source code in teff/tool/builtin/data.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | |
RAGIngestTool
¶
Bases: Tool
Add documents to a vector store.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
Raw document text to chunk, embed and store (inline content). |
required | |
path
|
File to load instead of text (see config |
required | |
source_id
|
Optional stable id for the document (default: derived). |
required | |
metadata
|
Extra metadata dict merged into every chunk. |
required |
Args (config):
embedder: Embedder config (same shape as the rag tool).
store: Vector-store config (same shape as the rag tool).
chunker: Optional chunker kwargs.
type: Loader for path — csv (default), txt, pdf,
excel. Ignored when text is provided.
text_column: Column used as text when loading a CSV/Excel file.
parent_chunks: Keep full parent text per chunk (default false).
At least one of text or path must be supplied per call. The
result is a short confirmation with the number of chunks written.
Source code in teff/tool/builtin/rag_ingest.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | |
ReadFileTool
¶
Bases: Tool
Read a file's contents.
Source code in teff/tool/builtin/file.py
6 7 8 9 10 11 12 13 14 | |
RedisTool
¶
Bases: _RedisBase
Read/write a Redis-compatible store (KeyDB/Valkey supported).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action
|
|
required | |
key
|
Key to operate on (not needed for |
required | |
value
|
Value for |
required | |
ttl
|
Expiry in seconds for |
required | |
pattern
|
Glob pattern for |
required | |
field
|
Hash field for |
required | |
member
|
Set member for |
required | |
channel
|
Channel for |
required | |
message
|
Message for |
required | |
start, stop
|
Range for |
required |
Source code in teff/tool/builtin/redis.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | |
S3GetTool
¶
Bases: S3Tool
Download an object from an S3 bucket and return its contents.
Source code in teff/tool/builtin/s3.py
61 62 63 64 65 66 67 68 69 70 71 72 73 | |
S3PutTool
¶
Bases: S3Tool
Upload text content to an object in an S3 bucket.
Source code in teff/tool/builtin/s3.py
76 77 78 79 80 81 82 83 84 85 86 87 88 | |
S3Tool
¶
Bases: Tool
List objects in an S3 bucket.
Requires boto3 (from teff[tools]). Credentials are resolved by
boto3's standard chain (env vars, ~/.aws/credentials, IAM role)
unless overridden via config.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict | None
|
Optional dict with |
None
|
Source code in teff/tool/builtin/s3.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | |
SQLDescribeTool
¶
Bases: _SQLBase
Describe a table's columns and types.
Source code in teff/tool/builtin/sql.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | |
SQLListTablesTool
¶
Bases: _SQLBase
List the tables in a database.
Source code in teff/tool/builtin/sql.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
SQLQueryTool
¶
Bases: _SQLBase
Run a read-only SQL query against a database.
Only SELECT/WITH (read) statements are allowed; anything that
would mutate data (INSERT, UPDATE, DELETE, DDL, …) is
rejected. Placeholders match the backend: ? for SQLite, %s
for PostgreSQL.
Source code in teff/tool/builtin/sql.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |
SendEmailTool
¶
Bases: Tool
Send an email message via SMTP.
Uses the stdlib smtplib/email modules — no extra dependency.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict | None
|
Optional dict with |
None
|
Source code in teff/tool/builtin/notify.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | |
SendTelegramTool
¶
Bases: Tool
Send a message via the Telegram Bot API.
Uses httpx (a core dependency). Config keys token (bot token)
and chat_id (default recipient).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict | None
|
Optional dict with |
None
|
Source code in teff/tool/builtin/notify.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | |
ShellTool
¶
Bases: Tool
Run shell commands without a shell.
The command is split into an argument vector and executed via
execve directly — /bin/sh is never involved, so &&, ;,
pipes, backticks and $(...) are inert literal arguments, never
executed. Tokens that still contain shell metacharacters (globs,
redirections, quotes, whitespace) are rejected.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root_dir
|
str
|
Working directory for the command. |
'.'
|
allowed_commands
|
list[str] | None
|
If set, only commands whose first token is in this
list are permitted. |
None
|
Source code in teff/tool/builtin/shell.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |
SlackSendTool
¶
Bases: Tool
Send a message to a Slack channel.
Requires slack-sdk (from teff[tools]) and a bot token.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict | None
|
Optional dict with |
None
|
Source code in teff/tool/builtin/slack.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |
WaitForTool
¶
Bases: Tool
Poll until a condition holds or a timeout elapses.
Conditions (condition):
url— polltarget(a URL) with HTTP GET until it responds;statuscontrols what counts as success (defaultsuccess= 2xx).redis_key— polltarget(a key) in a Redis-compatible store until it exists.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
condition
|
|
required | |
target
|
URL or key to poll. |
required | |
timeout
|
Seconds before giving up (default from config, 120.0). |
required | |
poll_interval
|
Seconds between checks (default from config, 1.0). |
required | |
status
|
For |
required |
Args (config): poll_interval, timeout, and connection keys
for the redis_key condition (same as the redis tool).
Source code in teff/tool/builtin/wait_for.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | |
WebFetchTool
¶
Bases: Tool
Fetch a URL and return the page's text content.
Uses httpx (a core dependency) for the request and
beautifulsoup4 (from teff[tools]) to strip markup.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict | None
|
Optional dict with |
None
|
timeout
|
float
|
Request timeout in seconds (default 15). |
15.0
|
user_agent
|
str
|
User-Agent header sent with the request (default "teff"). |
'teff'
|
Source code in teff/tool/builtin/web_fetch.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |
WebSearchTool
¶
Bases: Tool
Search the web using DuckDuckGo (no API key required).
Source code in teff/tool/builtin/web_search.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |
WriteFileTool
¶
Bases: Tool
Write text content to a file.
Source code in teff/tool/builtin/file.py
17 18 19 20 21 22 23 24 25 26 | |
YamlParseTool
¶
Bases: Tool
Parse a YAML string and dump it as pretty JSON.
Source code in teff/tool/builtin/data.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |