Agently SDK
The official SDK for developing extensions for the Agently framework. Currently focused on plugin development, with more capabilities planned for future releases.
Installation
pip install agently-sdk
For development versions or pre-releases:
pip install agently-sdk==0.5.2.dev0
See our Versioning Guide for information about our release process and version numbering.
Quick Start
Create a simple plugin:
from agently_sdk.plugins import Plugin, PluginVariable, kernel_function
class HelloPlugin(Plugin):
name = "hello"
description = "A simple hello world plugin"
default_name = PluginVariable(
name="default_name",
description="Default name to use in greetings",
default="World"
)
@kernel_function
def greet(self, name=None) -> str:
"""Greet the user."""
return f"Hello, {name or self.default_name}!"
Plugin Development
Plugin Class
The Plugin class is the base class for all Agently plugins. It provides the structure and interface for creating plugins that can be used by Agently agents.
| Attribute | Type | Required | Description |
|---|---|---|---|
name |
str |
Yes | The name of the plugin, used for identification |
description |
str |
Yes | A brief description of what the plugin does |
Methods
| Method | Description |
|---|---|
get_kernel_functions() |
Returns a dictionary of all methods decorated with @kernel_function |
get_plugin_variables() |
Returns a dictionary of all PluginVariable instances defined in the class |
PluginVariable
The PluginVariable class represents a configurable variable for a plugin. It allows plugins to be configured with different values when they are loaded by Agently.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
name |
str |
Yes | - | The name of the variable |
description |
str |
Yes | - | A description of what the variable is used for |
default |
Any |
No | None |
The default value if none is provided |
required |
bool |
No | False |
Whether this variable must be provided |
validator |
Callable[[Any], bool] |
No | None |
Optional function that validates the value |
choices |
List[Any] |
No | None |
Optional list of valid choices for the value |
type |
Type |
No | None |
Optional type constraint for the value |
Methods
| Method | Description |
|---|---|
validate(value) |
Validates a value against this variable's constraints |
to_dict() |
Converts this variable to a dictionary representation |
Kernel Function Decorator
Agently SDK provides two decorators for marking methods as callable by agents:
@agently_function- The recommended decorator for Agently plugins@kernel_function- An alias for@agently_functionprovided for backward compatibility
Both decorators wrap the kernel_function decorator from semantic_kernel.functions while maintaining compatibility with our existing code. If the Semantic Kernel package is not available, they fall back to a compatible implementation.
from agently_sdk.plugins import Plugin, PluginVariable, agently_function
class MyPlugin(Plugin):
name = "my_plugin"
description = "A sample plugin"
@agently_function
def my_function(self, param1: str, param2: int = 0) -> str:
"""
Function docstring that describes what this function does.
Args:
param1: Description of param1
param2: Description of param2
Returns:
Description of the return value
"""
# Implementation
return result
Best Practices
Plugin Design
- Clear Purpose: Each plugin should have a clear, focused purpose
- Descriptive Names: Use descriptive names for plugins, variables, and functions
- Comprehensive Documentation: Include detailed docstrings for all functions
- Input Validation: Validate all inputs to ensure robust behavior
- Error Handling: Handle errors gracefully and provide informative error messages
Variable Configuration
- Default Values: Provide sensible default values for variables when possible
- Validation: Use validators to ensure variables meet requirements
- Type Constraints: Specify value types to catch type errors early
- Descriptive Names: Use clear, descriptive names for variables
License
MIT
Release files for agently-sdk 0.5.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| agently_sdk-0.5.2.tar.gz | 18.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agently_sdk-0.5.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.7 kB
Release files / agently_sdk-0.5.2.tar.gz
| Download URL | agently_sdk-0.5.2.tar.gz |
|---|---|
| Size | 18.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0eac5be3e09b6827dbd8456daaef9a6b4495b9710e593d56de71d20e929ac393
|
|
BLAKE2b-256 checksum How to use checksums |
66591229b264a0be89755197b47c7bca8663d97d9154513c6f766b37f59ed13b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.11
|
Release files / agently_sdk-0.5.2-py3-none-any.whl
| Download URL | agently_sdk-0.5.2-py3-none-any.whl |
|---|---|
| Size | 15.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1d46a65444011028a4eb686e25a93973ffa7c12b2e78e3d62d06b6629be2c06d
|
|
BLAKE2b-256 checksum How to use checksums |
4549f3204c32dd9bcab972097d804b1cf76280176f6b00f54a7adf319e65fc13
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.11
|