Helpers API¶
Ergonomic helpers over the generated client, from smallestai.atoms.helpers.
smallestai.atoms.helpers.AgentTools
¶
Read-modify-write tool configuration for single-prompt agents, via the branch/revision versioning flow.
Can be used standalone::
tools = AgentTools(api_key="sk_...")
or pointed at a non-prod host::
tools = AgentTools(api_key="sk_...", base_url="https://api.dev.smallest.ai/atoms/v1")
add_transfer_call(agent_id, *, number, transfer_type='cold_transfer', name='transfer_call', description=None, on_hold_music=None, transfer_only_if_human=None, enabled=True, make_live=True, **extra)
¶
Add a transfer_call tool that forwards the call to number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
number
|
str
|
E.164 destination, e.g. |
required |
transfer_type
|
str
|
|
'cold_transfer'
|
on_hold_music
|
str
|
Audio played to the caller while the transfer bridges, so the line is
not silent. One of |
None
|
transfer_only_if_human
|
bool
|
Only transfer if a human (not voicemail) answers the destination. |
None
|
make_live
|
bool
|
Publish and activate immediately (default). |
True
|
The
|
|
required | |
tools
|
|
required |
set_tools(agent_id, tools, *, replace=False, make_live=True, label='SDK tool update')
¶
Write tools through the branch flow (draft -> publish -> make-live).
Default merges by tool name (incoming overwrite same-named tools; other
tools and the prompt are preserved - config is section-based). replace=True
overwrites the whole tool list. make_live=False publishes a revision but
does not activate it.
Returns the tool list (wire dicts) that was written.
get_tools(agent_id)
¶
Return the agent's current live tools as typed :class:Tool models.
remove_tool(agent_id, name, *, make_live=True)
¶
Remove the tool with the given name (no-op if absent).
smallestai.atoms.helpers.agent_tools.AgentToolsError
¶
Bases: Exception
An agent could not be configured for tools (no branch, publish failed, ...).