Skip to main content

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 behavior
  • input - 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agenthub_py-0.1.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agenthub_py-0.1.0-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

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

Hashes for agenthub_py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 970fea7a4fe2712734f087a8c52badc09fcbe9aa9c37c6442e615f861f860334
MD5 68d60a380097323fc92b186d455cd317
BLAKE2b-256 27779bc99e4575e25dd1410ebb8d2c004a6a1eecdd8bcc4f3854f71087505be4

See more details on using hashes here.

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

Hashes for agenthub_py-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aea7de7423e0ff5c35424834567df4b572af62f88a3cb631f4e0234277306c6c
MD5 9b8242dbd8fd79698fb553f1105ef487
BLAKE2b-256 b91de29b846484d463812bab328ca09e9fbdf718fb52111811548f147569c105

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page