Skip to content

Python SDK for AI agent monitoring, LLM cost tracking, benchmarking, and more. Integrates with most LLMs and agent frameworks including CrewAI, Agno, OpenAI Agents SDK, Langchain, Autogen, AG2, and CamelAI

16.0 KB
Raw Blame
interactions:
- request:
    body: '{"session": {"end_timestamp": null, "end_state": "Indeterminate", "session_id":
      "b6dde605-486f-4b05-a2da-21587b2c43c3", "init_timestamp": "2025-01-12T03:23:33.063611+00:00",
      "tags": [], "video": null, "end_state_reason": null, "host_env": {"SDK": {"AgentOps
      SDK Version": "0.3.22", "Python Version": "3.13.0", "System Packages": {"future_fstrings":
      "1.2.0", "importlib.metadata": "6.7.0", "pluggy": "1.2.0", "iniconfig": "2.0.0",
      "pytest": "7.4.0", "pytest_recording": "0.13.2", "termcolor": "2.3.0", "pytest_sugar":
      "1.0.0", "pytest_cov": "4.1.0", "coverage": "7.2.7", "pytest_mock": "3.11.1",
      "pytest_asyncio": "0.21.2", "urllib3": "2.3.0", "charset_normalizer": "3.4.0",
      "idna": "3.10", "certifi": "2024.8.30", "requests": "2.31.0", "six": "1.16.0",
      "requests_mock": "1.11.0", "pyfakefs": "5.7.1", "fancycompleter": "0.9.1", "sniffio":
      "1.3.1", "anyio": "4.7.0", "colorama": "0.4.6", "networkx": "2.6.3", "pytest_depends":
      "1.0.1", "psutil": "5.9.8", "packaging": "23.2", "wrapt": "1.16.0", "deprecated":
      "1.2.15", "zipp": "3.15.0", "importlib_metadata": "6.7.0", "opentelemetry.sdk":
      "1.29.0", "agentops": "0.3.22", "typing_extensions": "4.12.2", "pydantic": "2.10.4",
      "annotated_types": "0.7.0", "pydantic_core": "2.27.2", "click": "8.1.8", "pygments":
      "2.17.2", "rich": "13.8.1", "httpx": "0.28.1", "distro": "1.9.0", "jiter": "0.8.2",
      "openai": "1.58.1", "starlette": "0.41.3", "email_validator": "2.2.0", "python_multipart":
      "0.0.20", "fastapi": "0.115.6", "h11": "0.14.0", "httpcore": "1.0.7"}}, "OS":
      {"Hostname": "c0.station", "OS": "Darwin", "OS Version": "Darwin Kernel Version
      24.1.0: Thu Oct 10 21:03:11 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6020",
      "OS Release": "24.1.0"}, "CPU": {"Physical cores": 12, "Total cores": 12, "CPU
      Usage": "17.0%"}, "RAM": {"Total": "16.00 GB", "Available": "4.45 GB", "Used":
      "6.39 GB", "Percentage": "72.2%"}, "Disk": {"/dev/disk3s1s1": {"Mountpoint":
      "/", "Total": "926.35 GB", "Used": "10.00 GB", "Free": "121.31 GB", "Percentage":
      "7.6%"}, "/dev/disk3s6": {"Mountpoint": "/System/Volumes/VM", "Total": "926.35
      GB", "Used": "3.00 GB", "Free": "121.31 GB", "Percentage": "2.4%"}, "/dev/disk3s2":
      {"Mountpoint": "/System/Volumes/Preboot", "Total": "926.35 GB", "Used": "6.15
      GB", "Free": "121.31 GB", "Percentage": "4.8%"}, "/dev/disk3s4": {"Mountpoint":
      "/System/Volumes/Update", "Total": "926.35 GB", "Used": "0.00 GB", "Free": "121.31
      GB", "Percentage": "0.0%"}, "/dev/disk1s2": {"Mountpoint": "/System/Volumes/xarts",
      "Total": "0.49 GB", "Used": "0.01 GB", "Free": "0.47 GB", "Percentage": "1.2%"},
      "/dev/disk1s1": {"Mountpoint": "/System/Volumes/iSCPreboot", "Total": "0.49
      GB", "Used": "0.01 GB", "Free": "0.47 GB", "Percentage": "1.1%"}, "/dev/disk1s3":
      {"Mountpoint": "/System/Volumes/Hardware", "Total": "0.49 GB", "Used": "0.00
      GB", "Free": "0.47 GB", "Percentage": "0.8%"}, "/dev/disk3s5": {"Mountpoint":
      "/System/Volumes/Data", "Total": "926.35 GB", "Used": "784.80 GB", "Free": "121.31
      GB", "Percentage": "86.6%"}}, "Installed Packages": {"Installed Packages": {"agentops":
      "0.3.22", "rich": "13.8.1", "rich-toolkit": "0.12.0", "pytest-recording": "0.13.2",
      "shellingham": "1.5.4", "opentelemetry-api": "1.29.0", "opentelemetry-proto":
      "1.29.0", "idna": "3.10", "fastapi": "0.115.6", "PyYAML": "6.0.1", "types-urllib3":
      "1.26.25.14", "Pygments": "2.17.2", "networkx": "2.6.3", "colorama": "0.4.6",
      "uvicorn": "0.34.0", "typer": "0.15.1", "fancycompleter": "0.9.1", "googleapis-common-protos":
      "1.66.0", "dnspython": "2.7.0", "multidict": "6.0.5", "six": "1.16.0", "mypy-extensions":
      "1.0.0", "pluggy": "1.2.0", "h11": "0.14.0", "opentelemetry-sdk": "1.29.0",
      "pytest-sugar": "1.0.0", "pyrepl": "0.9.0", "iniconfig": "2.0.0", "tqdm": "4.67.1",
      "urllib3": "2.3.0", "protobuf": "5.29.3", "python-dotenv": "0.21.1", "click":
      "8.1.8", "numpy": "1.26.4", "zipp": "3.15.0", "packaging": "23.2", "markdown-it-py":
      "2.2.0", "certifi": "2024.8.30", "pytest-cov": "4.1.0", "openai": "1.58.1",
      "opentelemetry-semantic-conventions": "0.50b0", "propcache": "0.2.1", "Jinja2":
      "3.1.5", "SQLAlchemy": "2.0.36", "vcrpy": "7.0.0", "requests": "2.31.0", "pytest":
      "7.4.0", "sniffio": "1.3.1", "pytest-mock": "3.11.1", "fastapi-cli": "0.0.7",
      "mdurl": "0.1.2", "opentelemetry-exporter-otlp-proto-common": "1.29.0", "yarl":
      "1.18.3", "Deprecated": "1.2.15", "importlib-metadata": "6.7.0", "psutil": "5.9.8",
      "pydantic_core": "2.27.2", "httpcore": "1.0.7", "websockets": "14.1", "pydantic":
      "2.10.4", "future-fstrings": "1.2.0", "pytest-asyncio": "0.21.2", "python-multipart":
      "0.0.20", "starlette": "0.41.3", "requests-mock": "1.11.0", "distro": "1.9.0",
      "jiter": "0.8.2", "ruff": "0.8.1", "pyfakefs": "5.7.1", "httptools": "0.6.4",
      "typing_extensions": "4.12.2", "wmctrl": "0.5", "httpx": "0.28.1", "attrs":
      "24.3.0", "anyio": "4.7.0", "mypy": "1.4.1", "watchfiles": "1.0.4", "email_validator":
      "2.2.0", "charset-normalizer": "3.4.0", "pdbpp": "0.10.3", "langchain": "0.0.27",
      "uvloop": "0.21.0", "termcolor": "2.3.0", "annotated-types": "0.7.0", "pytest-depends":
      "1.0.1", "opentelemetry-exporter-otlp-proto-http": "1.29.0", "types-requests":
      "2.31.0.6", "wrapt": "1.16.0", "coverage": "7.2.7", "MarkupSafe": "3.0.2"}},
      "Project Working Directory": {"Project Working Directory": "/Users/noob/agentops"},
      "Virtual Environment": {"Virtual Environment": "/Users/noob/agentops/.venv"}},
      "config": "", "jwt": null, "_lock": "", "_end_session_lock": "", "token_cost":
      "", "_session_url": "", "event_counts": {"llms": 0, "tools": 0, "actions": 0,
      "errors": 0, "apis": 0}}}'
    headers:
      Accept:
      - '*/*'
      Accept-Encoding:
      - gzip, deflate
      Connection:
      - keep-alive
      Content-Length:
      - '5519'
      Content-Type:
      - application/json; charset=UTF-8
      Keep-Alive:
      - timeout=10, max=1000
      User-Agent:
      - python-requests/2.31.0
      x-agentops-api-key:
      - REDACTED
    method: POST
    uri: https://api.agentops.ai/v2/create_session
  response:
    body:
      string: '{"jwt":"REDACTED","session_url":"https://app.agentops.ai/drilldown?session_id=b6dde605-486f-4b05-a2da-21587b2c43c3","status":"Success"}'
    headers:
      Content-Length:
      - '310'
      Content-Type:
      - application/json
      Date:
      - Sun, 12 Jan 2025 03:23:33 GMT
      Server:
      - railway-edge
      X-Railway-Request-Id: REDACTED
    status:
      code: 200
      message: OK
