Skip to main content

Team9 Capability Hub SDK for agent run_command Python scripts

Project description

team9-capahub

Python SDK for Team9 agent scripts to call Capability Hub from run_command.

The client reads the environment injected by Team9 agent runtime:

TEAM9_AGENT_CAPAHUB_TEMP_TOKEN=<jwt>
TEAM9_AGENT_CAPAHUB_BASE_URL=<capability-hub-url>
TEAM9_AGENT_SESSION_ID=<sessionId>

Usage

from team9_capahub import Client

capahub = Client()

result = capahub.invoke("capahub_twitter_search", {
    "query": "team9",
})

print(result)

Low-level invocation by capability id is also available:

result = capahub.invoke_by_id("capability-id", {
    "query": "team9",
})

Async task helpers:

task = capahub.get_task("task-id")
completed = capahub.wait_task(
    "task-id",
    timeout_ms=60000,
    poll_interval_ms=1000,
)

Options

import os
from team9_capahub import Client

capahub = Client(
    base_url="https://gateway.capability.team9.ai",
    token=os.environ["TEAM9_AGENT_CAPAHUB_TEMP_TOKEN"],
    session_id=os.environ.get("TEAM9_AGENT_SESSION_ID"),
    timeout_ms=15000,
)

token and base_url default to the injected environment. Token refresh is not handled inside the SDK; a later run_command receives a fresh token.

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

team9_capahub-0.0.2.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

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

team9_capahub-0.0.2-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file team9_capahub-0.0.2.tar.gz.

File metadata

  • Download URL: team9_capahub-0.0.2.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for team9_capahub-0.0.2.tar.gz
Algorithm Hash digest
SHA256 eafd078423dcf666287036ea060aaff193ae673be90e0851db8449269c399249
MD5 2e015c90d5d8c1756b26c33a4b4782dd
BLAKE2b-256 ec2515c0712131be53c594eb7209ad39c1a827f5b0be8a89b5f4adbfa49d6d60

See more details on using hashes here.

File details

Details for the file team9_capahub-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: team9_capahub-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for team9_capahub-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f9d84fecc6e1724e9f610c17b6e858c973973e027bec43f35979915538ca905e
MD5 319eb8bb54ab2e2593893a690059629b
BLAKE2b-256 8e5c26e9f8809148d1be4b4a69f98ac74aec5fadda3a44e56553e60ab3bf98f4

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