About
The Auggie Python SDK provides a programmatic interface to Auggie for building custom integrations and agents in Python applications.Installation
Usage
Basic Initialization
Full Configuration
Custom CLI Arguments
Thecli_args parameter allows you to pass additional command-line arguments to the Auggie CLI when spawning the agent process. This is useful for passing custom or experimental CLI flags that aren’t exposed as dedicated parameters.
--quiet- Only show final assistant message--max-turns <n>- Limit the number of agentic turns--retry-timeout <sec>- Timeout for rate-limit retries (seconds)--shell <name>- Select shell: bash | zsh | fish | powershell--rules <path>- Additional rules file (repeatable)--permission <rule>- Set tool permissions with ‘tool-name:policy’ format--startup-script <script>- Inline startup script to run before each command
cli_args are appended after all other CLI arguments, giving you flexibility to pass any additional flags or options supported by the underlying Auggie CLI. See the CLI reference for available command-line options.
Output Modes
The Python SDK supports multiple output modes to fit different use cases:Typed Returns
Specify the exact type you expect, and the SDK ensures the agent returns data in that format:Automatic Type Inference
When noreturn_type is specified, the agent automatically infers the best type:
Structured Data with Dataclasses
Return complex structured data using Python dataclasses:Streaming Mode
Listen to real-time updates using an event listener:int, float, str, bool, list, dict, List[T], Dict[K, V], dataclasses, Enum
Custom Functions
The Python SDK supports custom function calling, allowing you to provide Python functions that the agent can intelligently call during execution. This enables the agent to interact with external systems, perform calculations, fetch data, and more.Creating Custom Functions
Define Python functions with type hints and docstrings. The agent will automatically understand how to use them:Function Requirements
For functions to work properly with the agent:- Type Hints Required: All parameters must have type annotations
- Docstrings Required: Function must have a docstring with:
- Function description (first paragraph)
- Parameter descriptions in the
Args:section
- JSON-Serializable: Arguments and return values must be JSON-serializable
- Keyword Arguments: Functions must accept keyword arguments
Example with Multiple Functions
How It Works
- Function schemas are automatically generated from type hints and docstrings
- The agent receives the instruction and available functions
- The agent intelligently decides when to call functions
- The SDK executes the functions and sends results back to the agent
- The agent continues processing and can call more functions if needed
- Final response is returned according to
return_type
Function Calling Limits: Function calling is limited to 5 rounds to prevent infinite loops.