Skip to main content

SegmentStream connections SDK

segmentstream-connections holds the classes a workspace declares its connections with in connections/connections.py, and the inspection that turns them into the connections manifest Cloud reads at deploy. It depends only on pydantic: declaring a connection installs no pipeline runtime.

from segmentstream_connections import GoogleAdsConnection, TelegramBotConnection, secret_ref

connections = (
    GoogleAdsConnection(key="google_ads"),
    TelegramBotConnection(key="telegram", token=secret_ref("agent-telegram-token")),
)

Pipelines, the ontology and the agent refer to a connection by its key. Pipeline code reaches a connection through segmentstream.get_connection(key).get_http_client() from the pipeline SDK; credentials stay in Cloud and are added to each request by its connection proxy.

An API-key, OAuth2 or client-credentials connection may declare an API as a remote MCP server, with the tools the workspace allows; Cloud refuses calls of any other tool and of a tool whose fixed arguments differ, and a read-only connection calls only its read tools:

from segmentstream_connections import ApiKeyConnection, Bearer, McpApi, McpTool, Secret

ApiKeyConnection(
    key="github",
    name="GitHub",
    provider="github",
    headers={"Authorization": Bearer(Secret(label="Token"))},
    apis={
        "api": "https://api.github.com/repos/o/r/",
        "mcp": McpApi(
            "https://api.githubcopilot.com/mcp/",
            tools={
                "search_code": McpTool.read(),
                "issue_write": McpTool.write(method="create", owner="o", repo="r"),
            },
        ),
    },
    default_api="api",
)

connection.apis keeps every API's URL; connection.mcp holds the MCP declarations.

python -I -m segmentstream_connections inspect OUTPUT writes the manifest of the connections.py in the current directory. Cloud runs it in an isolated build of the connections/ project; it never runs against credentials.

See docs/connections.md in a workspace project for every preset, custom OAuth2, API-key and client-credentials connections, and authorization.

Compatibility

The pipeline SDK depends on this package and still re-exports its classes from segmentstream.connections and segmentstream, so workspaces that import them from there keep deploying. Import them from segmentstream_connections instead; the re-export will be removed.

Metadata

Release files for segmentstream-connections 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for segmentstream-connections 0.3.0
File Size Uploaded Provenance Actions
segmentstream_connections-0.3.0.tar.gz 58.0 kB With provenance Details for segmentstream_connections-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for segmentstream-connections 0.3.0
File Interpreter ABI Platform Actions
segmentstream_connections-0.3.0-py3-none-any.whl Python 3 none any Details for segmentstream_connections-0.3.0-py3-none-any.whl

Total release size: 94.9 kB

Release files / segmentstream_connections-0.3.0.tar.gz

Download URL segmentstream_connections-0.3.0.tar.gz
Size 58.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8da3d68d72ab7d33d1698f930c5d2f7b87a68f0e125c5348385a9a0e98a66360
BLAKE2b-256 checksum
How to use checksums
fe4fdc0fc6b7f23e2a880f784b7b61dfc04d3f1b2e3c82a7d55988fd4d08a5a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Release files / segmentstream_connections-0.3.0-py3-none-any.whl

Download URL segmentstream_connections-0.3.0-py3-none-any.whl
Size 36.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c3f12f57ee59f13e88495a45798766febc5fcaef7a488632db6d8ec906988887
BLAKE2b-256 checksum
How to use checksums
49ea9507fe0a35647cc9a19d77bbab42d02685eaca6da7cd9268c008b0b55da4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Security for segmentstream-connections 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for segmentstream_connections-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page