Skip to content

Latest commit

 

History

History
59 lines (45 loc) · 3.19 KB

File metadata and controls

59 lines (45 loc) · 3.19 KB

Integrations SDK for Autohive

Tests Coverage PyPI version Python License: MIT

Build integrations for Autohive's AI agent platform. Define actions that Autohive agents can execute — call APIs, process data, and connect to third-party services.

Installation

pip install autohive-integrations-sdk

Quick Example

from autohive_integrations_sdk import (
    Integration, ExecutionContext, ActionHandler, ActionResult
)
from typing import Dict, Any

integration = Integration.load()

@integration.action("fetch_data")
class FetchData(ActionHandler):
    async def execute(self, inputs: Dict[str, Any], context: ExecutionContext) -> ActionResult:
        response = await context.fetch(
            "https://api.example.com/data",
            headers={"Authorization": f"Bearer {context.auth['api_key']}"}
        )
        return ActionResult(data=response.data)

Key Features

  • Action handlers — async handlers with typed inputs/outputs and built-in HTTP client
  • Authentication — flexible auth config (API keys, OAuth, custom fields)
  • Billing support — report per-action costs via ActionResult.cost_usd
  • Error handlingActionError for expected application-level errors
  • Connected accounts — expose authorized user identity back to the platform
  • Validation — JSON Schema input/output validation with detailed error reporting

Documentation

Guide Description
Building Your First Integration End-to-end tutorial covering config, actions, auth, testing
Integration Structure Directory layout, config.json schema reference
Patterns & Best Practices Pagination, API helpers, multi-field auth
Starter Template Copy this to begin a new integration

Links