Skip to main content

Usage

import asyncio

if __name__ == '__main__':
    from ai_stream_proxy import StreamProxyClient
    async def main():
        client = StreamProxyClient(
            server_url="http://127.0.0.1:3000",
            httpx_async_client_options={'proxy': 'http://127.0.0.1:7890'}
        )

        await client.delete_stream(stream_id='test')

        await client.create_stream(
            stream_id='test',
            message_id='haha',
            content_type='claude-code-stream-json+include-partial-messages'
        )

        async with client.new_stream(stream_id="test") as stream:
            with open('some-claude-code-output.jsonl', 'r') as f:
                while True:
                    chunk = f.read(4096)
                    if not chunk:
                        break
                    stream.enqueue(chunk.encode('utf-8'))
            stream.finish(abort=False, reason="Finish")

        await client.wait_for_current_streams()


    asyncio.run(main())

Metadata

Release files for ai-stream-proxy 0.1.2

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

Source distribution (sdist)

Source distribution for ai-stream-proxy 0.1.2
File Size Uploaded Provenance
ai_stream_proxy-0.1.2.tar.gz 3.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ai-stream-proxy 0.1.2
File Interpreter ABI Platform
ai_stream_proxy-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 8.3 kB

Release files / ai_stream_proxy-0.1.2.tar.gz

Download URL ai_stream_proxy-0.1.2.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2891539b7d4cf5b0f0c0c736ce0b03c07a0475f07cb792b067d48ca05872135e
BLAKE2b-256 checksum
How to use checksums
22a1939243e794c30399f17098cbf5434606ac50aede832cc2def9fa21498829
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.10

Release files / ai_stream_proxy-0.1.2-py3-none-any.whl

Download URL ai_stream_proxy-0.1.2-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ae92007ea9a39b302a55d12921d9d0a0c0b42ecf6ae99298566781db41345a6e
BLAKE2b-256 checksum
How to use checksums
1cf54eae3e1306ab9540c8770a66d2e79c50a63cfa2bd457e2439ed3d72afb37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.10

Security for ai-stream-proxy 0.1.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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