Skip to main content

AgentScope Python SDK

Project description

AgentScope Python SDK

Python SDK for AgentScope telemetry, tracing, and instrumentation.

Install

pip install agentscope-sdk

Quick Start

from agentscope import observe_run, observe_span, trace

with observe_run("coding_agent", agent_name="demo"):
    with observe_span("llm_call", provider="openai", model="gpt-4o"):
        trace.log("sending prompt", level="info")

Set AGENTSCOPE_API_BASE=http://localhost:8080 and AGENTSCOPE_API_KEY=... as needed.

Auto Instrumentation

from agentscope import auto_instrument

auto_instrument(["openai", "anthropic"])

This enables automatic tracing hooks for supported providers.

Coding-Agent Helpers

from agentscope import coding_agent_run, read_file, run_command, write_file

with coding_agent_run(agent_name="codebot"):
    content = read_file("README.md")
    write_file("notes.txt", content)
    result = run_command("echo done")

API

  • observe_run(...)
  • observe_span(...)
  • trace.auto(providers=None)
  • trace.log(message, level="info", span_id=None, metadata=None, timestamp=None)
  • trace.update_span(span_id, data)
  • auto_trace(providers=None)
  • auto_instrument(providers=None)
  • coding_agent_run(agent_name="coding_agent")
  • instrument_coding_agent(fn)
  • read_file(path, encoding="utf-8")
  • write_file(path, content, encoding="utf-8")
  • run_command(command, cwd=None, env=None, check=False, shell=None)

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

agentscope_sdk-0.1.9.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

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

agentscope_sdk-0.1.9-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

Details for the file agentscope_sdk-0.1.9.tar.gz.

File metadata

  • Download URL: agentscope_sdk-0.1.9.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for agentscope_sdk-0.1.9.tar.gz
Algorithm Hash digest
SHA256 869aed81c66e3b37a81abb2ad1eac1eaa227e934ac5d11503ba55623c78f0136
MD5 370bc987bbef6e3f21ada6192b4bcd2f
BLAKE2b-256 a84673fa1862e10609862b7bf66c86b7ecda61145fc5887bec3aa42abd350477

See more details on using hashes here.

File details

Details for the file agentscope_sdk-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: agentscope_sdk-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 25.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for agentscope_sdk-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 67d7442f7388c07204ad0dafa93eb0dc4ecea24dcc7b0f39efdabc2c615857ec
MD5 a120e60bb3daa42384ba5059b44d1e98
BLAKE2b-256 bc3b604e26b4a41d48d42d201efcd58a90941ca87e95915b191cecd10ce430f0

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