Type Definitions
All types are Pydantic BaseModel subclasses, providing automatic validation, serialization, and IDE completion.
from faos import ShortcutResolution, ShortcutDefinition, AgentResponse
AgentResponse​
Response from an agent invocation.
class AgentResponse(BaseModel):
content: str
agent_id: str
metadata: dict[str, Any]
| Field | Type | Description |
|---|---|---|
content | str | The agent's response text |
agent_id | str | ID of the agent that responded |
metadata | dict[str, Any] | Additional response metadata |
response = await client.shortcut("bank credit-analyst")
print(response.content) # Agent's text output
print(response.agent_id) # e.g., "agent_abc123"
print(response.metadata) # e.g., {"tokens_used": 1500}
ShortcutResolution​
Result of resolving a shortcut command to an agent.
class ShortcutResolution(BaseModel):
resolved: bool
agent_id: str | None
module_key: str | None
module_name: str | None
agent_name: str | None
task_template: str | None
capabilities: list[str]
suggestions: list[str]
| Field | Type | Description |
|---|---|---|
resolved | bool | Whether the shortcut was resolved |
agent_id | str | None | Resolved agent ID |
module_key | str | None | Module key (e.g., "faos-bank") |
module_name | str | None | Module display name |
agent_name | str | None | Agent display name |
task_template | str | None | Default task template for agent |
capabilities | list[str] | Agent capabilities |
suggestions | list[str] | Suggested shortcuts if unresolved |
resolution = await client.shortcuts.resolve("bank credit-analyst")
if resolution.resolved:
print(resolution.agent_name) # "Credit Risk Analyst"
print(resolution.module_name) # "Banking & Finance"
print(resolution.capabilities) # ["credit_analysis", "risk_assessment"]
ShortcutDefinition​
Definition of an available shortcut.
class ShortcutDefinition(BaseModel):
pattern: str
type: Literal["module", "agent", "command"]
description: str
module_key: str
agent_id: str | None
examples: list[str]
| Field | Type | Description |
|---|---|---|
pattern | str | Shortcut pattern (e.g., "bank credit-analyst") |
type | "module" | "agent" | "command" | Shortcut type |
description | str | Human-readable description |
module_key | str | Module key |
agent_id | str | None | Agent ID if agent-level shortcut |
examples | list[str] | Usage examples |
shortcuts = await client.shortcuts.list(module="faos-bank")
for s in shortcuts:
print(f"{s.pattern} ({s.type}): {s.description}")