- request:
    body: ''
    headers:
      accept:
      - '*/*'
      accept-encoding:
      - gzip, deflate
      connection:
      - keep-alive
      host:
      - testserver
      user-agent:
      - testclient
    method: GET
    uri: http://testserver/completion
  response:
    body:
      string: '{"response":"Done","execution_time_seconds":0.066}'
    headers:
      content-length:
      - '50'
      content-type:
      - application/json
    status:
      code: 200
      message: OK
- request:
    body: ''
    headers:
      accept:
      - '*/*'
      accept-encoding:
      - gzip, deflate
      connection:
      - keep-alive
      host:
      - testserver
      user-agent:
      - testclient
    method: GET
    uri: http://testserver/completion
  response:
    body:
      string: '{"response":"Done","execution_time_seconds":0.066}'
    headers:
      content-length:
      - '50'
      content-type:
      - application/json
    status:
      code: 200
      message: OK
- request:
    body: '{"events": [{"id": "ff3bac2b-9c2f-42b2-bf72-1acf0ea17bb2", "event_type":
      "tools", "init_timestamp": "2025-01-12T03:23:33.896970+00:00", "end_timestamp":
      "2025-01-12T03:23:33.963196+00:00", "params": {"x": "Hello"}, "returns": null,
      "agent_id": null, "name": "foo", "logs": null, "tool_name": "foo", "session_id":
      "b6dde605-486f-4b05-a2da-21587b2c43c3"}, {"id": "fb4199a4-f39b-41a4-ad84-e33137ad57c4",
      "event_type": "tools", "init_timestamp": "2025-01-12T03:23:33.897051+00:00",
      "end_timestamp": "2025-01-12T03:23:33.963347+00:00", "params": {"x": "Hello"},
      "returns": null, "agent_id": null, "name": "foo", "logs": null, "tool_name":
      "foo", "session_id": "b6dde605-486f-4b05-a2da-21587b2c43c3"}]}'
    headers:
      Accept:
      - '*/*'
      Accept-Encoding:
      - gzip, deflate
      Connection:
      - keep-alive
      Content-Length:
      - '696'
      Content-Type:
      - application/json; charset=UTF-8
      Keep-Alive:
      - timeout=10, max=1000
      User-Agent:
      - python-requests/2.31.0
      authorization:
      - REDACTED
      x-agentops-api-key:
      - REDACTED
    method: POST
    uri: https://api.agentops.ai/v2/create_events
  response:
    body:
      string: '"Success"'
    headers:
      Content-Length:
      - '9'
      Content-Type:
      - application/json
      Date:
      - Sun, 12 Jan 2025 03:23:34 GMT
      Server:
      - railway-edge
      X-Railway-Request-Id: REDACTED
    status:
      code: 200
      message: OK
