This pull request introduces a new stream method in the AI class, enabling the streaming of responses from the AI model. This method leverages the stream method of the BaseChatModel, yielding BaseMessageChunk objects as they are generated. This enhancement is aimed at improving the user experience by providing real-time responses.
Added stream method in AI class for response streaming.
The stream method utilizes the BaseChatModel.stream method to yield BaseMessageChunk objects.
Added documentation and comments for the new stream method.
Conducted thorough testing to ensure functionality and integration.
This pull request introduces a new
stream
method in theAI
class, enabling the streaming of responses from the AI model. This method leverages thestream
method of theBaseChatModel
, yieldingBaseMessageChunk
objects as they are generated. This enhancement is aimed at improving the user experience by providing real-time responses.stream
method inAI
class for response streaming.stream
method utilizes theBaseChatModel.stream
method to yieldBaseMessageChunk
objects.stream
method.