A stub is generated client-side proxy code that represents remote operations as local callable methods. In a gRPC SDK, it connects a client to a service contract and hides serialization, transport, and response deserialization. section 4.5
A generated stub handles the client-side RPC path:
- Expose one method for each operation declared in the Protocol Buffer service definition. section 4.5
- Serialize Python request objects into binary Protocol Buffer messages. section 4.5
- Send requests through the gRPC channel, optionally with routing metadata. section 4.5
- Deserialize responses and return Python objects to the SDK client. section 4.5
Calling a generated session operation
The SDK builds a GetOrCreateSessionRequest, calls self._stub.GetOrCreateSession(request, metadata=self._metadata), then converts response.session into a Session object.













