Skip to content

v0.7.5

@nshkrdotcom nshkrdotcom tagged this 31 Dec 21:43
Add Python BridgeClient module for direct gRPC communication with the
Elixir BridgeServer. The client supports both unary ExecuteTool and
server-side streaming ExecuteStreamingTool RPCs with automatic chunk
decoding for JSON and raw byte payloads.

New features:
- Python BridgeClient class in priv/python/snakebridge_client.py
- Streaming chunk decoding with metadata and chunk_id preservation
- Correlation ID propagation via x-snakepit-correlation-id header
- Any encoding compatibility using raw JSON bytes convention
- New bridge_client_example demonstrating client usage patterns

Session affinity fixes:
- Ensure session_id is always passed to Snakepit pool for all
  ref-based operations including call_method, get_attr, set_attr,
  release_ref, and stream operations
- Add ensure_session_opt helper to propagate session context
- Fix helper_call to include session affinity in runtime opts

Stream iteration improvements:
- Prefer __iter__ protocol before falling back to __next__
- Add stream_iterate_ref_next for proper iterator advancement
- Handle StopIteration correctly in both iteration paths

Testing infrastructure:
- Add RealPythonCase test support module for consistent setup
- Add comprehensive streaming client tests for RPC selection,
  header propagation, chunk decoding, and binary validation
- Add pytest.ini configuration for Python test discovery

Documentation:
- Clarify streaming RPC usage in README
- Note that supports_streaming: true is required for streaming tools
- Add bridge_client_example to examples README

Dependencies:
- Update snakepit from 0.8.3 to 0.8.4
- Add generated protobuf files for Python client
Assets 2
Loading