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.1.tar.gz (6.0 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.1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: team9_capahub-0.0.1.tar.gz
  • Upload date:
  • Size: 6.0 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.1.tar.gz
Algorithm Hash digest
SHA256 87a1d96c8622860cb022a1eb769e2c6d3a81c5efd92b86acbcf2d0e8eb7dc607
MD5 44f3526e72bdfffd8fd81c2df22653e3
BLAKE2b-256 0090dca9565dc333ab72d9923e97c47dbc53be0614a631802216ffbf4ce4b704

See more details on using hashes here.

File details

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

File metadata

  • Download URL: team9_capahub-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5f9868a49fbe1103e1a022c7d79c31cfab7d8ef452e7f2528fdc24e1e7d0cb7d
MD5 695319255f8ebd045777c0c98fa437b9
BLAKE2b-256 95000e1010ddbce319514f061d568108d3779b0e05882b6b761cca018f320e12

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