gen_ai_hub.proxy.native.google_vertexai.streaming
index
/home/jenkins/agent/workspace/ation_generative-ai-hub-sdk_main/gen_ai_hub/proxy/native/google_vertexai/streaming.py

Streaming response iterators Overriding Google Vertex AI ResponseIterator classes.

 
Modules
       
proto
requests

 
Classes
       
google.api_core.rest_streaming.ResponseIterator(google.api_core._rest_streaming_base.BaseResponseIterator)
ServerSentEventsResponseIterator
google.api_core.rest_streaming_async.AsyncResponseIterator(google.api_core._rest_streaming_base.BaseResponseIterator)
AsyncServerSentEventsResponseIterator

 
class AsyncServerSentEventsResponseIterator(google.api_core.rest_streaming_async.AsyncResponseIterator)
    AsyncServerSentEventsResponseIterator(response: google.auth.aio.transport.Response, response_message_cls: Union[proto.message.Message, google.protobuf.message.Message], prefix: str = 'data: ', suffix: str = '\n\n')
 
Asynchronous Iterator overriding AsyncResponseIterator of VertexAI.
This is support AI Core proxy streamed response format
 
 
Method resolution order:
AsyncServerSentEventsResponseIterator
google.api_core.rest_streaming_async.AsyncResponseIterator
google.api_core._rest_streaming_base.BaseResponseIterator
builtins.object

Methods defined here:
__init__(self, response: google.auth.aio.transport.Response, response_message_cls: Union[proto.message.Message, google.protobuf.message.Message], prefix: str = 'data: ', suffix: str = '\n\n')
Initialize self.  See help(type(self)) for accurate signature.

Methods inherited from google.api_core.rest_streaming_async.AsyncResponseIterator:
async __aenter__(self)
async __aexit__(self, exc_type, exc, tb)
Cancel existing async streaming operation.
__aiter__(self)
async __anext__(self)
async cancel(self)
Cancel existing streaming operation.

Data descriptors inherited from google.api_core._rest_streaming_base.BaseResponseIterator:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class ServerSentEventsResponseIterator(google.api_core.rest_streaming.ResponseIterator)
    ServerSentEventsResponseIterator(response: requests.models.Response, response_message_cls: Union[proto.message.Message, google.protobuf.message.Message], prefix: str = 'data: ', suffix: str = '\n\n')
 

 
 
Method resolution order:
ServerSentEventsResponseIterator
google.api_core.rest_streaming.ResponseIterator
google.api_core._rest_streaming_base.BaseResponseIterator
builtins.object

Methods defined here:
__init__(self, response: requests.models.Response, response_message_cls: Union[proto.message.Message, google.protobuf.message.Message], prefix: str = 'data: ', suffix: str = '\n\n')
Initialize self.  See help(type(self)) for accurate signature.

Methods inherited from google.api_core.rest_streaming.ResponseIterator:
__iter__(self)
__next__(self)
cancel(self)
Cancel existing streaming operation.

Data descriptors inherited from google.api_core._rest_streaming_base.BaseResponseIterator:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Functions
       
process_chunk(obj: str, ready_objs: Deque[str], prefix: str, suffix: str, chunk: str) -> (<class 'str'>, typing.Deque[str])
Process a chunk of a streaming response.
 
This method acts as a helper for `_process_chunk` of `ResponseIterator` and `AsyncResponseIterator`,
providing an overridable method for `BaseResponseIterator`.

 
Data
        Deque = typing.Deque
Union = typing.Union