Skip to main content

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},
        },
    },
}

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.7.3.tar.gz (41.0 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.7.3-py3-none-any.whl (58.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: respan_sdk-2.7.3.tar.gz
  • Upload date:
  • Size: 41.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for respan_sdk-2.7.3.tar.gz
Algorithm Hash digest
SHA256 e899749e6ac352e36c6732bf7c18a1a9c872f014309f106f470bdcd963d6c82e
MD5 433112095b669825370e59eb1d0308e6
BLAKE2b-256 34a126f69b337b5663a7820e153befb2c4c607c30686f3ebf05b4b5b0a9879e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for respan_sdk-2.7.3.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.7.3-py3-none-any.whl.

File metadata

  • Download URL: respan_sdk-2.7.3-py3-none-any.whl
  • Upload date:
  • Size: 58.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for respan_sdk-2.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3de7b1d5ceb3e9c91c1350df1fd98403ac47539c8f9ec7d2641ff973386e0780
MD5 ae0cde6c52be80dce3ec3b7eb55d6f57
BLAKE2b-256 51176ee6015b1252b30000c17425c0d8e7505bdd409ed7680a1f03f93b3f3a56

See more details on using hashes here.

Provenance

The following attestation bundles were made for respan_sdk-2.7.3-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.

Release history Release notifications | RSS feed

2.7.5

2 files

2.7.4

2 files

This release

2.7.3 This release

2 files

2.7.2

2 files

2.7.1

2 files

2.7.0

2 files

2.6.27

2 files

2.6.26

2 files

2.6.25

2 files

2.6.24

2 files

2.6.23

2 files

2.6.22

2 files

2.6.21

2 files

2.6.20

2 files

2.6.19

2 files

2.6.18

2 files

2.6.17

2 files

2.6.16

2 files

2.6.15

2 files

2.6.14

2 files

2.6.13

2 files

2.6.12

2 files

2.6.11

2 files

2.6.10

2 files

2.6.9

2 files

2.6.8

2 files

2.6.7

2 files

2.6.6

2 files

2.6.5

2 files

2.6.4

2 files

2.6.3

2 files

2.6.2

2 files

2.6.1

2 files

2.6.0

2 files

2.5.0

2 files

2.4.4

2 files

2.4.3

2 files

2.4.2

2 files

2.4.1

2 files

2.4.0

2 files

2.3.1

2 files

2.3.0

2 files

2.2.0

2 files

1.2.1

2 files

1.2.0

2 files

1.1.0

2 files

1.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page