Skip to main content

Respan SDK allows you to interact with the Respan API smoothly

Project description

Respan SDK

respan.ai | Documentation | PyPI

Light weight library for Respan type definitions and API payload preprocessing

Features:

  • Definition of types, what data structure Respan expects to receive in API calls.
  • Preprocessing, separating Respan-specific parameters from LLM-specific parameters
  • Conversion, converting input types from Anthropic API format into OpenAI API format.
  • Filter types — typed vocabulary for the Respan filter system, shared across BE and SDKs.

For tracing, please go to Respan Tracing instead.

Filter Types

The SDK exports the full Respan filter vocabulary so every package (backend, tracing, exporters) uses the same typed definitions instead of raw dicts.

from respan_sdk import (
    # TypedDict versions (lightweight, no validation)
    FilterParamDict,      # Dict[str, MetricFilterParam | List[MetricFilterParam] | FilterBundle]
    MetricFilterParam,    # Single filter condition (operator + value)
    FilterBundle,         # Nested group with connector (AND/OR)

    # Pydantic versions (with validation)
    FilterParamDictPydantic,
    MetricFilterParamPydantic,
    FilterBundlePydantic,

    # Value type
    MetricFilterValueType,  # Union[str, int, float, bool, List[...]]
)

Operators — the full operator vocabulary available in operator field:

Category Operators
Equality "", "=", "==", "eq", "equals"
Negation "not"
Numeric "gt", "gte", "lt", "lte"
String "contains", "icontains", "startswith", "endswith", "ilike", "regex"
Membership "in"
Null/Empty "isnull", "empty", "notEmpty", "not_empty"
Search "trigram_word_similar", "full_text_search"

Example — filter spans by status:

export_filter: FilterParamDict = {
    "status_code": {"operator": "", "value": "ERROR"},
}

Example — numeric range:

export_filter: FilterParamDict = {
    "latency": {"operator": "gte", "value": 1000},
}

Example — nested bundle with OR:

export_filter: FilterParamDict = {
    "model": {"operator": "in", "value": ["gpt-4", "claude-3"]},
    "filter_bundle": {
        "connector": "OR",
        "filter_params": {
            "status_code": {"operator": "", "value": "ERROR"},
            "latency": {"operator": "gte", "value": 5000},
        },
    },
}

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

respan_sdk-2.6.24.tar.gz (40.7 kB view details)

Uploaded Source

Built Distribution

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

respan_sdk-2.6.24-py3-none-any.whl (58.2 kB view details)

Uploaded Python 3

File details

Details for the file respan_sdk-2.6.24.tar.gz.

File metadata

  • Download URL: respan_sdk-2.6.24.tar.gz
  • Upload date:
  • Size: 40.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for respan_sdk-2.6.24.tar.gz
Algorithm Hash digest
SHA256 c1c6f89591080794203c311a07c2351f5bec3e2a4807005315ca093bdd4f17be
MD5 7c528317fa17df7212c8b5e938a8e4d1
BLAKE2b-256 d11c920fc6c852a5cfc24d992bce1f3ae24a513171c690e5eec6dd80da4477ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for respan_sdk-2.6.24.tar.gz:

Publisher: publish.yml on respanai/respan

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file respan_sdk-2.6.24-py3-none-any.whl.

File metadata

  • Download URL: respan_sdk-2.6.24-py3-none-any.whl
  • Upload date:
  • Size: 58.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for respan_sdk-2.6.24-py3-none-any.whl
Algorithm Hash digest
SHA256 f8f99bb6f2bc243866e8ca6a673c882e14f89beb14df16b0a3adff2c19104ed2
MD5 cb835a79493b754245861a4b5c033631
BLAKE2b-256 4d60e4baeabd1b3f21d1ab9129e126b9d32d8f9ce9bb33825a160898cb29c33c

See more details on using hashes here.

Provenance

The following attestation bundles were made for respan_sdk-2.6.24-py3-none-any.whl:

Publisher: publish.yml on respanai/respan

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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