ShortcutsClient
Lower-level client for shortcut resolution and listing. Accessible via FaosClient.shortcuts.
from faos import FaosClient
client = FaosClient(api_key="sk-...")
shortcuts_client = client.shortcuts
Methods​
resolve(command, context=None)​
Resolve a shortcut command to an agent. Returns resolution details including the agent ID, module info, and capabilities.
async def resolve(
self, command: str, context: dict[str, Any] | None = None
) -> ShortcutResolution
| Parameter | Type | Description |
|---|---|---|
command | str | Shortcut command (e.g., "bank credit-analyst") |
context | dict[str, Any] | None | Optional context hints for resolution |
Returns: ShortcutResolution
Raises:
ShortcutRateLimitErrorif rate limit is exceededhttpx.HTTPStatusErrorfor other HTTP errors
resolution = await client.shortcuts.resolve("bank credit-analyst")
if resolution.resolved:
print(f"Agent: {resolution.agent_name}")
print(f"Module: {resolution.module_name}")
print(f"Capabilities: {resolution.capabilities}")
else:
print(f"Suggestions: {resolution.suggestions}")
list(module=None, search=None)​
List available shortcuts with optional filtering.
async def list(
self, module: str | None = None, search: str | None = None
) -> list[ShortcutDefinition]
| Parameter | Type | Description |
|---|---|---|
module | str | None | Filter by module key (e.g., "faos-bank") |
search | str | None | Search query string |
Returns: list[ShortcutDefinition]
Raises:
ShortcutRateLimitErrorif rate limit is exceededhttpx.HTTPStatusErrorfor other HTTP errors
# List all shortcuts
all_shortcuts = await client.shortcuts.list()
# Filter by module
bank_shortcuts = await client.shortcuts.list(module="faos-bank")
# Search
results = await client.shortcuts.list(search="credit")
for shortcut in results:
print(f"{shortcut.pattern}: {shortcut.description}")
print(f" Type: {shortcut.type}")
print(f" Examples: {shortcut.examples}")