A framework for building and running AI agents
Project description
AgentHub SDK
Simple interface to make agents runnable on AgentHub.
Installation
Add agenthub_sdk to your list of dependencies in mix.exs:
def deps do
[
{:agenthub_sdk, "~> 1.0.2"}
]
end
Usage
The AgentHub SDK provides a simple behavior for creating agent runners that can be executed on the AgentHub platform.
Creating an Agent
To create an agent, implement the AgenthubSdk behavior:
defmodule MyAgent do
@behaviour AgenthubSdk
def run(input) do
# Process the input and return a result
{:ok, %{result: "processed", input: input}}
end
end
Running an Agent
Use AgenthubSdk.run/2 to execute your agent:
result = AgenthubSdk.run(MyAgent, %{data: "test"})
case result do
{:ok, output} -> IO.puts("Success: #{inspect(output)}")
{:error, reason} -> IO.puts("Error: #{inspect(reason)}")
end
API Reference
AgenthubSdk.run/2
Runs an agent with the given input.
Parameters:
agent_module- The module implementing the AgentRunner behaviorinput- The input data to pass to the agent
Returns:
{:ok, result}- On successful execution{:error, reason}- On failure
Behavior Callback
Your agent module must implement:
@callback run(input :: any()) :: {:ok, any()} | {:error, any()}
License
ISC
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agenthub_py-0.1.0.tar.gz.
File metadata
- Download URL: agenthub_py-0.1.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
970fea7a4fe2712734f087a8c52badc09fcbe9aa9c37c6442e615f861f860334
|
|
| MD5 |
68d60a380097323fc92b186d455cd317
|
|
| BLAKE2b-256 |
27779bc99e4575e25dd1410ebb8d2c004a6a1eecdd8bcc4f3854f71087505be4
|
File details
Details for the file agenthub_py-0.1.0-py3-none-any.whl.
File metadata
- Download URL: agenthub_py-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aea7de7423e0ff5c35424834567df4b572af62f88a3cb631f4e0234277306c6c
|
|
| MD5 |
9b8242dbd8fd79698fb553f1105ef487
|
|
| BLAKE2b-256 |
b91de29b846484d463812bab328ca09e9fbdf718fb52111811548f147569c105
|