- request:
    body: '{"session": {"end_timestamp": "2025-01-12T03:23:34.764692+00:00", "end_state":
      "Indeterminate", "session_id": "b6dde605-486f-4b05-a2da-21587b2c43c3", "init_timestamp":
      "2025-01-12T03:23:33.063611+00:00", "tags": [], "video": null, "end_state_reason":
      null, "host_env": {"SDK": {"AgentOps SDK Version": "0.3.22", "Python Version":
      "3.13.0", "System Packages": {"future_fstrings": "1.2.0", "importlib.metadata":
      "6.7.0", "pluggy": "1.2.0", "iniconfig": "2.0.0", "pytest": "7.4.0", "pytest_recording":
      "0.13.2", "termcolor": "2.3.0", "pytest_sugar": "1.0.0", "pytest_cov": "4.1.0",
      "coverage": "7.2.7", "pytest_mock": "3.11.1", "pytest_asyncio": "0.21.2", "urllib3":
      "2.3.0", "charset_normalizer": "3.4.0", "idna": "3.10", "certifi": "2024.8.30",
      "requests": "2.31.0", "six": "1.16.0", "requests_mock": "1.11.0", "pyfakefs":
      "5.7.1", "fancycompleter": "0.9.1", "sniffio": "1.3.1", "anyio": "4.7.0", "colorama":
      "0.4.6", "networkx": "2.6.3", "pytest_depends": "1.0.1", "psutil": "5.9.8",
      "packaging": "23.2", "wrapt": "1.16.0", "deprecated": "1.2.15", "zipp": "3.15.0",
      "importlib_metadata": "6.7.0", "opentelemetry.sdk": "1.29.0", "agentops": "0.3.22",
      "typing_extensions": "4.12.2", "pydantic": "2.10.4", "annotated_types": "0.7.0",
      "pydantic_core": "2.27.2", "click": "8.1.8", "pygments": "2.17.2", "rich": "13.8.1",
      "httpx": "0.28.1", "distro": "1.9.0", "jiter": "0.8.2", "openai": "1.58.1",
      "starlette": "0.41.3", "email_validator": "2.2.0", "python_multipart": "0.0.20",
      "fastapi": "0.115.6", "h11": "0.14.0", "httpcore": "1.0.7"}}, "OS": {"Hostname":
      "c0.station", "OS": "Darwin", "OS Version": "Darwin Kernel Version 24.1.0: Thu
      Oct 10 21:03:11 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6020", "OS Release":
      "24.1.0"}, "CPU": {"Physical cores": 12, "Total cores": 12, "CPU Usage": "17.0%"},
      "RAM": {"Total": "16.00 GB", "Available": "4.45 GB", "Used": "6.39 GB", "Percentage":
      "72.2%"}, "Disk": {"/dev/disk3s1s1": {"Mountpoint": "/", "Total": "926.35 GB",
      "Used": "10.00 GB", "Free": "121.31 GB", "Percentage": "7.6%"}, "/dev/disk3s6":
      {"Mountpoint": "/System/Volumes/VM", "Total": "926.35 GB", "Used": "3.00 GB",
      "Free": "121.31 GB", "Percentage": "2.4%"}, "/dev/disk3s2": {"Mountpoint": "/System/Volumes/Preboot",
      "Total": "926.35 GB", "Used": "6.15 GB", "Free": "121.31 GB", "Percentage":
      "4.8%"}, "/dev/disk3s4": {"Mountpoint": "/System/Volumes/Update", "Total": "926.35
      GB", "Used": "0.00 GB", "Free": "121.31 GB", "Percentage": "0.0%"}, "/dev/disk1s2":
      {"Mountpoint": "/System/Volumes/xarts", "Total": "0.49 GB", "Used": "0.01 GB",
      "Free": "0.47 GB", "Percentage": "1.2%"}, "/dev/disk1s1": {"Mountpoint": "/System/Volumes/iSCPreboot",
      "Total": "0.49 GB", "Used": "0.01 GB", "Free": "0.47 GB", "Percentage": "1.1%"},
      "/dev/disk1s3": {"Mountpoint": "/System/Volumes/Hardware", "Total": "0.49 GB",
      "Used": "0.00 GB", "Free": "0.47 GB", "Percentage": "0.8%"}, "/dev/disk3s5":
      {"Mountpoint": "/System/Volumes/Data", "Total": "926.35 GB", "Used": "784.80
      GB", "Free": "121.31 GB", "Percentage": "86.6%"}}, "Installed Packages": {"Installed
      Packages": {"agentops": "0.3.22", "rich": "13.8.1", "rich-toolkit": "0.12.0",
      "pytest-recording": "0.13.2", "shellingham": "1.5.4", "opentelemetry-api": "1.29.0",
      "opentelemetry-proto": "1.29.0", "idna": "3.10", "fastapi": "0.115.6", "PyYAML":
      "6.0.1", "types-urllib3": "1.26.25.14", "Pygments": "2.17.2", "networkx": "2.6.3",
      "colorama": "0.4.6", "uvicorn": "0.34.0", "typer": "0.15.1", "fancycompleter":
      "0.9.1", "googleapis-common-protos": "1.66.0", "dnspython": "2.7.0", "multidict":
      "6.0.5", "six": "1.16.0", "mypy-extensions": "1.0.0", "pluggy": "1.2.0", "h11":
      "0.14.0", "opentelemetry-sdk": "1.29.0", "pytest-sugar": "1.0.0", "pyrepl":
      "0.9.0", "iniconfig": "2.0.0", "tqdm": "4.67.1", "urllib3": "2.3.0", "protobuf":
      "5.29.3", "python-dotenv": "0.21.1", "click": "8.1.8", "numpy": "1.26.4", "zipp":
      "3.15.0", "packaging": "23.2", "markdown-it-py": "2.2.0", "certifi": "2024.8.30",
      "pytest-cov": "4.1.0", "openai": "1.58.1", "opentelemetry-semantic-conventions":
      "0.50b0", "propcache": "0.2.1", "Jinja2": "3.1.5", "SQLAlchemy": "2.0.36", "vcrpy":
      "7.0.0", "requests": "2.31.0", "pytest": "7.4.0", "sniffio": "1.3.1", "pytest-mock":
      "3.11.1", "fastapi-cli": "0.0.7", "mdurl": "0.1.2", "opentelemetry-exporter-otlp-proto-common":
      "1.29.0", "yarl": "1.18.3", "Deprecated": "1.2.15", "importlib-metadata": "6.7.0",
      "psutil": "5.9.8", "pydantic_core": "2.27.2", "httpcore": "1.0.7", "websockets":
      "14.1", "pydantic": "2.10.4", "future-fstrings": "1.2.0", "pytest-asyncio":
      "0.21.2", "python-multipart": "0.0.20", "starlette": "0.41.3", "requests-mock":
      "1.11.0", "distro": "1.9.0", "jiter": "0.8.2", "ruff": "0.8.1", "pyfakefs":
      "5.7.1", "httptools": "0.6.4", "typing_extensions": "4.12.2", "wmctrl": "0.5",
      "httpx": "0.28.1", "attrs": "24.3.0", "anyio": "4.7.0", "mypy": "1.4.1", "watchfiles":
      "1.0.4", "email_validator": "2.2.0", "charset-normalizer": "3.4.0", "pdbpp":
      "0.10.3", "langchain": "0.0.27", "uvloop": "0.21.0", "termcolor": "2.3.0", "annotated-types":
      "0.7.0", "pytest-depends": "1.0.1", "opentelemetry-exporter-otlp-proto-http":
      "1.29.0", "types-requests": "2.31.0.6", "wrapt": "1.16.0", "coverage": "7.2.7",
      "MarkupSafe": "3.0.2"}}, "Project Working Directory": {"Project Working Directory":
      "/Users/noob/agentops"}, "Virtual Environment": {"Virtual Environment": "/Users/noob/agentops/.venv"}},
      "config": "", "jwt": "REDACTED",
      "_lock": "", "_end_session_lock": "", "token_cost": "", "_session_url": "",
      "event_counts": {"llms": 0, "tools": 2, "actions": 0, "errors": 0, "apis": 0},
      "is_running": false, "_tracer_provider": "", "_otel_tracer": "", "_otel_exporter":
      ""}}'
    headers:
      Accept:
      - '*/*'
      Accept-Encoding:
      - gzip, deflate
      Connection:
      - keep-alive
      Content-Length:
      - '5817'
      Content-Type:
      - application/json; charset=UTF-8
      Keep-Alive:
      - timeout=10, max=1000
      User-Agent:
      - python-requests/2.31.0
      authorization:
      - REDACTED
      x-agentops-api-key:
      - REDACTED
    method: POST
    uri: https://api.agentops.ai/v2/update_session
  response:
    body:
      string: '{"session_url":"https://app.agentops.ai/drilldown?session_id=b6dde605-486f-4b05-a2da-21587b2c43c3","status":"success","token_cost":"0.00"}'
    headers:
      Content-Length:
      - '138'
      Content-Type:
      - application/json
      Date:
      - Sun, 12 Jan 2025 03:23:35 GMT
      Server:
      - railway-edge
      X-Railway-Request-Id: REDACTED
    status:
      code: 200
      message: OK
version: 1