Client SDK for ai-stream-proxy.
Project description
ai-stream-proxy-sdk
Import name stays ai_stream_proxy.
Install
uv sync
Test
uv run pytest
Build
uv build
Publish
uv publish --token <pypi-token>
Sync usage
from ai_stream_proxy import StreamProxyClient
client = StreamProxyClient(server_url="http://127.0.0.1:3000")
client.create_stream(
stream_id="test",
message_id="message-1",
content_type="claude-code-stream-json+include-partial-messages",
)
with client.new_stream(stream_id="test") as stream:
stream.enqueue(b'{"type":"chunk"}\n')
stream.finish(abort=False, reason="done")
message = client.get_stream_message(stream_id="test")
client.delete_stream(stream_id="test")
client.close()
Async usage
import asyncio
from ai_stream_proxy import AsyncStreamProxyClient
async def main() -> None:
client = AsyncStreamProxyClient(server_url="http://127.0.0.1:3000")
await client.create_stream(
stream_id="test",
message_id="message-1",
content_type="claude-code-stream-json+include-partial-messages",
)
async with client.new_stream(stream_id="test") as stream:
stream.enqueue(b'{"type":"chunk"}\n')
stream.finish(abort=False, reason="done")
message = await client.get_stream_message(stream_id="test")
await client.delete_stream(stream_id="test")
await client.aclose()
asyncio.run(main())
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ai_stream_proxy_sdk-0.2.3.tar.gz.
File metadata
- Download URL: ai_stream_proxy_sdk-0.2.3.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3f6cef63e9d91565c5ed77875af429036358a36909d89898883c1b96084272d
|
|
| MD5 |
547e691ab56de58317a83da7dc2f8742
|
|
| BLAKE2b-256 |
713a640c7b15b651a6a93e054997ab63a00968057bb7036a3f3fb84b97be7247
|
File details
Details for the file ai_stream_proxy_sdk-0.2.3-py3-none-any.whl.
File metadata
- Download URL: ai_stream_proxy_sdk-0.2.3-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1419bd403401a20fc37eba8651ca5fd9aa79d211e759155adad1538a3f8517c2
|
|
| MD5 |
f21304a3076899c5a89b0e0b02d13bf1
|
|
| BLAKE2b-256 |
4678f4190320bc15d50154004df9bdf20736dff882b9e80af2584f6b11d1ed6f
|