llm_async_converters
LLMAsyncAdapter
This class converts streaming output (iterable object) from llm into an asynchronous iterable object, and allows for adding callback functions at the start and end of the reception.
Attributes:
Name | Type | Description |
---|---|---|
received_message |
list
|
The list of received complete chunks. |
Source code in src/agere/utils/llm_async_converters.py
at_receiving_end()
async
This method is called at the end of message reception.
For complex callbacks, implementation can be achieved by overwriting this method.
Source code in src/agere/utils/llm_async_converters.py
at_receiving_start()
async
This method is called at the start of message reception.
For complex callbacks, implementation can be achieved by overwriting this method
Source code in src/agere/utils/llm_async_converters.py
llm_to_async_iterable(response, at_receiving_start=None, at_receiving_end=None)
async
translate the response from llm to async iterable